/* ==========================================================================
   Mentrix Abituryent & Student Portal — Ultimate Modern Stylesheet
   ========================================================================== */

:root {
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-light: rgba(99, 102, 241, 0.12);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent-gold: #F59E0B;
  --accent-gold-light: rgba(245, 158, 11, 0.15);
  --accent-cyan: #06B6D4;
  /* Faqat gradientlarda ishlatiladi. Ilgari #A855F7 edi — gradientning
     ochiq uchida oq matn atigi ~2.9 kontrast berardi (hero sarlavhalari,
     nishonlar). To'qroq tus butun gradient bo'ylab o'qilishni ta'minlaydi. */
  --accent-purple: #7E22CE;

  --ok: #10B981;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --warn: #F59E0B;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --err: #EF4444;
  --err-bg: rgba(239, 68, 68, 0.12);
  --sky: #38BDF8;   /* matn sifatida to'q fonda 4.44 edi */
  --sky-bg: rgba(14, 165, 233, 0.12);

  /* Qorong'i mavzu (Standart) */
  --bg: #0B0F19;
  --bg-subtle: #111827;
  --card: #151D2F;
  --card-hover: #1A233A;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(99, 102, 241, 0.4);

  --text: #F8FAFC;
  --text-muted: #94A3B8;
  /* Ilgari #64748B edi — kartochka fonida atigi 3.53 kontrast berardi
     (to'lovlar tarixidagi "N kun oldin" ustuni deyarli o'qilmasdi). */
  --text-dim: #8494AB;
  --border: rgba(255, 255, 255, 0.09);

  --sidebar-w: 260px;
  --header-h: 70px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] {
  --bg: #F1F5F9;
  --bg-subtle: #E2E8F0;
  --card: #FFFFFF;
  --card-hover: #F8FAFC;
  --card-border: #E2E8F0;
  --card-border-hover: #6366F1;

  --text: #0F172A;
  --text-muted: #475569;
  /* Oq fonda #94A3B8 atigi ~2.9 kontrast berardi */
  --text-dim: #64748B;
  --border: #E2E8F0;

  /*
   * HOLAT RANGLARI — yorug' mavzu uchun alohida.
   *
   * Ilgari bu blok faqat kulrang yuzalarni almashtirardi, holat
   * ranglari esa qorong'i mavzudagi yorqin qiymatlarida qolib
   * ketardi. Natijada `.pill` nishonlari ("To'langan ✓",
   * "Kutilmoqda ⏳", XP) oq fonda 1.9–2.2 kontrastda chiqib,
   * deyarli o'qilmasdi. Matn tuslari to'qroq, fon tuslari esa
   * ochiqroq qilindi.
   */
  --primary: #4F46E5;
  --primary-light: rgba(79, 70, 229, 0.10);

  --accent-gold: #7C5108;
  --accent-gold-light: rgba(245, 158, 11, 0.16);

  --ok: #0A6E3E;
  --ok-bg: rgba(16, 185, 129, 0.14);
  --warn: #92600A;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --err: #C92F26;
  --err-bg: rgba(239, 68, 68, 0.12);
  --sky: #0369A1;
  --sky-bg: rgba(14, 165, 233, 0.14);


  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Reset & Asosiy */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Fon nurlari */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient-glow::before {
  content: "";
  position: absolute;
  top: -10%;
  right: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 65%);
  opacity: 0.25;
  filter: blur(80px);
}
.ambient-glow::after {
  content: "";
  position: absolute;
  bottom: 5%;
  left: 5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 65%);
  opacity: 0.2;
  filter: blur(80px);
}

/* ==================== LAYOUT ==================== */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.logo-text h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text) 40%, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 18px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav-link .nav-icon {
  font-size: 18px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-link:hover .nav-icon {
  transform: scale(1.15);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #FFFFFF;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.nav-link.active .nav-icon {
  transform: scale(1.1);
}

.sidebar-foot {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  /* Ilgari oltin->indigo edi; oltin uchida oq matn 2.15 kontrast berardi */
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tag {
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 600;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header */
.top-header {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
}

.page-title h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.page-title p {
  font-size: 12px;
  color: var(--text-dim);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;   /* flex ichida siqilib ketmasin */
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-btn:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--primary);
}

/* Container */
.content-body {
  flex: 1;
  padding: 24px 28px 80px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* Cards & UI Components */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--card-border-hover);
}

.card-h {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-h h2, .card-h h3 {
  font-size: 16px;
  font-weight: 700;
}

.card-b {
  padding: 22px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-primary {
  /* Oq matn uchun boshlang'ich tus to'qroq: #6366F1 da 4.47 edi */
  background: linear-gradient(135deg, #5B54EE, var(--primary-hover));
  color: #FFFFFF;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-gold {
  /* Oq matn oltin fonda 2.15 kontrast berardi. Yorqin rang
     saqlanib, matn to'q jigarrangga o'zgartirildi: 6.97 */
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  color: #451A03;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-ghost {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--primary);
}

.btn-danger {
  background: var(--err-bg);
  color: var(--err);
  border-color: var(--err);
}
.btn-danger:hover {
  background: var(--err);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-w {
  width: 100%;
}

/* ==================== QUIZ OPTION BUTTONS ==================== */
.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 8px;
  border-radius: var(--radius-md, 14px);
  background: var(--bg-subtle, #111827);
  border: 2px solid var(--border, rgba(255, 255, 255, 0.08));
  color: var(--text, #F8FAFC);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  outline: none;
}
.quiz-option-btn:hover {
  background: var(--card-hover, #1A233A);
  border-color: var(--primary, #6366F1);
  transform: translateX(4px);
}
.quiz-option-btn .opt-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  font-weight: 800;
  font-size: 14px;
  color: var(--text, #fff);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.quiz-option-btn .opt-text {
  flex: 1;
  line-height: 1.45;
}
.quiz-option-btn .opt-check {
  display: none;
  font-size: 18px;
  color: #6366F1;
}

/* Selected active state */
.quiz-option-btn.selected {
  background: rgba(99, 102, 241, 0.18) !important;
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 1px #6366F1, 0 6px 18px -3px rgba(99, 102, 241, 0.35) !important;
  color: #FFFFFF !important;
}
.quiz-option-btn.selected .opt-badge {
  background: #6366F1 !important;
  color: #FFFFFF !important;
  border-color: #818CF8 !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.6);
}
.quiz-option-btn.selected .opt-check {
  display: inline-block;
}

/* Grids */
.grid {
  display: grid;
  gap: 20px;
}
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Pills & Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.p-ok   { background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(16,185,129,0.3); }
.p-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(245,158,11,0.3); }
.p-err  { background: var(--err-bg); color: var(--err); border: 1px solid rgba(239,68,68,0.3); }
.p-sky  { background: var(--sky-bg); color: var(--sky); border: 1px solid rgba(14,165,233,0.3); }
.p-gold { background: var(--accent-gold-light); color: var(--accent-gold); border: 1px solid rgba(245,158,11,0.4); }

/* Forms */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.inp, .input, input[type="text"], input[type="number"], input[type="month"], input[type="password"], input[type="email"], select.inp, select.input, textarea.inp, textarea.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-subtle, #111827);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 14px);
  color: var(--text, #F8FAFC);
  outline: none;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  color-scheme: dark;
}
[data-theme="light"] .inp,
[data-theme="light"] .input,
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  color-scheme: light;
}
.inp:focus, .input:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--primary, #6366F1);
  box-shadow: 0 0 0 3px var(--primary-light, rgba(99, 102, 241, 0.2));
  background: var(--card-hover, #1A233A);
}

/* Modal Aliases & Universal Scoped Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: #111827 !important;
  color: #F8FAFC !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 24px !important;
  max-width: 490px;
  width: 100%;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85) !important;
  overflow: hidden;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.22s cubic-bezier(.34, 1.3, .64, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-h {
  padding: 18px 24px;
  background: #0B0F19 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-b {
  padding: 24px;
  overflow-y: auto;
  background: #111827 !important;
  color: #F8FAFC !important;
}
.modal-f {
  padding: 16px 24px;
  background: #0B0F19 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  font-size: 15px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: all 0.15s ease;
  line-height: 1;
}
.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-color: #EF4444;
}

/* Modal ichidagi tugmalar — har qanday theme holatida mukammal kontrast */
.modal-card .btn-ghost {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #F1F5F9 !important;
}
.modal-card .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: #6366F1 !important;
  color: #FFFFFF !important;
}
.modal-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #F8FAFC;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  text-decoration: none;
}
.modal-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  transform: translateY(-1px);
}
.modal-action-btn:active {
  transform: scale(0.99);
}

/* ==================== VIRTUAL MEN CARD ==================== */
.mencard {
  position: relative;
  aspect-ratio: 1.586 / 1;
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  padding: 1.35rem 1.5rem;
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.65), 0 2px 8px rgba(15, 23, 42, 0.3);
  transition: transform 0.28s cubic-bezier(.34, 1.4, .64, 1), box-shadow 0.28s ease;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
@supports not (aspect-ratio: 1) {
  .mencard { height: 220px; }
}
.mencard:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 24px 48px -10px rgba(15, 23, 42, 0.75), 0 4px 12px rgba(15, 23, 42, 0.4);
}
.mencard::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 150%;
  background: linear-gradient(115deg, rgba(255,255,255,0) 35%, rgba(255,255,255,0.18) 48%, rgba(255,255,255,0) 60%);
  transform: rotate(-8deg);
  pointer-events: none;
}
.mencard::after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  right: -90px;
  bottom: -140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.mencard > * { position: relative; z-index: 1; }

/* Karta ranglari */
.mencard.c-midnight { background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #334155 100%); }
.mencard.c-indigo   { background: linear-gradient(135deg, #312e81 0%, #4338ca 50%, #6366f1 100%); }
.mencard.c-emerald  { background: linear-gradient(135deg, #064e3b 0%, #059669 55%, #10b981 100%); }
.mencard.c-sunset   { background: linear-gradient(135deg, #7c2d12 0%, #ea580c 55%, #f59e0b 100%); }
.mencard.c-rose     { background: linear-gradient(135deg, #881337 0%, #e11d48 55%, #fb7185 100%); }
.mencard.c-gold     { background: linear-gradient(135deg, #78350f 0%, #b45309 50%, #fbbf24 100%); color: #1f1400; }
.mencard.c-gold .mencard-chip { background: linear-gradient(135deg, #78350f, #92400e); }

.mencard.is-clickable { cursor: pointer; }
.mencard.is-clickable:active { transform: scale(.985); }
.mencard.is-frozen { filter: grayscale(.65) brightness(.85); }
.mencard.is-frozen::after {
  content: '🔒';
  right: 1.25rem;
  bottom: 1.25rem;
  width: auto; height: auto;
  background: none;
  font-size: 1.6rem;
  opacity: .9;
}

.mencard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .25rem;
}
.mencard-brand {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.mencard-brand small {
  display: block;
  font-size: .5625rem;
  font-weight: 700;
  letter-spacing: .2em;
  opacity: .75;
  margin-top: .25rem;
  text-transform: uppercase;
}
.mencard-status {
  font-size: .65rem;
  font-weight: 800;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.mencard-status.is-blocked {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
}

.mencard-chip {
  width: 44px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b 50%, #d97706);
  position: relative;
  margin: .4rem 0 .5rem;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.25);
}
.mencard-chip::before, .mencard-chip::after {
  content: '';
  position: absolute;
  background: rgba(0, 0, 0, .2);
}
.mencard-chip::before { left: 0; right: 0; top: 50%; height: 1px; }
.mencard-chip::after  { top: 20%; bottom: 20%; left: 50%; width: 1px; }

.mencard-money {
  margin-top: auto;
  margin-bottom: .6rem;
}
.mencard-money .lbl {
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .7;
}
.mencard-money .val {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.mencard-money .cur { font-size: .8rem; font-weight: 700; opacity: .85; }

.mencard-number {
  font-family: var(--mono, ui-monospace, "Courier New", monospace);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .4);
  line-height: 1.25;
  margin-bottom: .55rem;
  white-space: nowrap;
  overflow: hidden;
}

.mencard-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
}
.mencard-label {
  font-size: .52rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: .15rem;
}
.mencard-holder {
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}
.mencard-exp {
  font-size: .85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Karta boshqaruvi va Ranglar tanlash */
.mencard-colors { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.mencard-color {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform .12s, border-color .15s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.mencard-color:hover  { transform: scale(1.15); }
.mencard-color.active { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 0 2px var(--primary); }
.mencard-color.c-midnight { background: linear-gradient(135deg, #0f172a, #334155); }
.mencard-color.c-indigo   { background: linear-gradient(135deg, #4338ca, #7c3aed); }
.mencard-color.c-emerald  { background: linear-gradient(135deg, #065f46, #10b981); }
.mencard-color.c-sunset   { background: linear-gradient(135deg, #9a3412, #f59e0b); }
.mencard-color.c-rose     { background: linear-gradient(135deg, #9f1239, #fb7185); }
.mencard-color.c-gold     { background: linear-gradient(135deg, #78350f, #fbbf24); }

.detail-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.detail-section-title {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: .75rem;
}

/* Copy Row — Yuqori kontrast va o'ta qulay nusxalash */
.copy-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: .6rem;
  cursor: pointer;
  transition: all .15s ease;
  text-align: left;
  width: 100%;
  font: inherit;
  color: #F8FAFC;
}
.copy-row:hover  { border-color: #6366F1; background: rgba(99, 102, 241, 0.12); transform: translateY(-1px); }
.copy-row:active { transform: scale(.99); }
.copy-row-body { flex: 1; min-width: 0; }
.copy-row-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: .2rem;
}
.copy-row-value {
  font-size: .95rem;
  font-weight: 700;
  color: #F8FAFC;
  word-break: break-all;
}
.copy-row-value.mono { font-family: var(--mono, monospace); letter-spacing: .06em; }
.copy-row-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: .9rem;
  color: #94A3B8;
}
.copy-row.is-copied { border-color: #10B981; background: rgba(16, 185, 129, 0.15); }
.copy-row.is-copied .copy-row-icon { background: #10B981; color: #fff; border-color: #10B981; }

/* Tranzaksiyalar — Har qanday sharoitda o'ta aniq ko'rinadigan matnlar */
.mencard-tx {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mencard-tx:last-child { border-bottom: 0; }
.mencard-tx-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 1.1rem;
}
.mencard-tx-icon.in  { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.mencard-tx-icon.out { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
.mencard-tx-icon.wait{ background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.mencard-tx-body { flex: 1; min-width: 0; }
.mencard-tx-title { font-size: .88rem; font-weight: 700; color: #F8FAFC !important; }
.mencard-tx-meta  { font-size: .72rem; color: #94A3B8 !important; margin-top: .15rem; }
.mencard-tx-amount {
  font-weight: 800;
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.mencard-tx-amount.in  { color: #10B981 !important; }
.mencard-tx-amount.out { color: #F8FAFC !important; }

/* Custom scrollbar for modals */
.modal-card div::-webkit-scrollbar {
  width: 6px;
}
.modal-card div::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
.modal-card div::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}
.modal-card div::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==================== HERO KPI BANNER ==================== */
.hero-banner {
  /* Ochiq uchi ilgari #8B5CF6 edi — ustidagi ochiq matn (#C7D2FE) va
     yarim shaffof tugma 2.84-3.44 kontrastga tushardi. To'qroq tus
     gradientning butun uzunligi bo'ylab o'qilishni ta'minlaydi. */
  background: linear-gradient(135deg, #3730A3 0%, #4F46E5 50%, #6D28D9 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px -5px var(--primary-glow);
  margin-bottom: 24px;
}
.hero-banner::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

/* ==================== MOBILE FLOATING NAV ==================== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(16px);
  padding: 0 8px;
}
.mobile-nav-items {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
}
.m-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 12px;
  transition: all 0.15s ease;
}
.m-nav-link .m-icon {
  font-size: 20px;
}
.m-nav-link.active {
  color: var(--primary);
  transform: translateY(-2px);
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-nav {
    display: block;
  }
  .content-body {
    padding: 16px 16px 90px;
  }
  .g3, .g4 {
    grid-template-columns: 1fr;
  }
  .g2 {
    grid-template-columns: 1fr;
  }
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.active {
  display: flex;
  animation: modalFadeIn 0.2s ease-out;
}
.modal-window {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideInRight 0.25s ease-out;
}
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--err); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   MOBIL MOSLASHUV — tor ekranlar uchun tuzatishlar
   --------------------------------------------------------------------------
   Muammo: `.top-header` balandligi qat'iy 70px, yon to'ldirishi 28px va
   sarlavha qisqarmasdi. Telefonda uzun sarlavha ("vazifalar — Mentrix
   Abituryent") uch qatorga bo'linib, sarlavha qutisidan toshib ketardi.
   Yonidagi XP/streak nishonlari esa joyni yanada toraytirardi.

   Quyidagilar mavjud qoidalarni o'zgartirmaydi — faqat tor ekranda
   ustidan yozadi, shuning uchun keng ekrandagi ko'rinish o'z holicha
   qoladi.
   ========================================================================== */

@media (max-width: 720px) {
  .top-header {
    /* Balandlik qat'iy emas: kerak bo'lsa o'sadi, toshib ketmaydi */
    height: auto;
    min-height: var(--header-h);
    padding: 10px 14px;
    gap: 10px;
  }

  /* Chap guruh (burger + sarlavha) qisqara olsin */
  .top-header > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .page-title {
    min-width: 0;
  }

  /* Sarlavha bir qatorda, sig'masa uch nuqta bilan qisqaradi */
  .page-title h1 {
    font-size: 15px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-title p {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* O'ng guruh siqilmasin — nishonlar buzilib ketmasin */
  .header-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .header-actions .pill {
    padding: 5px 9px !important;
    font-size: 12px !important;
  }

  /* Barmoq bilan bosish uchun 40px dan kichik qilmaymiz */
  .header-btn {
    width: 40px;
    height: 40px;
  }
}

/* Juda tor ekran (kichik telefonlar) */
@media (max-width: 420px) {
  .top-header {
    padding: 8px 12px;
  }

  .page-title h1 { font-size: 14px; }
  .page-title p  { display: none; }   /* markaz nomi joy yemasin */

  .header-actions .pill {
    padding: 4px 7px !important;
    font-size: 11px !important;
  }

  .content-body {
    padding: 12px 12px 90px;
  }
}

/* --------------------------------------------------------------------------
   Gorizontal siljishning oldini olish.
   Uzun so'z, karta raqami yoki havola satrni kengaytirib yuborsa,
   butun sahifa yon tomonga suriladi va matn chetdan kesiladi.
   -------------------------------------------------------------------------- */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.main-wrapper,
.content-body {
  min-width: 0;
  max-width: 100%;
}

/* Matn qutidan chiqib ketmasin */
.content-body p,
.content-body h1,
.content-body h2,
.content-body h3,
.content-body li,
.content-body td {
  overflow-wrap: anywhere;
}

/* ==========================================================================
   KARTA SOZLAMALARI VA TO'LDIRISH OYNALARI
   --------------------------------------------------------------------------
   MUHIM: bu oynalarning foni HTML ichida qattiq to'q rangda yozilgan
   (#151D2F). Shuning uchun ular sahifa mavzusi o'zgaruvchilariga
   (--text, --border ...) TAYANMAYDI — yorug' rejimda matn to'q rangga
   aylanib, to'q fonda umuman ko'rinmay qolardi. Oyna o'z rang tizimiga ega.
   ========================================================================== */

.cs-body,
#modalCardTopUp .cs-body {
  --m-txt:   #F1F5F9;   /* asosiy matn */
  --m-dim:   #94A3B8;   /* ikkinchi darajali */
  --m-faint: #7C8CA3;   /* eng xira — 5.18:1, kichik matn uchun ham yetarli */
  --m-line:  rgba(255, 255, 255, .10);
  --m-line2: rgba(255, 255, 255, .18);
  --m-fill:  rgba(255, 255, 255, .045);
  --m-fill2: rgba(255, 255, 255, .085);
  --m-ind:   #818CF8;   /* indigo — bu fonda yaxshi o'qiladi */
  --m-ind-bg: rgba(99, 102, 241, .16);
  --m-ok:    #34D399;
  --m-ok-bg: rgba(16, 185, 129, .15);
  --m-err:   #F87171;
  --m-err-bg: rgba(239, 68, 68, .15);
  --m-warn:  #FBBF24;

  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 72vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--m-txt);
}

/* Nozik aylantirish chizig'i */
.cs-body::-webkit-scrollbar { width: 8px; }
.cs-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .13);
  border-radius: 8px;
}
.cs-body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); }

/* ==========================================================================
   OYNADAGI KICHIK KARTA
   Katta kartaning o'lchamlari 420px uchun sozlangan. Oynada u 320px
   bo'lgani uchun ichidagi matnlar sig'may, raqam kesilib qolardi.
   ========================================================================== */

.cs-preview { display: flex; justify-content: center; }

.mencard.cs-mini {
  width: 100%;
  max-width: 320px;
  margin: 0;
  padding: 1rem 1.15rem;
  border-radius: 17px;
  transition: background .35s ease, filter .3s ease;
}
.mencard.cs-mini:hover { transform: none; }

.cs-mini .mencard-brand      { font-size: .95rem; }
.cs-mini .mencard-brand small{ font-size: .46rem; margin-top: .15rem; }
.cs-mini .mencard-status     { font-size: .58rem; padding: .16rem .5rem; }
.cs-mini .mencard-chip       { width: 34px; height: 25px; margin: .3rem 0 .35rem; border-radius: 5px; }
.cs-mini .mencard-money      { margin-bottom: .35rem; }
.cs-mini .mencard-money .lbl { font-size: .48rem; }
.cs-mini .mencard-money .val { font-size: 1.1rem; }
.cs-mini .mencard-money .cur { font-size: .62rem; }
.cs-mini .mencard-number     { font-size: .82rem; letter-spacing: .09em; margin-bottom: .5rem; }
.cs-mini .mencard-label      { font-size: .45rem; }
.cs-mini .mencard-holder     { font-size: .68rem; }
.cs-mini .mencard-exp        { font-size: .72rem; }
.cs-mini.is-frozen::after    { font-size: 1.1rem; right: .9rem; bottom: .9rem; }

/* ==========================================================================
   MA'LUMOT QATORLARI
   ========================================================================== */

.cs-rows { display: flex; flex-direction: column; gap: 9px; }

.cs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  background: var(--m-fill);
  border: 1px solid var(--m-line);
  border-radius: 15px;
  transition: background .18s, border-color .18s;
}
.cs-row:hover { background: var(--m-fill2); border-color: var(--m-line2); }

.cs-row-l { display: flex; align-items: center; gap: 13px; min-width: 0; }
.cs-row-r { display: flex; gap: 7px; flex-shrink: 0; }

.cs-ico {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--m-ind-bg);
  border: 1px solid rgba(129, 140, 248, .22);
  font-size: 17px;
}

.cs-k {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--m-faint);
  letter-spacing: .7px;
  text-transform: uppercase;
}
.cs-v {
  font-size: 15px;
  font-weight: 700;
  color: var(--m-txt);
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
  margin-top: 3px;
  word-break: break-all;
}
.cs-v.is-open { color: var(--m-ok); letter-spacing: 1.2px; }

.cs-mini-btn {
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 11px;
  border: 1px solid var(--m-line2);
  background: var(--m-fill2);
  color: var(--m-txt);
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, transform .1s;
}
.cs-mini-btn:hover {
  background: var(--m-ind-bg);
  border-color: var(--m-ind);
  color: #C7D2FE;
}
.cs-mini-btn:active { transform: scale(.94); }

/* ==========================================================================
   PIN QUTISI
   ========================================================================== */

.cs-pinbox {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 17px;
  border-radius: 17px;
  background: var(--m-ind-bg);
  border: 1px solid rgba(129, 140, 248, .3);
  animation: csDrop .22s ease;
}
@keyframes csDrop {
  from { opacity: 0; transform: translateY(-7px); }
  to   { opacity: 1; transform: none; }
}
.cs-fld label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--m-dim);
  margin-bottom: 7px;
  letter-spacing: .2px;
}
input.cs-pin-inp {
  width: 100%;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--m-line2);
  background: rgba(9, 13, 24, .55);
  color: var(--m-txt);
  font-size: 21px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 11px;
  text-indent: 11px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .16s, box-shadow .16s;
}
input.cs-pin-inp::placeholder { color: var(--m-faint); }
input.cs-pin-inp:focus {
  border-color: var(--m-ind);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .25);
}
.cs-wide { width: 100%; justify-content: center; padding: 13px; font-weight: 700; }

/* ==========================================================================
   BO'LIM SARLAVHASI
   ========================================================================== */

.cs-sec { display: flex; flex-direction: column; gap: 13px; }
.cs-sec-t {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 800;
  color: var(--m-faint);
  letter-spacing: .9px;
  text-transform: uppercase;
}
.cs-sec-t::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--m-line);
}

/* ==========================================================================
   RANG TANLASH
   ========================================================================== */

.cs-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.cs-color {
  position: relative;
  /* `.mencard-color` dan gradientni olamiz, lekin uning 34px o'lchamini
     bosib o'tishimiz kerak — aks holda tugmalar tor chiziqcha bo'lib qoladi. */
  width: 100%;
  min-width: 0;
  height: 58px;
  border-radius: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .55);
  transition: transform .18s cubic-bezier(.34, 1.4, .64, 1), border-color .18s, box-shadow .18s;
}
.cs-color:hover  { transform: translateY(-3px); box-shadow: 0 9px 20px -6px rgba(0, 0, 0, .65); }
.cs-color:active { transform: translateY(-1px) scale(.97); }

/* Rang nomi kartachaning ostida */
.cs-color::after {
  content: attr(title);
  position: absolute;
  left: 0; right: 0;
  bottom: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  pointer-events: none;
}

.cs-color .cs-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #0F172A;
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .16s, transform .22s cubic-bezier(.34, 1.56, .64, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}

.cs-color.is-on {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, .85), 0 8px 20px -6px rgba(0, 0, 0, .7);
}
.cs-color.is-on .cs-check { opacity: 1; transform: scale(1); }

/* ==========================================================================
   XAVFSIZLIK TUGMASI
   ========================================================================== */

.cs-action {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid var(--m-line);
  background: var(--m-fill);
  cursor: pointer;
  text-align: left;
  transition: background .18s, border-color .18s, transform .1s;
}
.cs-action:hover  { transform: translateY(-1px); }
.cs-action:active { transform: scale(.99); }

.cs-action.is-cold:hover { border-color: rgba(248, 113, 113, .55); background: var(--m-err-bg); }
.cs-action.is-warm:hover { border-color: rgba(52, 211, 153, .55); background: var(--m-ok-bg); }

.cs-action-i {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-size: 19px;
}
.cs-action.is-cold .cs-action-i { background: var(--m-err-bg); border: 1px solid rgba(248, 113, 113, .25); }
.cs-action.is-warm .cs-action-i { background: var(--m-ok-bg);  border: 1px solid rgba(52, 211, 153, .25); }

.cs-action-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cs-action-t b     { font-size: 14px; font-weight: 700; color: var(--m-txt); }
.cs-action-t small { font-size: 11.5px; color: var(--m-dim); line-height: 1.45; }

/* ==========================================================================
   TRANZAKSIYALAR
   ========================================================================== */

.cs-tx { display: flex; flex-direction: column; gap: 8px; }

.cs-tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--m-fill);
  border: 1px solid var(--m-line);
}
.cs-tx-l { display: flex; align-items: center; gap: 12px; min-width: 0; }

.cs-tx-i {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 900;
}
.cs-tx-i.in  { background: var(--m-ok-bg);  color: var(--m-ok); }
.cs-tx-i.out { background: var(--m-err-bg); color: var(--m-err); }

.cs-tx-t {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--m-txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-tx-d {
  font-size: 11px;
  color: var(--m-faint);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.cs-tx-p {
  padding: 1.5px 7px;
  border-radius: 6px;
  background: rgba(251, 191, 36, .16);
  color: var(--m-warn);
  font-weight: 700;
  font-size: 10px;
}
.cs-tx-a {
  font-size: 14.5px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cs-tx-a small { font-size: 10.5px; font-weight: 600; opacity: .7; }
.cs-tx-a.in  { color: var(--m-ok); }
.cs-tx-a.out { color: var(--m-err); }

/* ==========================================================================
   TO'LDIRISH OYNASI
   ========================================================================== */

.tu-step { display: flex; align-items: center; gap: 12px; }
.tu-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 3px 10px -2px rgba(99, 102, 241, .6);
}
.tu-step-t { font-size: 13.5px; font-weight: 700; color: var(--m-txt); }

/* Markazning bank kartasi */
.tu-bank {
  position: relative;
  padding: 19px;
  border-radius: 19px;
  background: linear-gradient(135deg, #0B1120 0%, #1E293B 55%, #334155 100%);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .8);
  overflow: hidden;
  color: #fff;
}
.tu-bank::before {
  content: "";
  position: absolute;
  top: -70px; right: -50px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .34), transparent 68%);
  pointer-events: none;
}
.tu-bank-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
  position: relative;
}
.tu-bank-brand {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: rgba(255, 255, 255, .72);
}
.tu-bank-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3.5px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .92);
}
.tu-bank-num {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2.6px;
  font-variant-numeric: tabular-nums;
  margin-bottom: 17px;
  position: relative;
  word-break: break-all;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.tu-bank-bot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  position: relative;
}
.tu-bank-k {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .5);
  margin-bottom: 4px;
}
.tu-bank-v { font-size: 13px; font-weight: 700; }

.tu-copy {
  flex-shrink: 0;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .13);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, transform .1s;
}
.tu-copy:hover  { background: rgba(255, 255, 255, .24); }
.tu-copy:active { transform: scale(.95); }

.tu-warn {
  padding: 15px 16px;
  border-radius: 15px;
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .3);
  color: var(--m-dim);
  font-size: 12.5px;
  line-height: 1.6;
}
.tu-warn b { color: var(--m-txt); }

/* Summa */
.tu-amount-wrap { position: relative; }
input.tu-amount {
  width: 100%;
  padding: 17px 70px 17px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--m-line2);
  background: rgba(9, 13, 24, .55);
  color: var(--m-txt);
  font-size: 25px;
  font-weight: 800;
  outline: none;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
  transition: border-color .16s, box-shadow .16s;
}
input.tu-amount::placeholder { color: var(--m-faint); }
input.tu-amount:focus {
  border-color: var(--m-ind);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .25);
}
.tu-cur {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--m-faint);
  pointer-events: none;
}

.tu-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.tu-chip {
  padding: 11px 4px;
  border-radius: 12px;
  border: 1px solid var(--m-line2);
  background: var(--m-fill2);
  color: var(--m-dim);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, transform .1s;
}
.tu-chip:hover {
  background: var(--m-ind-bg);
  border-color: var(--m-ind);
  color: #C7D2FE;
}
.tu-chip:active { transform: scale(.94); }

/* Chek yuklash */
.tu-drop {
  display: block;
  position: relative;
  border: 2px dashed var(--m-line2);
  border-radius: 17px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--m-fill);
  transition: border-color .18s, background .18s;
  overflow: hidden;
}
.tu-drop:hover { border-color: var(--m-ind); background: var(--m-ind-bg); }
.tu-drop.has-file { padding: 0; border-style: solid; border-color: var(--m-ok); background: #000; }

.tu-drop-in { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.tu-drop-i  { font-size: 36px; }
.tu-drop-in b     { font-size: 14px; font-weight: 700; color: var(--m-txt); }
.tu-drop-in small { font-size: 11.5px; color: var(--m-dim); }

.tu-preview {
  display: block;
  width: 100%;
  max-height: 250px;
  object-fit: contain;
}

.tu-note {
  padding: 14px 15px;
  border-radius: 14px;
  background: var(--m-ind-bg);
  border: 1px solid rgba(129, 140, 248, .26);
  font-size: 12px;
  color: var(--m-dim);
  line-height: 1.6;
}
.tu-note b { color: var(--m-txt); }

/* ==========================================================================
   TELEFON
   ========================================================================== */

@media (max-width: 520px) {
  .cs-body { padding: 18px 15px 20px; gap: 17px; max-height: 76vh; }

  .mencard.cs-mini { max-width: 100%; }

  .cs-row { flex-direction: column; align-items: stretch; gap: 11px; }
  .cs-row-r .cs-mini-btn { flex: 1; text-align: center; padding: 11px 8px; }

  .cs-colors { grid-template-columns: repeat(2, 1fr); }
  .cs-color  { height: 62px; }

  .tu-bank-num { font-size: 17px; letter-spacing: 1.6px; }
  .tu-bank-bot { flex-direction: column; align-items: stretch; }
  .tu-copy     { width: 100%; padding: 12px; }

  .tu-chips  { grid-template-columns: repeat(2, 1fr); }
  .tu-amount { font-size: 22px; padding-right: 62px; }
}

/* ==========================================================================

/* ==========================================================================
   `[hidden]` TUZATISH — GLOBAL
   --------------------------------------------------------------------------
   `.btn { display: inline-flex }` va `.apf-letter { display: grid }` kabi
   sinf qoidalari brauzerning ichki `[hidden] { display: none }`
   qoidasidan KUCHLIROQ (ikkalasi ham bitta sinf darajasidagi ustunlik,
   lekin muallif CSS UA CSS'dan ustun turadi). Natijada `hidden`
   atributi qo'yilgan elementlar (masalan, surat tanlanmaguncha
   yashirin turishi kerak bo'lgan "Saqlash" tugmasi, yoki surat
   bo'lganda bo'sh qolishi kerak bo'lgan harf-doira) baribir ko'rinib
   qolardi — aynan shu sabab profil oynasida bo'sh binafsha
   to'rtburchak paydo bo'lgan edi.
   ========================================================================== */
[hidden] { display: none !important; }

/* ==========================================================================
   PROFIL: SURAT, USERNAME VA FOYDALANUVCHI QIDIRUVI
   --------------------------------------------------------------------------
   Username butun tizimda yagona (barcha o'quv markazlari bitta bazada),
   shuning uchun uni bilgan odam profilni tezda topa oladi.
   ========================================================================== */

.apf-card { overflow: hidden; }

/*
 * MUHIM: bu qoida ILGARI `.apf-card` ga tegishli BARCHA kartalarning
 * sarlavhasini yashirardi — profil "hero" kartasi o'ziga xos sarlavhaga
 * ega bo'lgani uchun shunday yozilgan edi, lekin "Foydalanuvchini
 * topish" kartasi ham `.apf-card` sinfini ulashadi va uning sarlavhasi
 * ("🔎 Foydalanuvchini topish · Barcha markazlar") ko'rinmay qolgan edi.
 * Faqat hero kartasiga xos qildik.
 */
.apf-profile-card .card-h { display: none; }
.apf-profile-card .card-b { padding: 0; display: flex; flex-direction: column; gap: 0; }

/* ---------- Hero: gradient fon + surat ---------- */

.apf-hero {
  position: relative;
  padding: 28px 24px 22px;
  background:
    radial-gradient(420px 220px at 20% -30%, rgba(255,255,255,.16), transparent 65%),
    linear-gradient(135deg, var(--primary) 0%, var(--accent-purple, #7c3aed) 100%);
  overflow: hidden;
}
.apf-hero::after {
  content: '';
  position: absolute;
  right: -60px; bottom: -70px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.apf-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative; z-index: 1;
  margin-bottom: 18px;
}
.apf-hero-title {
  font-size: 13.5px;
  font-weight: 800;
  color: rgba(255,255,255,.94);
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.apf-hero-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  color: #fff;
  letter-spacing: .03em;
}

.apf-top {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative; z-index: 1;
}

.apf-ava {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.apf-ava img,
.apf-ava .apf-letter {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  object-fit: cover;
  background: rgba(255,255,255,.16);
  border: 3px solid rgba(255,255,255,.75);
  box-shadow: 0 10px 26px -8px rgba(0,0,0,.5);
}
.apf-ava .apf-letter {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
}
.apf-ava[hidden],
.apf-ava .apf-letter[hidden],
.apf-ava img[hidden] { display: none; }

.apf-cam {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card, #151D2F);
  border: 2px solid rgba(255,255,255,.9);
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
  transition: transform .15s;
}
.apf-ava:hover .apf-cam  { transform: scale(1.08); }
.apf-ava:active .apf-cam { transform: scale(.92); }

.apf-top-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.apf-name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apf-handle {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apf-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.apf-mini {
  padding: 8px 13px;
  font-size: 12px;
  border-radius: 10px;
}
.apf-mini.btn-primary {
  background: #fff;
  color: var(--primary);
  border-color: transparent;
  font-weight: 800;
}
.apf-mini.btn-ghost {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.32);
  color: #fff;
}

.apf-hero-hint {
  position: relative; z-index: 1;
  margin: 12px 0 0;
  font-size: 11.5px;
  color: rgba(255,255,255,.78);
}

/* ---------- Pastki qism: username va tavsiya ---------- */

.apf-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 18px; }

.apf-user { display: flex; flex-direction: column; gap: 10px; }

.apf-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.apf-at { position: relative; }
.apf-at-sign {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  pointer-events: none;
}
.apf-at .inp {
  padding-left: 32px !important;
  padding-right: 44px !important;
  font-weight: 700;
  letter-spacing: .3px;
}
.apf-state {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 900;
  pointer-events: none;
}
.apf-state.is-ok   { color: var(--ok); }
.apf-state.is-bad  { color: var(--err); }
.apf-state.is-wait { opacity: .7; }

.apf-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.apf-hint.is-ok  { color: var(--ok);  font-weight: 700; }
.apf-hint.is-bad { color: var(--err); font-weight: 700; }

.apf-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, .24);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}
.apf-note-i { flex: 0 0 auto; font-size: 16px; line-height: 1; margin-top: 1px; }
.apf-note b { color: var(--text); }

.apf-save {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-weight: 800;
  font-size: 14px;
  border-radius: 13px;
  box-shadow: 0 10px 22px -8px rgba(79,70,229,.55);
}

/* ---------- Qidiruv kartasi sarlavhasi ---------- */

.apf-search-title { display: flex; align-items: center; gap: 10px; }
.apf-search-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-light);
  font-size: 16px;
}

/* ---------- Qidiruv maydoni ---------- */

.apf-search-card .card-b { display: flex; flex-direction: column; gap: 16px; }

.apf-search { position: relative; }
.apf-search-i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
  opacity: .8;
}
.apf-search .inp {
  padding-left: 42px !important;
  padding-top: 13px !important;
  padding-bottom: 13px !important;
  border-radius: 14px;
}

.apf-results { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Bo'sh holat illyustratsiyasi ---------- */

.apf-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 16px 22px;
  text-align: center;
}
.apf-search-empty-i {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-light);
  font-size: 24px;
  margin-bottom: 6px;
}
.apf-search-empty p {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.apf-search-empty-s {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.5;
}

.apf-r {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--border);
  transition: background .16s, border-color .16s;
}
.apf-r:hover { background: rgba(255, 255, 255, .07); border-color: var(--primary); }
[data-theme="light"] .apf-r { background: #fff; }
[data-theme="light"] .apf-r:hover { background: var(--primary-light); }

.apf-r-ava {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  object-fit: cover;
}
.apf-r-letter {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple, #7c3aed));
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.apf-r-t { flex: 1; min-width: 0; }
.apf-r-n {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apf-r-u { font-size: 12.5px; font-weight: 700; color: var(--primary); margin-top: 1px; }

.apf-r-m {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: 0 0 auto;
  text-align: right;
}
.apf-r-role {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}
.apf-r-c {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- "Foydalanuvchi ma'lumotlari" kartasidagi kichik avatar ---------- */
/* Endi profil surati bilan bir xil manbadan chiqadi — mos kelmaslik yo'q. */

.apf-info-ava {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
  flex: 0 0 auto;
}

/* ---------- Sidebar: brend belgisi va foydalanuvchi surati ---------- */
/* Profil surati o'rnatilganda ikkalasi ham o'sha suratni ko'rsatadi. */

.logo-badge-photo,
.user-avatar-photo {
  padding: 0;
  overflow: hidden;
}
.logo-badge-photo img,
.user-avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Telefon ---------- */

@media (max-width: 560px) {
  .apf-hero { padding: 22px 18px 18px; }
  .apf-top  { flex-direction: column; align-items: flex-start; gap: 14px; }
  .apf-ava, .apf-ava img, .apf-ava .apf-letter { width: 76px; height: 76px; border-radius: 22px; }
  .apf-ava .apf-letter { font-size: 29px; }
  .apf-body { padding: 18px 18px 20px; }

  .apf-r { flex-wrap: wrap; }
  .apf-r-m { flex-direction: row; align-items: center; width: 100%; justify-content: flex-start; }
  .apf-r-c { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .apf-cam { transition: none; }
  .apf-ava:hover .apf-cam, .apf-ava:active .apf-cam { transform: none; }
}

/* ==========================================================================
   TO'LOV JADVALI — oy-oy holat
   --------------------------------------------------------------------------
   Ilgari "joriy oy uchun to'lov" kartasi FAQAT joriy oyni ko'rsatardi va
   summa doim 450 000 (qattiq yozilgan zaxira qiymat) chiqardi — sababi
   `ziyo_invoices` jadvalida `amount` ustuni umuman yo'q edi. Endi bu yerda
   har oy uchun alohida qator: to'langan/to'lanmagan/qisman/kelasi oy.
   ========================================================================== */

.fin-months {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.fin-month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--border);
  transition: background .16s, border-color .16s;
}
[data-theme="light"] .fin-month-row { background: rgba(15, 23, 42, .025); }

.fin-month-row.is-current {
  border-color: rgba(99, 102, 241, .4);
  background: var(--primary-light);
}

.fin-month-row.st-unpaid  { border-color: rgba(239, 68, 68, .28); }
.fin-month-row.st-partial { border-color: rgba(245, 158, 11, .28); }

.fin-month-l { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fin-month-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.fin-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-hover);
  color: #fff;
}
.fin-month-sum {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.fin-paid-part { color: var(--ok); font-weight: 700; }

.fin-month-r {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.fin-pay-btn {
  padding: 7px 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .6);
  transition: transform .1s, box-shadow .16s;
}
.fin-pay-btn:hover  { box-shadow: 0 6px 16px -4px rgba(99, 102, 241, .75); }
.fin-pay-btn:active { transform: scale(.95); }

.fin-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
[data-theme="light"] .fin-total-row { background: rgba(15, 23, 42, .025); }

@media (max-width: 560px) {
  .fin-month-row { flex-wrap: wrap; }
  .fin-month-r { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .fin-pay-btn { transition: none; }
  .fin-pay-btn:active { transform: none; }
}

/* ==========================================================================
   SILLIQLIK VA QULAYLIK QATLAMI — abituryent ilovasi
   --------------------------------------------------------------------------
   O'lchov: bu faylda 13 xil o'tish davomiyligi ishlatilgan edi (.1s dan
   .35s gacha) va `focus-visible` umuman yo'q edi. Ustiga-ustak to'rt
   joyda `outline: none` bor — ya'ni klaviatura bilan yuradigan odam
   qayerda turganini KO'RMASDI.

   Bu yerda: yagona harakat ritmi, klaviatura fokusining qaytarilishi
   va harakatga sezgir odamlar uchun himoya.
   ========================================================================== */

:root {
    --t-fast: 110ms;
    --t-base: 180ms;
    --t-slow: 280ms;
    --ease: cubic-bezier(.2, .8, .3, 1);
    --ease-pop: cubic-bezier(.34, 1.4, .64, 1);
}

/* ---------- Yagona ritm ---------- */

.btn,
.nav-link, .m-nav-link,
.header-btn,
.card,
.inp, .input, textarea, select,
.pill,
.apf-card, .apf-r, .cs-row, .cs-action, .cs-mini-btn, .cs-color,
.fin-month-row, .fin-pay-btn,
.tu-chip, .tu-copy, .tu-drop,
.apf-mini, .apf-ava {
    transition:
        background-color var(--t-base) var(--ease),
        border-color     var(--t-base) var(--ease),
        color            var(--t-base) var(--ease),
        box-shadow       var(--t-base) var(--ease),
        transform        var(--t-fast) var(--ease);
}

.btn:active,
.header-btn:active,
.fin-pay-btn:active,
.cs-mini-btn:active,
.apf-mini:active { transform: scale(.97); }

/* ---------- Klaviatura fokusi (qaytarildi) ---------- */
/*
 * Yuqorida `outline: none` bilan o'chirilgan fokus shu yerda
 * `:focus-visible` orqali qaytariladi. Farqi: bu faqat klaviatura
 * bilan yurganda ko'rinadi — sichqoncha bilan bosganda chiqmaydi,
 * shuning uchun dizaynga xalaqit bermaydi.
 */
.btn:focus-visible,
.nav-link:focus-visible,
.m-nav-link:focus-visible,
.header-btn:focus-visible,
.fin-pay-btn:focus-visible,
.cs-mini-btn:focus-visible,
.cs-color:focus-visible,
.tu-chip:focus-visible,
.tu-copy:focus-visible,
.apf-mini:focus-visible,
.apf-ava:focus-visible,
.quiz-option-btn:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm, 8px);
}

/* Maydonlar uchun halqa ichkarida — chegara bilan uyg'un ko'rinadi */
.inp:focus-visible,
.input:focus-visible,
textarea:focus-visible,
select:focus-visible,
input.cs-pin-inp:focus-visible,
input.tu-amount:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* ---------- Aylantirish chizig'i ---------- */

* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    opacity: .4;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

html { scroll-behavior: smooth; }

/* ---------- Yuklanish holati ---------- */
/*
 * Tugma bosilgach javob ko'rinmasa, odam ikkinchi marta bosadi —
 * to'lovlarda bu takroriy yechilishga olib keladi.
 */
.btn[disabled],
.btn.is-busy,
button[disabled] {
    opacity: .6;
    cursor: progress;
    pointer-events: none;
}

/* ---------- Jadval qatorlari ---------- */
tbody tr { transition: background-color var(--t-base) var(--ease); }
tbody tr:hover { background: var(--card-hover); }

/* ---------- Harakatni kamaytirish ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .btn:active, .header-btn:active, .fin-pay-btn:active,
    .cs-mini-btn:active, .apf-mini:active { transform: none; }
}

/* Mobil menyudagi faol yorliq atigi 10px — qorong'i fonda
   `--primary` (#6366F1) 3.76 kontrast berardi. Faqat shu mavzu
   uchun ochiqroq indigo (yorug' mavzuda u oq fonda ko'rinmasdi). */
[data-theme="dark"] .m-nav-link.active { color: #A5B4FC; }

/* Kichik amal tugmasi barmoq uchun 40px dan kam bo'lmasin */
.apf-mini { min-height: 40px; }
