/* Umumiy qobiq: tokenlar, shrift, yon panel, topbar. SQLAdmin sahifalarida ham ishlatiladi (admin.css'siz). */
/* Masjid Time boshqaruv paneli — dizayn tizimi. Brend: lapis #24368C, firuza #2FA6B8, oltin #E2B653, krem #F6F1E7. */

@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/Manrope-800.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/Literata-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/Literata-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  /* Yuzalar */
  --bg: #F6F1E7;
  --surface: #FFFDF9;
  --surface-2: #FAF6EC;
  --surface-3: #F1EBDC;
  --line: #E4DCC9;
  --line-strong: #CFC4A8;
  /* Matn */
  --ink: #1B2140;
  --ink-2: #484E6E;
  --ink-3: #5F6586;
  /* Brend */
  --brand: #24368C;
  --brand-hover: #1B2A73;
  --brand-ink: #FFFFFF;
  --brand-soft: #E6E9F6;
  --teal: #2FA6B8;
  --teal-ink: #11707E;
  --teal-soft: #DCF0F3;
  --gold: #E2B653;
  --gold-ink: #7A5500;
  --gold-soft: #FBF0D3;
  /* Holat */
  --ok: #1B7A57;
  --ok-soft: #DAF0E5;
  --bad: #B3342A;
  --bad-soft: #FBE3DF;
  --bad-hover: #96271F;
  /* Yon panel */
  --side-bg: #24368C;
  --side-ink: #F6F1E7;
  --side-ink-2: #C3CAEC;
  --side-active: rgba(255, 255, 255, .13);
  --focus: #24368C;
  /* Grafik */
  --c-auto: #0C8FA2;
  --c-manual: #3A4FB0;
  --c-rejected: #C2453A;
  --c-pending: #C08A1E;
  /* O'lchamlar */
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(27, 33, 64, .06), 0 6px 18px rgba(27, 33, 64, .05);
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

/* Qorong'i mavzu: bir xil tokenlar, boshqa qiymatlar */
:root[data-theme="dark"] {
  --bg: #0E1330;
  --surface: #161C3E;
  --surface-2: #1B2248;
  --surface-3: #232B58;
  --line: #2A3262;
  --line-strong: #3A4480;
  --ink: #EFEBDF;
  --ink-2: #BDC1DA;
  --ink-3: #959AC0;
  --brand: #8497F2;
  --brand-hover: #9AAAF6;
  --brand-ink: #0E1330;
  --brand-soft: #232C63;
  --teal: #4CBFD0;
  --teal-ink: #62CCDB;
  --teal-soft: #14343F;
  --gold: #E2B653;
  --gold-ink: #EBC873;
  --gold-soft: #3A3017;
  --ok: #5FD0A0;
  --ok-soft: #15352B;
  --bad: #FF8F82;
  --bad-soft: #43201F;
  --bad-hover: #FFA79C;
  --side-bg: #0A0F27;
  --side-ink: #EFEBDF;
  --side-ink-2: #9EA4CC;
  --side-active: rgba(255, 255, 255, .09);
  --focus: #8497F2;
  --c-auto: #3FB6C8;
  --c-manual: #7F93F0;
  --c-rejected: #F0766A;
  --c-pending: #D9A93F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 22px rgba(0, 0, 0, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1330; --surface: #161C3E; --surface-2: #1B2248; --surface-3: #232B58;
    --line: #2A3262; --line-strong: #3A4480;
    --ink: #EFEBDF; --ink-2: #BDC1DA; --ink-3: #959AC0;
    --brand: #8497F2; --brand-hover: #9AAAF6; --brand-ink: #0E1330; --brand-soft: #232C63;
    --teal: #4CBFD0; --teal-ink: #62CCDB; --teal-soft: #14343F;
    --gold: #E2B653; --gold-ink: #EBC873; --gold-soft: #3A3017;
    --ok: #5FD0A0; --ok-soft: #15352B; --bad: #FF8F82; --bad-soft: #43201F; --bad-hover: #FFA79C;
    --side-bg: #0A0F27; --side-ink: #EFEBDF; --side-ink-2: #9EA4CC; --side-active: rgba(255, 255, 255, .09);
    --focus: #8497F2;
    --c-auto: #3FB6C8; --c-manual: #7F93F0; --c-rejected: #F0766A; --c-pending: #D9A93F;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 22px rgba(0, 0, 0, .25);
  }
}

/* ---------- Asos ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 .9375rem/1.55 var(--font); font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sidebar :focus-visible { outline-color: var(--gold); }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .8125rem; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.hide-sm { display: inline; }
.when-dark { display: none; }
:root[data-theme="dark"] .when-light { display: none; }
:root[data-theme="dark"] .when-dark { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-light { display: none; }
  :root:not([data-theme="light"]) .when-dark { display: inline-flex; }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; text-decoration: none; }
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 6px; text-align: center; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  font: 600 .75rem/1.5 var(--font); color: var(--ink-2);
}

/* ---------- Joylashuv ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 8px;
  background: var(--side-bg); color: var(--side-ink); padding: 16px 12px; overflow-y: auto;
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(47, 166, 184, .22), transparent 60%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 16px; color: var(--side-ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-mark-lg { width: 64px; height: 64px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font: 600 1.125rem/1.2 var(--serif); letter-spacing: .01em; }
.brand-text small { color: var(--side-ink-2); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--side-ink-2); font-weight: 600; transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-item .i { width: 20px; height: 20px; }
.nav-item:hover { background: rgba(255, 255, 255, .08); color: var(--side-ink); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--side-active); color: #fff; }
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold);
}
.nav-item .badge { margin-left: auto; }
.badge {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--gold); color: #3A2A00;
  font: 800 .75rem/22px var(--font); text-align: center;
}
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
.nav-item-sub { font-weight: 500; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-brand { display: none; font: 600 1.125rem var(--serif); color: var(--ink); }
.topbar-search { position: relative; flex: 1; max-width: 420px; }
.topbar-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.topbar-search input[type="search"] {
  width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); outline-offset: 2px;
}
.topbar-search input::placeholder { color: var(--ink-3); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.logout-form { margin: 0 0 0 4px; }
.icon-btn.menu-btn { display: none; }
.content { padding: 28px 32px 56px; max-width: 1360px; width: 100%; margin: 0 auto; outline: none; }
.scrim { display: none; }

@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%);
    transition: transform .22s var(--ease); box-shadow: none;
  }
  body.drawer-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 15, 39, .5); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
  body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .icon-btn.menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px 0 8px; }
  .topbar-brand { display: block; }
  .topbar-search { display: none; }
  .content { padding: 20px 16px 48px; }
}
@media (max-width: 560px) { .hide-sm { display: none; } }


.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .15s var(--ease), color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn-sm { width: 36px; height: 36px; }
.icon-btn .i { width: 20px; height: 20px; }

