/* ================================================================
   MeningVaqtim — Dizayn tizimi (Faza 17: Landing bilan uyg'un)
   Light mode · Landing page bilan bir xil rang tizimi
   ================================================================ */

/* 1. DIZAYN TOKENLAR
   ================================================================ */
:root {
  /* Asosiy ranglar — Asal sariq (Honey Amber) */
  --rb:           #E89038;   /* Honey Amber — birlamchi */
  --rb-dark:      #C47422;   /* To'q amber */
  --rb-soft:      rgba(232,144,56,.12);
  --amber:        #E89038;   /* Amber */
  --amber-dark:   #C47422;
  --amber-soft:   rgba(232,144,56,.12);
  --peri:         #FDE68A;   /* Och sariq */
  --mist:         #FFFBF2;   /* Iliq sahifa foni */

  /* Semantik tokenlar */
  --color-bg:        #FFFBF2;
  --color-surface:   #FFFFFF;
  --color-surface-2: #FEF3C7;
  --color-accent:    #E89038;
  --color-accent-d:  #C47422;
  --color-teal:      #16A34A;   /* Yashil — bajarilganlar uchun */
  --color-gold:      #E89038;   /* Amber — streak/yutuqlar */
  --color-text:      #1E293B;   /* Asosiy matn */
  --color-muted:     #64748B;   /* Ikkilamchi matn */
  --color-border:    #E2E8F8;   /* Chegara */
  --color-success:   #16A34A;
  --color-warning:   #D97706;
  --color-error:     #DC2626;

  /* Spacing — 8px grid */
  --sp-1:  8px;
  --sp-2:  16px;
  --sp-3:  24px;
  --sp-4:  32px;
  --sp-5:  40px;
  --sp-6:  48px;
  --sp-8:  64px;

  /* Tipografiya */
  --font-heading: 'Syne', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-code:    'Courier Prime', 'Courier New', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Radius */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadow — light mode */
  --shadow-sm:   0 1px 3px rgba(30,41,59,.06), 0 1px 2px rgba(30,41,59,.04);
  --shadow:      0 4px 16px rgba(30,41,59,.10), 0 2px 6px rgba(30,41,59,.06);
  --shadow-lg:   0 8px 32px rgba(30,41,59,.14), 0 4px 12px rgba(30,41,59,.08);
  --shadow-glow: 0 0 0 3px rgba(232,144,56,.20), 0 4px 20px rgba(232,144,56,.25);

  /* Transition */
  --tr-fast:        150ms ease;
  --tr:             250ms ease;
  --tr-slow:        400ms ease;
  --transition-fast: 150ms ease;  /* alias */

  /* Navbar */
  --navbar-h: 64px;
}

/* 2. ASOSIY RESET
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body.app-body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 3. TIPOGRAFIYA
   ================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  margin-top: 0;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { margin-top: 0; margin-bottom: var(--sp-2); }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--tr-fast);
}
a:hover { color: var(--rb-dark); text-decoration: underline; }

code, kbd {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: rgba(61,99,232,.08);
  color: var(--color-accent);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
pre {
  font-family: var(--font-code);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--sp-2);
  overflow-x: auto;
}

/* 4. LAYOUT SHELL
   ================================================================ */
.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp-3);
  padding-top: calc(var(--navbar-h) + var(--sp-3));
}

.top-bar {
  display: block;
  margin-bottom: var(--sp-3);
}

/* /dashboard: salomlashuv card wrapper (o'chiriladigan) */
.welcome-dismiss-wrap {
  margin-bottom: var(--sp-3);
}
.welcome-dismiss-sidebar {
  margin-bottom: 0;
}

.welcome-mini-card {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-2) var(--sp-3);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
}
.welcome-mini-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--rb), var(--peri));
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.welcome-mini-text { flex: 1; min-width: 0; }
.welcome-mini-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
  color: var(--color-text);
  white-space: nowrap;
}
.welcome-mini-sub {
  font-size: var(--text-xs);
  color: var(--color-muted);
  white-space: nowrap;
}

/* Dismiss (×) tugmasi — hover da ko'rinadi */
.welcome-dismiss-btn {
  position: absolute;
  top: 6px; right: 6px;
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: none; border: none;
  color: var(--color-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--tr-fast), color var(--tr-fast), background var(--tr-fast);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1;
  flex-shrink: 0;
}
.welcome-mini-card:hover .welcome-dismiss-btn {
  opacity: 1;
}
.welcome-dismiss-btn:hover {
  color: #dc2626;
  background: rgba(220,38,38,.1);
}

/* Sidebar iqtibosi */
.quote-sidebar {
  padding: 20px 18px 20px !important;
  min-height: unset !important;
  max-height: unset !important;
  overflow: visible !important;
  justify-content: flex-start !important;
}
.quote-sidebar .quote-body {
  max-height: 320px;
  overflow: hidden;
  position: relative;
}
.quote-sidebar .quote-body::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--color-surface));
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.quote-sidebar .quote-body.is-truncated::after {
  opacity: 1;
}
.quote-sidebar .quote-text {
  font-size: 0.82rem !important;
  line-height: 1.65;
  margin-bottom: 8px;
  word-break: break-word;
  overflow-wrap: break-word;
}
.quote-sidebar .quote-author {
  font-size: 0.72rem !important;
  margin-top: 10px;
  display: block;
}
.quote-sidebar .quote-author-desc {
  font-size: 0.64rem !important;
  display: block;
  margin-top: 2px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--sp-3);
  align-items: start;
}
.content-grid.no-sidebar {
  grid-template-columns: 1fr;
}

.main-content { min-width: 0; }

.sidebar {
  position: sticky;
  top: calc(var(--navbar-h) + var(--sp-3));
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: calc(100vh - var(--navbar-h) - var(--sp-6));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--peri) transparent;
}

/* 5. NAVBAR
   ================================================================ */
.app-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(61,99,232,.06), 0 2px 8px rgba(30,41,59,.06);
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-3);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; }

.logo-mark { display: block; flex-shrink: 0; }

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-lg);
  line-height: 1;
  letter-spacing: -0.02em;
  display: flex;
  gap: 0;
}
.logo-vaqt { color: var(--color-text); }
.logo-im   { color: var(--color-accent); }

/* Nav page links */
.nav-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--color-muted);
  transition: background var(--tr-fast), color var(--tr-fast), box-shadow var(--tr-fast);
}
.nav-page-link:hover {
  background: var(--color-surface-2);
  color: var(--color-accent);
  text-decoration: none;
}
.nav-page-link.is-active {
  background: rgba(61,99,232,.12);
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px rgba(61,99,232,.2);
}

/* Prayer compact strip */
.nav-prayer { flex: 1; overflow: hidden; min-width: 0; }

.prayer-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.prayer-strip::-webkit-scrollbar { display: none; }

.prayer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  min-width: 60px;
  transition: background var(--tr-fast);
  flex-shrink: 0;
  background: var(--color-surface);
}
.prayer-item .prayer-icon {
  font-size: 0.85rem;
  line-height: 1;
  margin-bottom: 1px;
}
.prayer-item .prayer-name {
  font-size: 10px;
  color: var(--color-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.prayer-item .prayer-time {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.prayer-item.is-current {
  background: rgba(61,99,232,.08);
  border-color: rgba(61,99,232,.3);
}
.prayer-item.is-current .prayer-name,
.prayer-item.is-current .prayer-time { color: var(--color-accent); }
.prayer-item.is-next {
  background: rgba(232,144,56,.08);
  border-color: rgba(232,144,56,.3);
}
.prayer-item.is-next .prayer-name,
.prayer-item.is-next .prayer-time { color: var(--amber-dark); }

/* Language switcher — mobil menyu uchun saqlanadi */
.lang-btn { color: var(--color-text); line-height: 1; }
.lang-btn:hover { opacity: 1 !important; background: var(--color-hover) !important; }
.lang-btn-active {
  background: var(--color-accent) !important;
  color: #fff !important;
  opacity: 1 !important;
}

/* ── Language dropdown (desktop header) ──────────────────────── */
.lang-dropdown {
  position: relative;
  flex-shrink: 0;
}

/* Trigger tugmasi */
.lang-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 8px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  cursor: pointer;
  font-size: 1.05rem;
  font-family: var(--font-body);
  transition: background var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.lang-dropdown-trigger:hover {
  background: rgba(232,144,56,.08);
  color: var(--color-accent);
  border-color: rgba(232,144,56,.25);
}
.lang-dropdown.is-open .lang-dropdown-trigger {
  background: rgba(232,144,56,.12);
  color: var(--color-accent);
  border-color: rgba(232,144,56,.35);
  box-shadow: 0 2px 8px rgba(232,144,56,.15);
}

.lang-dropdown-current {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .03em;
  font-family: var(--font-heading);
}

.lang-dropdown-chevron {
  color: currentColor;
  opacity: .6;
  transition: transform var(--tr-fast);
  flex-shrink: 0;
}
.lang-dropdown.is-open .lang-dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Dropdown panel */
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 168px;
  padding: 4px;
  z-index: 300;
    /* Click bilan ko'rsatiladi — .is-open classini JS qo'shadi */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(.97);
  transform-origin: top right;
  transition: opacity var(--tr-fast), transform var(--tr-fast);
}
.lang-dropdown.is-open .lang-dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* Dropdown item */
.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--color-text);
  text-align: left;
  transition: background var(--tr-fast), color var(--tr-fast);
}
.lang-dropdown-item:hover {
  background: var(--color-surface-2);
  color: var(--color-accent);
  text-decoration: none;
}
/* Faol til */
.lang-dropdown-item.lang-btn-active {
  background: rgba(232,144,56,.1) !important;
  color: var(--color-accent) !important;
  font-weight: 600;
}
.lang-flag { font-size: 1.05rem; line-height: 1; flex-shrink: 0; }
.lang-name { flex: 1; }
.lang-code-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-muted);
  font-family: var(--font-heading);
  letter-spacing: .03em;
}
.lang-dropdown-item.lang-btn-active .lang-code-badge {
  color: var(--color-accent);
}

/* Profile */
.nav-profile { flex-shrink: 0; position: relative; margin-left: auto; }

.btn-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 4px;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--tr-fast), border-color var(--tr-fast), box-shadow var(--tr-fast);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
}
.btn-profile:hover {
  background: rgba(61,99,232,.08);
  border-color: rgba(61,99,232,.35);
  box-shadow: 0 2px 8px rgba(61,99,232,.12);
}
.avatar-sm {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: linear-gradient(135deg, var(--rb), var(--peri));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.25);
}
.avatar-sm svg { width: 100%; height: 100%; display: block; }
.chevron {
  color: var(--color-muted);
  transition: transform var(--tr-fast);
  pointer-events: none;
}
.btn-profile[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--tr-fast), transform var(--tr-fast);
}
.profile-dropdown.is-open {
  opacity: 1; pointer-events: all; transform: translateY(0);
}
.dropdown-header {
  padding: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.text-muted-sm { font-size: var(--text-xs); color: var(--color-muted); }

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px var(--sp-2);
  background: none; border: none;
  color: var(--color-text);
  font-size: var(--text-sm); font-family: var(--font-body);
  cursor: pointer; text-align: left; text-decoration: none;
  transition: background var(--tr-fast);
}
.dropdown-item:hover {
  background: var(--color-surface-2);
  text-decoration: none; color: var(--color-accent);
}
.dropdown-item.danger { color: var(--color-error); }
.dropdown-item.danger:hover { background: rgba(220,38,38,.08); color: var(--color-error); }

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: none;
  padding: 6px; cursor: pointer; margin-left: auto;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--color-text); border-radius: 2px;
  transition: transform var(--tr-fast), opacity var(--tr-fast);
}
.nav-mobile {
  /* display:flex emas — hidden atributini bekor qilmaydi */
  flex-direction: column; gap: 4px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--sp-2);
  box-shadow: 0 8px 16px rgba(30,41,59,.08);
}
.nav-mobile:not([hidden]) { display: flex; }
.nav-mobile-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--sp-2);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: var(--text-base);
  font-weight: 500;
  transition: background var(--tr-fast), color var(--tr-fast);
}
.nav-mobile-item:hover {
  background: var(--color-surface-2);
  color: var(--color-accent);
  text-decoration: none;
}

/* Active nav link */
.nav-link-active { color: var(--color-accent) !important; font-weight: 600; }

/* Mobile nav — qo'shimcha elementlar */
.nav-mobile-sep {
  height: 1px;
  background: var(--color-border);
  margin: 4px var(--sp-2);
}

.nav-mobile-lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--sp-2);
}

.nav-mobile-lang-label {
  font-size: 1rem;
  color: var(--color-muted);
}

.nav-mobile-lang-btns {
  display: flex;
  gap: 2px;
  background: var(--color-surface-2);
  border-radius: 20px;
  padding: 2px;
  border: 1px solid var(--color-border);
}

.nav-mobile-item.nav-mobile-danger {
  color: var(--color-error);
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-body);
  cursor: pointer;
  font-size: var(--text-base);
}
.nav-mobile-item.nav-mobile-danger:hover {
  background: rgba(220,38,38,.08) !important;
  color: var(--color-error) !important;
  text-decoration: none;
}

/* 6. KOMPONENTLAR
   ================================================================ */

/* 6.1 Tugmalar */
.btn-mv {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  padding: 10px var(--sp-3);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none;
  transition: background var(--tr-fast), border-color var(--tr-fast),
              transform var(--tr-fast), box-shadow var(--tr-fast);
  white-space: nowrap; user-select: none; line-height: 1;
}
.btn-mv:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn-mv:active { transform: scale(.97); }
.btn-mv:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn-mv:hover { text-decoration: none; }

.btn-mv.btn-primary {
  background: var(--color-accent); color: #fff; border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(61,99,232,.25);
}
.btn-mv.btn-primary:hover {
  background: var(--rb-dark);
  border-color: var(--rb-dark);
  box-shadow: 0 4px 16px rgba(61,99,232,.35);
  transform: translateY(-1px);
}

.btn-mv.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}
.btn-mv.btn-secondary:hover {
  background: var(--color-surface-2);
  border-color: rgba(61,99,232,.25);
  transform: translateY(-1px);
}

.btn-mv.btn-ghost {
  background: transparent; color: var(--color-accent); border-color: transparent;
}
.btn-mv.btn-ghost:hover {
  background: rgba(61,99,232,.08);
  border-color: rgba(61,99,232,.2);
}

.btn-mv.btn-teal {
  background: var(--color-teal); color: #fff; border-color: var(--color-teal);
  box-shadow: 0 2px 8px rgba(22,163,74,.25);
}
.btn-mv.btn-teal:hover {
  background: #15803D;
  box-shadow: 0 4px 16px rgba(22,163,74,.3);
  transform: translateY(-1px);
}

.btn-mv.btn-danger {
  background: var(--color-error); color: #fff; border-color: var(--color-error);
  box-shadow: 0 2px 8px rgba(220,38,38,.2);
}
.btn-mv.btn-danger:hover { background: #B91C1C; transform: translateY(-1px); }

.btn-mv.btn-sm { padding: 6px var(--sp-2); font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-mv.btn-lg { padding: 14px var(--sp-4); font-size: var(--text-base); border-radius: var(--radius-lg); }
.btn-mv.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-mv.btn-full { width: 100%; }

/* 6.2 Kartalar */
.card-mv {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  transition: border-color var(--tr), box-shadow var(--tr), transform var(--tr);
  box-shadow: var(--shadow-sm);
}
.card-mv.hoverable:hover {
  border-color: rgba(61,99,232,.2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-mv-surface2 { background: var(--color-surface-2); }

.card-mv-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-2); padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
}
.card-mv-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-heading); font-size: var(--text-base);
  font-weight: 700; margin: 0; color: var(--color-text);
}
.card-mv-title i { color: var(--color-accent); font-size: 1rem; }

/* 6.3 Inputlar */
.input-mv {
  display: block; width: 100%;
  padding: 10px var(--sp-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-body); font-size: var(--text-sm); line-height: 1.5;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
  outline: none;
  box-shadow: var(--shadow-sm);
}
.input-mv::placeholder { color: var(--color-muted); }
.input-mv:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(61,99,232,.15);
}
.input-mv.is-error { border-color: var(--color-error); }
.input-mv.is-success { border-color: var(--color-success); }

.label-mv {
  display: block; margin-bottom: 6px;
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text);
}
.form-group-mv { margin-bottom: var(--sp-2); }
.input-hint { margin-top: 4px; font-size: var(--text-xs); color: var(--color-muted); }
.input-error-msg { margin-top: 4px; font-size: var(--text-xs); color: var(--color-error); }
.form-label-mv {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

/* 6.4 Modal */
.modal-mv-overlay {
  position: fixed; inset: 0;
  background: rgba(30,41,59,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-3);
  opacity: 0; pointer-events: none;
  transition: opacity var(--tr);
}
.modal-mv-overlay.is-open { opacity: 1; pointer-events: all; }

.modal-mv {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-4);
  width: 100%; max-width: 520px;
  max-height: calc(100vh - var(--sp-8));
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform var(--tr);
  box-shadow: var(--shadow-lg);
}
.modal-mv-overlay.is-open .modal-mv { transform: translateY(0) scale(1); }

.modal-mv-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
}
.modal-mv-title {
  font-family: var(--font-heading); font-size: var(--text-xl);
  font-weight: 700; margin: 0;
}
.modal-mv-close {
  background: none; border: none; color: var(--color-muted);
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  font-size: 1.4rem; line-height: 1;
  transition: color var(--tr-fast), background var(--tr-fast);
}
.modal-mv-close:hover { color: var(--color-text); background: var(--color-surface-2); }

/* 6.5 Badge */
.badge-mv {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.03em;
  border: 1px solid transparent;
}
.badge-mv.badge-blue    { background: rgba(232,144,56,.12); color: var(--color-accent); border-color: rgba(232,144,56,.3); }
.badge-mv.badge-teal    { background: rgba(22,163,74,.1);  color: var(--color-teal);   border-color: rgba(22,163,74,.25); }
.badge-mv.badge-gold    { background: rgba(232,144,56,.12); color: var(--amber-dark);  border-color: rgba(232,144,56,.3); }
.badge-mv.badge-success { background: rgba(22,163,74,.1);  color: var(--color-success); border-color: rgba(22,163,74,.25); }
.badge-mv.badge-warning { background: rgba(217,119,6,.1);  color: var(--color-warning); border-color: rgba(217,119,6,.25); }
.badge-mv.badge-error   { background: rgba(220,38,38,.1);  color: var(--color-error);   border-color: rgba(220,38,38,.25); }
.badge-mv.badge-muted   { background: rgba(100,116,139,.08); color: var(--color-muted); border-color: rgba(100,116,139,.18); }

.badge-mv.badge-pulse::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s infinite;
}

/* 6.6 Progress bar */
.progress-mv {
  width: 100%; height: 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.progress-mv-fill {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-accent) 0%, #7B9EFF 100%);
  transition: width 600ms cubic-bezier(.4,0,.2,1);
}
.progress-mv .progress-mv-fill { border: none; }
.progress-mv.progress-gold .progress-mv-fill {
  background: linear-gradient(90deg, var(--amber) 0%, #F5B560 100%);
}
.progress-mv.progress-success .progress-mv-fill {
  background: linear-gradient(90deg, var(--color-success) 0%, #4ADE80 100%);
}
.progress-mv.progress-lg { height: 10px; }

/* 6.7 SVG Taymer halqasi */
/* Timer card: rejim bo'yicha fon */
.timer-card {
  background: linear-gradient(145deg,#fff 70%, rgba(232,144,56,.06) 100%);
  transition: background 0.6s ease;
}
.timer-card.mode-focus {
  background: linear-gradient(145deg, #FFFDF5 60%, rgba(232,144,56,.10) 100%);
  border-color: rgba(232,144,56,.30);
}
.timer-card.mode-focus .timer-ring-fill:not(.ring-gold):not(.ring-pause):not(.ring-success) {
  stroke: var(--amber);
}
.timer-card.mode-short {
  background: linear-gradient(145deg, #F5FFFB 60%, rgba(22,163,74,.08) 100%);
  border-color: rgba(22,163,74,.25);
}
.timer-card.mode-short .timer-ring-fill:not(.ring-pause):not(.ring-success) {
  stroke: #16A34A;
}
.timer-card.mode-long {
  background: linear-gradient(145deg, #F5F8FF 60%, rgba(99,102,241,.08) 100%);
  border-color: rgba(99,102,241,.25);
}
.timer-card.mode-long .timer-ring-fill:not(.ring-pause):not(.ring-success) {
  stroke: #6366F1;
}

.timer-ring-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: fit-content; margin: 0 auto;
}
.timer-ring { transform: rotate(-90deg); }
.timer-ring-bg {
  fill: none;
  stroke: var(--color-surface-2);
  stroke-width: 6;
}
.timer-ring-fill {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 339.29;
  stroke-dashoffset: calc(339.29 * (1 - var(--progress, 1)));
  transition: stroke-dashoffset 1s linear;
}
.timer-ring-fill.ring-gold    { stroke: var(--amber); }
.timer-ring-fill.ring-pause   { stroke: var(--color-teal); }
.timer-ring-fill.ring-success { stroke: var(--color-success); }

.timer-ring-label {
  position: absolute;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.timer-ring-time {
  font-family: var(--font-heading);
  font-size: var(--text-4xl); font-weight: 800;
  color: var(--color-text); line-height: 1;
  letter-spacing: -0.03em;
}
.timer-ring-status {
  font-size: var(--text-xs); color: var(--color-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px;
  font-weight: 600;
}

/* 7. VIDJETLAR
   ================================================================ */

/* Iqtibos */
.quote-widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  min-height: 90px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.quote-widget::before {
  content: '\201C';
  position: absolute; top: -12px; left: 10px;
  font-family: var(--font-heading);
  font-size: 80px; color: rgba(61,99,232,.06);
  line-height: 1; pointer-events: none; user-select: none;
}
.quote-text {
  font-size: var(--text-sm); font-style: italic;
  color: var(--color-text); margin: 0 0 6px 0; line-height: 1.65;
  transition: opacity 0.6s ease;
}
.quote-author {
  font-size: var(--text-xs); font-style: normal;
  font-weight: 700; color: var(--color-accent); display: block;
}
.quote-author-desc {
  font-size: var(--text-xs); color: var(--color-muted); display: block; margin-top: 2px;
}

/* Stat karta */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--tr), box-shadow var(--tr), transform var(--tr);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--peri));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card:hover {
  border-color: rgba(61,99,232,.2);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

/* Stat karta icon wrapper */
.stat-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-wrap.si-blue   { background: rgba(61,99,232,.1); }
.stat-icon-wrap.si-green  { background: rgba(22,163,74,.1); }
.stat-icon-wrap.si-orange { background: rgba(232,144,56,.12); }
.stat-icon-wrap.si-purple { background: rgba(124,58,237,.1); }
.si-blue .stat-bi-icon    { color: var(--color-accent); }
.si-green .stat-bi-icon   { color: var(--color-teal); }
.si-orange .stat-bi-icon  { color: var(--amber); }
.si-purple .stat-bi-icon  { color: #7C3AED; }
.stat-bi-icon { font-size: 1.25rem; }

/* Eski .stat-icon — emoji uchun (fallback) */
.stat-icon { font-size: 1.5rem; }
.stat-label {
  font-size: var(--text-xs); color: var(--color-muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.stat-value {
  font-family: var(--font-heading); font-size: var(--text-3xl);
  font-weight: 800; line-height: 1; color: var(--color-text);
}
.stat-sub { font-size: var(--text-xs); color: var(--color-muted); }

/* Section header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.section-title {
  font-family: var(--font-heading); font-size: var(--text-lg);
  font-weight: 700; margin: 0;
}

/* Divider */
hr.divider-mv {
  border: none; border-top: 1px solid var(--color-border); margin: var(--sp-3) 0;
}

/* Toast */
.toast-container-mv {
  position: fixed; bottom: var(--sp-3); right: var(--sp-3);
  z-index: 3000; display: flex; flex-direction: column;
  gap: 8px; pointer-events: none;
}
.toast-mv {
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--sp-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  color: var(--color-text); font-size: var(--text-sm);
  max-width: 340px; pointer-events: all;
  animation: slide-up var(--tr-slow) forwards;
}
.toast-mv.toast-success { border-left: 3px solid var(--color-success); }
.toast-mv.toast-error   { border-left: 3px solid var(--color-error); }
.toast-mv.toast-info    { border-left: 3px solid var(--color-accent); }
.toast-mv.toast-gold    { border-left: 3px solid var(--amber); }

/* Skip link */
.skip-link {
  position: absolute; top: -100%; left: var(--sp-2);
  background: var(--color-accent); color: #fff;
  padding: 8px var(--sp-2);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 10000; font-size: var(--text-sm);
  transition: top var(--tr-fast);
}
.skip-link:focus { top: 0; color: #fff; text-decoration: none; }

/* 8. ARI MASKOT (2D CSS animatsiyali)
   ================================================================ */
.mv-bee {
  display: block;
  animation: bee-float 3.2s ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(232,144,56,.28));
  flex-shrink: 0;
}
.bee-wing-l {
  transform-origin: 40px 38px;
  animation: wing-l 0.2s ease-in-out infinite alternate;
}
.bee-wing-r {
  transform-origin: 40px 38px;
  animation: wing-r 0.2s ease-in-out infinite alternate;
}

@keyframes bee-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-10px) rotate(2deg); }
}
@keyframes wing-l {
  from { transform: scaleY(1) rotate(-4deg); }
  to   { transform: scaleY(0.55) rotate(6deg); }
}
@keyframes wing-r {
  from { transform: scaleY(1) rotate(4deg); }
  to   { transform: scaleY(0.55) rotate(-6deg); }
}

/* Welcome + bee qatori */
.welcome-bee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  background: linear-gradient(135deg, #fff 60%, var(--color-surface-2) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.welcome-bee-row::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--rb), var(--peri));
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}
.welcome-text { flex: 1; min-width: 0; }
.welcome-text h1 {
  font-size: var(--text-2xl); margin-bottom: 4px;
  background: linear-gradient(135deg, var(--color-text), var(--color-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-text p { color: var(--color-muted); font-size: var(--text-sm); margin: 0; }

/* 9. ANIMATSIYALAR
   ================================================================ */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scale-up {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61,99,232,.3); }
  50%       { box-shadow: 0 0 0 8px rgba(61,99,232,0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(1.4); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes ping-amber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,144,56,.4); }
  70%       { box-shadow: 0 0 0 8px rgba(232,144,56,0); }
}

.animate-fade-in  { animation: fade-in  var(--tr-slow) ease both; }
.animate-scale-up { animation: scale-up var(--tr-slow) ease both; }
.animate-slide-up { animation: slide-up var(--tr-slow) ease both; }
.animate-float    { animation: float 4s ease-in-out infinite; }
.animate-pulse    { animation: pulse-glow 2s infinite; }
.animate-spin     { animation: spin 1s linear infinite; }

.stagger-children > * { animation: slide-up var(--tr-slow) ease both; }
.stagger-children > *:nth-child(1) { animation-delay:   0ms; }
.stagger-children > *:nth-child(2) { animation-delay:  80ms; }
.stagger-children > *:nth-child(3) { animation-delay: 160ms; }
.stagger-children > *:nth-child(4) { animation-delay: 240ms; }
.stagger-children > *:nth-child(5) { animation-delay: 320ms; }
.stagger-children > *:nth-child(6) { animation-delay: 400ms; }

/* 10. YORDAMCHI KLASSLAR
   ================================================================ */
.text-accent  { color: var(--color-accent)  !important; }
.text-teal    { color: var(--color-teal)    !important; }
.text-gold    { color: var(--amber)         !important; }
.text-muted-c { color: var(--color-muted)   !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-error   { color: var(--color-error)   !important; }
.text-heading { font-family: var(--font-heading) !important; }

.bg-surface   { background: var(--color-surface)   !important; }
.bg-surface-2 { background: var(--color-surface-2) !important; }
.border-mv    { border: 1px solid var(--color-border) !important; }

/* 11. RESPONSIV
   ================================================================ */

/* ── ≤1200px: Sidebar torroq ── */
@media (max-width: 1200px) {
  .content-grid { grid-template-columns: 1fr 230px; }
}

/* ── ≤1024px (barcha planshet + telefon): Hamburger + Sidebar birinchi ──
   820×1180 (iPad Air), 768×1024 (iPad), 390×844 (iPhone) — barchasi shu blokda */
@media (max-width: 1024px) {
  /* Layout: 1 ustun, sidebar birinchi */
  .content-grid { grid-template-columns: 1fr; }
  .sidebar {
    order: -1;
    position: static;
    max-height: none;
    overflow-y: visible;
    gap: var(--sp-2);
  }
  .nav-prayer { display: none; }

  /* Desktop nav elementlari → yashirish */
  .navbar-inner > nav    { display: none !important; }
  .lang-switcher         { display: none !important; }
  #growth-nav-ring       { display: none !important; }

  /* Hamburger ko'rsatish */
  .nav-toggle { display: flex; margin-left: var(--sp-1); }

  /* Profile: faqat avatar (matn + chevron yashiriladi) */
  .btn-profile-text     { display: none !important; }
  .btn-profile .chevron { display: none !important; }
  .btn-profile          { padding: 4px; }

  /* Stat qiymatlari */
  .stat-value { font-size: var(--text-2xl); }

  /* Welcome card */
  .welcome-mini-card  { white-space: normal; }
  .welcome-mini-title { white-space: normal; font-size: var(--text-sm); }
  .welcome-mini-sub   { white-space: normal; }
}

/* ── ≤768px (telefon / kichik planshet) ── */
@media (max-width: 768px) {
  .app-shell {
    padding: var(--sp-2);
    padding-top: calc(var(--navbar-h) + var(--sp-2));
  }
  .timer-ring-time { font-size: var(--text-3xl); }

  /* Toast: ekran pastida to'liq kenglik */
  .toast-container-mv { right: var(--sp-2); left: var(--sp-2); bottom: var(--sp-2); }
  .toast-mv           { max-width: none; width: 100%; }
}

/* ── ≤520px: Logo matn yashirish ── */
@media (max-width: 520px) {
  .nav-logo .logo-text { display: none; }
}

/* ── ≤480px (kichik telefon) ── */
@media (max-width: 480px) {
  :root { --navbar-h: 56px; }

  .modal-mv {
    padding: var(--sp-2);
    border-radius: var(--radius-lg);
    max-height: calc(100dvh - 32px);
  }
  .card-mv { padding: var(--sp-2); }
  .mv-bee  { width: 60px; height: 75px; }

  /* Faoliyat + chalg'ishlar → 1 ustun */
  #activity-dist-grid { grid-template-columns: 1fr !important; }

  /* Kun / Yil progress → 1 ustun */
  #day-year-grid { grid-template-columns: 1fr !important; }

  /* Timer rejim tugmalari */
  .btn-mv[data-mode] { font-size: 0.7rem; padding: 5px 8px; }

  /* Stat / timer */
  .stat-value      { font-size: var(--text-xl); }
  .timer-ring-time { font-size: var(--text-2xl); }

  /* Card header wrap */
  .card-mv-header { flex-wrap: wrap; gap: 6px; }
}

/* ── ≤360px (juda kichik telefon) ── */
@media (max-width: 360px) {
  .app-shell {
    padding: var(--sp-1);
    padding-top: calc(var(--navbar-h) + var(--sp-1));
  }
  .timer-ring-time { font-size: var(--text-xl); }
  .stat-value      { font-size: var(--text-lg); }
  .card-mv         { padding: var(--sp-1) var(--sp-2); }
}

/* 12. ACCESSIBILITY (WCAG 2.1 AA)
   ================================================================ */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .timer-ring-fill { transition: none !important; }
}

@media (forced-colors: active) {
  .btn-mv, .input-mv, .card-mv { forced-color-adjust: none; }
}

/* 13. SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--peri);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: rgba(61,99,232,.4); }

/* 14. BOOTSTRAP OVERRIDES (light mode)
   ================================================================ */
.form-control, .form-select {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}
.form-control:focus, .form-select:focus {
  background-color: var(--color-surface);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(61,99,232,.15);
  color: var(--color-text);
}
.form-control::placeholder { color: var(--color-muted); }
.modal-content { background-color: var(--color-surface); border-color: var(--color-border); }
.modal-header, .modal-footer { border-color: var(--color-border); }
.table { color: var(--color-text); }
.table-bordered > :not(caption) > * > * { border-color: var(--color-border); }
.alert { border-radius: var(--radius); }
.list-unstyled { list-style: none; padding: 0; margin: 0; }

/* 15. BACKGROUND MODES
   ================================================================ */
html, body { background-color: var(--color-bg); min-height: 100vh; }
.app-body  { background-color: transparent; }

#mv-bg-overlay { position: fixed; inset: 0; pointer-events: none; z-index: -1; }

/* Fon overlay rejimlari — dark ambient modes (Settings) */
body.bg-forest      { --color-bg: #05100c; --color-surface:#0a1e15; --color-surface-2:#0f2d20; --color-text:#d8ede2; --color-muted:#7aad92; --color-border:rgba(120,200,140,.12); }
body.bg-rain        { --color-bg: #050811; --color-surface:#0d1626; --color-surface-2:#121f35; --color-text:#c8d8ef; --color-muted:#6b88b8; --color-border:rgba(80,120,200,.12); }
body.bg-ocean       { --color-bg: #030d12; --color-surface:#071825; --color-surface-2:#0d2438; --color-text:#b8dde8; --color-muted:#5a9ab0; --color-border:rgba(60,140,180,.12); }
body.bg-space       { --color-bg: #030308; --color-surface:#0a0a1a; --color-surface-2:#10101f; --color-text:#d0d0f0; --color-muted:#7070a0; --color-border:rgba(80,80,160,.12); }
body.bg-aurora      { --color-bg: #040a08; --color-surface:#0a1810; --color-surface-2:#101f15; --color-text:#c8e8d0; --color-muted:#60a878; --color-border:rgba(60,180,100,.12); }
body.bg-mountains   { --color-bg: #07070f; --color-surface:#111128; --color-surface-2:#181832; --color-text:#d0d0e8; --color-muted:#7070a0; --color-border:rgba(80,80,160,.12); }
body.bg-night-city  { --color-bg: #080608; --color-surface:#181018; --color-surface-2:#221520; --color-text:#e8d0e0; --color-muted:#a070a0; --color-border:rgba(180,80,180,.12); }

/* Dark background modlarda aksent yangilanadi */
body.bg-forest, body.bg-rain, body.bg-ocean,
body.bg-space, body.bg-aurora, body.bg-mountains, body.bg-night-city {
  --color-accent: #6B9BFF;
  --color-accent-d: #4F8EF7;
}

/* 16. FON REJIMI TANLASH TUGMALARI (Settings)
   ================================================================ */
.bg-mode-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 10px 8px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-muted);
  cursor: pointer;
  transition: border-color var(--tr-fast), transform var(--tr-fast), box-shadow var(--tr-fast);
  font-size: var(--text-xs);
  font-family: var(--font-body);
  box-shadow: var(--shadow-sm);
}
.bg-mode-btn:hover {
  border-color: rgba(61,99,232,.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.bg-mode-btn.is-active {
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--shadow-glow);
}
.bg-mode-preview {
  width: 100%; height: 52px;
  border-radius: var(--radius-sm);
  min-width: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}

/* 17. SAHIFA USLUBLARI
   ================================================================ */

/* Task select tugmalari */
.task-select-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  color: var(--color-text); cursor: pointer;
  padding: 8px var(--sp-1); border-radius: var(--radius-sm);
  text-align: left; font-size: var(--text-sm);
  transition: background var(--tr-fast);
}
.task-select-btn:hover { background: var(--color-surface-2); }
.task-select-btn.is-selected {
  background: rgba(61,99,232,.08);
  color: var(--color-accent);
}
.task-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Chalg'ish kategoriya tugmalari */
#chalg-form .btn-mv.btn-ghost {
  border-color: var(--color-border);
  color: var(--color-text);
}
#chalg-form .btn-mv.btn-ghost:hover {
  background: var(--color-surface-2);
  border-color: rgba(61,99,232,.25);
  color: var(--color-accent);
}

/* Pomodoro taymer mode tugmalari */
.btn-mv[data-mode="focus"] { font-size: var(--text-xs); }

/* Maqsad kartalar: 1 ustun ≤480px (auto-fill minmax(280px) already handles most cases) */
@media (max-width: 480px) {
  #goals-container .stagger-children { grid-template-columns: 1fr !important; }
}

@media (max-width: 640px) {
  #summary-cards { grid-template-columns: 1fr 1fr !important; }
}

/* Online dot animatsiya */
@keyframes pulse-online {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,.4); }
  70%       { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
}

/* ── Vazifa kartasi hover / tanlash / tugash efektlari ── */
.task-card {
  border-radius: var(--radius-sm);
  margin: 0 -6px;
  padding-left: 6px !important;
  padding-right: 6px !important;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  user-select: none;
}
.task-card[data-select-id]:hover {
  transform: translateY(-2px);
  background: var(--color-surface-2);
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.task-card[data-select-id]:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}
.task-card.is-selected {
  background: color-mix(in srgb, var(--color-accent) 13%, transparent) !important;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--color-accent) 22%, transparent);
  transform: translateY(-1px);
  border-radius: var(--radius-sm);
}
.task-card.is-done {
  background: color-mix(in srgb, var(--color-success) 12%, transparent) !important;
  cursor: default !important;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════════
   RANK BADGE CARDS — shared (Achievement + FriendProfile pages)
═══════════════════════════════════════════════════════════════ */
.rank-badge-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: var(--sp-3);
}
@media (max-width: 700px) { .rank-badge-row { grid-template-columns: 1fr; } }
@media (max-width: 700px) and (min-width: 481px) { .rank-badge-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1100px) and (min-width: 701px) { .rank-badge-row { grid-template-columns: repeat(3,1fr); } }

.rank-card {
    position: relative; border-radius: 20px; overflow: hidden;
    padding: 20px 18px 18px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    border: 2px solid transparent;
    background: var(--color-surface);
    transition: transform .25s, box-shadow .25s;
    min-height: 220px;
}
.rank-card:hover { transform: translateY(-6px) scale(1.02); }

.rank-card.rank-locked {
    filter: grayscale(1) brightness(.65);
    cursor: default;
}
.rank-card.rank-locked:hover { transform: none; }

.rank-card.rank-gold {
    background: linear-gradient(145deg,#1c1a0e 0%,#251f0a 50%,#1c1a0e 100%);
    border-color: #c09010;
    box-shadow: 0 0 0 1px #c09010, 0 8px 32px rgba(192,144,16,.35);
    animation: gold-pulse 4s ease-in-out infinite;
}
.rank-card.rank-gold:not(.rank-locked):hover {
    box-shadow: 0 0 0 1px #f0b820, 0 14px 48px rgba(240,184,32,.55);
}
@keyframes gold-pulse {
    0%,100% { box-shadow: 0 0 0 1px #c09010, 0 8px 32px rgba(192,144,16,.35); }
    50%      { box-shadow: 0 0 0 1px #f0b820, 0 12px 44px rgba(240,184,32,.55); }
}
.rank-card.rank-gold::before {
    content:'';
    position:absolute; inset:0; border-radius:18px;
    background: linear-gradient(105deg,
        transparent 20%, rgba(255,215,0,.07) 30%, rgba(255,165,0,.12) 40%,
        rgba(255,215,0,.07) 50%, transparent 60%);
    background-size:200% 100%;
    animation: gold-shimmer 3s linear infinite;
    pointer-events:none;
}
@keyframes gold-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.rank-card.rank-silver {
    background: linear-gradient(145deg,#111418 0%,#181d22 50%,#111418 100%);
    border-color: #7090a8;
    box-shadow: 0 0 0 1px #7090a8, 0 6px 24px rgba(112,144,168,.3);
    animation: silver-pulse 4s ease-in-out infinite;
}
.rank-card.rank-silver:not(.rank-locked):hover {
    box-shadow: 0 0 0 1px #90b8d0, 0 12px 40px rgba(144,184,208,.45);
}
@keyframes silver-pulse {
    0%,100% { box-shadow: 0 0 0 1px #7090a8, 0 6px 24px rgba(112,144,168,.28); }
    50%      { box-shadow: 0 0 0 1px #90b8d0, 0 10px 36px rgba(144,184,208,.42); }
}
.rank-card.rank-silver::before {
    content:'';
    position:absolute; inset:0; border-radius:18px;
    background: linear-gradient(105deg,
        transparent 20%, rgba(192,216,232,.06) 30%, rgba(144,184,208,.11) 40%,
        rgba(192,216,232,.06) 50%, transparent 60%);
    background-size:200% 100%;
    animation: silver-shimmer 3.5s linear infinite;
    pointer-events:none;
}
@keyframes silver-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.rank-card.rank-bronze {
    background: linear-gradient(145deg,#150e06 0%,#1e1308 50%,#150e06 100%);
    border-color: #a05828;
    box-shadow: 0 0 0 1px #a05828, 0 6px 24px rgba(160,88,40,.3);
    animation: bronze-pulse 4s ease-in-out infinite;
}
.rank-card.rank-bronze:not(.rank-locked):hover {
    box-shadow: 0 0 0 1px #c87840, 0 12px 40px rgba(200,120,64,.45);
}
@keyframes bronze-pulse {
    0%,100% { box-shadow: 0 0 0 1px #a05828, 0 6px 24px rgba(160,88,40,.28); }
    50%      { box-shadow: 0 0 0 1px #c87840, 0 10px 36px rgba(200,120,64,.42); }
}
.rank-card.rank-bronze::before {
    content:'';
    position:absolute; inset:0; border-radius:18px;
    background: linear-gradient(105deg,
        transparent 20%, rgba(205,144,64,.07) 30%, rgba(200,120,64,.12) 40%,
        rgba(205,144,64,.07) 50%, transparent 60%);
    background-size:200% 100%;
    animation: bronze-shimmer 4s linear infinite;
    pointer-events:none;
}
@keyframes bronze-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.rank-icon-hex {
    position: relative; width: 72px; height: 72px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
}
.rank-gold   .rank-icon-hex { background: linear-gradient(135deg,#ffd700,#f0a000,#ffec6e); }
.rank-silver .rank-icon-hex { background: linear-gradient(135deg,#c0d8e8,#8099a8,#d8eaf8); }
.rank-bronze .rank-icon-hex { background: linear-gradient(135deg,#cd9040,#8b5820,#e0b060); }
.rank-locked .rank-icon-hex { background: linear-gradient(135deg,#3a3a3a,#222,#444); }
.rank-icon-hex i {
    font-size: 1.8rem; color: rgba(0,0,0,.75); position:relative; z-index:1;
}
.rank-card:not(.rank-locked) .rank-icon-hex i {
    animation: rank-icon-bob 3s ease-in-out infinite;
}
@keyframes rank-icon-bob {
    0%,100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-4px) rotate(4deg); }
}

.rank-position {
    font-size: 2.8rem; font-weight: 900; line-height: 1;
    letter-spacing: -.04em; margin: -4px 0 0;
}
.rank-gold   .rank-position { color: #ffd700; text-shadow: 0 0 20px rgba(255,215,0,.6); }
.rank-silver .rank-position { color: #b0cce0; text-shadow: 0 0 16px rgba(176,204,224,.5); }
.rank-bronze .rank-position { color: #c08040; text-shadow: 0 0 16px rgba(192,128,64,.5); }
.rank-locked .rank-position { color: #444; }

.rank-title {
    font-size: var(--text-sm); font-weight: 800; color: #fff; margin: 0;
    text-align: center; letter-spacing: .02em;
}
.rank-locked .rank-title { color: #555; }
.rank-desc {
    font-size: .65rem; color: rgba(255,255,255,.45); text-align:center; margin:0; line-height:1.4;
}
.rank-locked .rank-desc { color: #444; }

.rank-count-wrap {
    display: flex; align-items: baseline; gap: 3px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px; padding: 6px 14px;
}
.rank-count-x { font-size:.85rem; font-weight:700; }
.rank-count-n { font-size: 2rem; font-weight: 900; line-height:1; letter-spacing:-.03em; }
.rank-count-label { font-size:.6rem; color:rgba(255,255,255,.4); text-transform:uppercase; letter-spacing:.06em; }
.rank-gold   .rank-count-x, .rank-gold   .rank-count-n { color:#ffd700; }
.rank-silver .rank-count-x, .rank-silver .rank-count-n { color:#b0cce0; }
.rank-bronze .rank-count-x, .rank-bronze .rank-count-n { color:#c08040; }
.rank-locked .rank-count-x, .rank-locked .rank-count-n { color:#444; }

.rank-dates {
    display:flex; flex-direction:column; gap:3px; align-items:center;
    font-size:.6rem; color:rgba(255,255,255,.35);
}
.rank-dates span { display:flex; align-items:center; gap:4px; }
.rank-dates i { font-size:.65rem; }

.rank-lock-overlay {
    position:absolute; inset:0; border-radius:18px;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
    background: rgba(0,0,0,.3); backdrop-filter: blur(1px);
    pointer-events:none;
}
.rank-lock-overlay i { font-size:1.4rem; color:rgba(255,255,255,.2); }
.rank-lock-overlay span { font-size:.65rem; color:rgba(255,255,255,.2); letter-spacing:.04em; }

/* ── 17. KUN / TUN REJIMI (Faza 122)
   ================================================================ */

/* Toggle button — barcha sahifalarda ishlatiladi */
.theme-toggle {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    transition: background var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast);
    line-height: 1;
    padding: 0;
}
.theme-toggle:hover {
    background: var(--color-surface-2);
    color: var(--color-accent);
    border-color: var(--color-accent);
}
html.dark .theme-toggle          { color: #f59e0b; border-color: rgba(245,158,11,.35); }
html.dark .theme-toggle:hover    { background: rgba(245,158,11,.1); border-color: #f59e0b; }

/* Dark mode CSS variables — dashboard / login / register sahifalari uchun
   (Har bir sahifada background.js inline style orqali ham qo'llanadi,
    bu esa FOUC oldini olish uchun CSS fallback sifatida ishlaydi) */
html.dark {
    --color-bg:        #0D1117;
    --color-surface:   #161B22;
    --color-surface-2: #1C2128;
    --color-text:      #E6EDF3;
    --color-muted:     #848D97;
    --color-border:    rgba(240,246,252,.12);
    --color-hover:     rgba(255,255,255,.05);
    --shadow-sm:   0 1px 3px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.4);
    --shadow:      0 4px 16px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.35);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.65), 0 4px 12px rgba(0,0,0,.45);
    --shadow-glow: 0 0 0 3px rgba(232,144,56,.25), 0 4px 20px rgba(232,144,56,.20);
}
html.dark body.app-body { background-color: #0D1117; }

/* Navbar */
html.dark .app-navbar {
    background: rgba(13,17,23,.94);
    border-bottom-color: rgba(240,246,252,.10);
    box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.25);
}

/* Focus timer card — barcha holatlari */
html.dark .timer-card,
html.dark .timer-card.mode-focus,
html.dark .timer-card.mode-short,
html.dark .timer-card.mode-long {
    background: var(--color-surface);
}

/* Welcome / salomlashuv row */
html.dark .welcome-bee-row {
    background: var(--color-surface);
}

/* Sidebar cardlari (inline style o'rniga CSS class) */
.community-card { background: linear-gradient(135deg,#fff 60%,rgba(22,163,74,.05) 100%); }
.growth-card    { background: linear-gradient(135deg,#fff 60%,rgba(245,158,11,.05) 100%); }
html.dark .community-card { background: linear-gradient(135deg,#161B22 60%,rgba(22,163,74,.10) 100%); }
html.dark .growth-card    { background: linear-gradient(135deg,#161B22 60%,rgba(245,158,11,.10) 100%); }
