/* Boshqaruv paneli — Apple/Google uslubi: och kulrang fon, oq kartalar, bitta ko‘k urg‘u, rangli belgi faqat kichik detallarda */
:root {
  --navy: #1D1D1F; --on-navy: #FFFFFF; --green: #248A3D; --orange: #C93400;
  --accent: #0071E3; --accent-ink: #0066CC; --accent-soft: #E8F1FD;
  --bg: #F5F5F7; --surface: #FFFFFF; --surface-2: #F5F5F7; --ink: #1D1D1F; --muted: #6E6E73;
  --line: #D2D2D7; --line-2: #E8E8ED; --focus: #0071E3;
  --p0: #1A73E8; --p1: #D93025; --p2: #E37400; --p3: #1E8E3E; --p-ink: #1D1D1F;
  --t-green-bg: #E6F4EA; --t-green: #137333; --t-orange-bg: #FEF3E0; --t-orange: #B05A00;
  --t-blue-bg: #E8F0FE; --t-blue: #1967D2; --t-grey-bg: #F1F3F4; --t-grey: #5F6368;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  --shadow-h: 0 2px 4px rgba(0,0,0,.05), 0 14px 34px rgba(0,0,0,.10);
  --r: 20px; --r-s: 14px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif; --serif: var(--sans);
  --girih: none;
  color-scheme: light;
}
/* Qorong‘i rejim faqat foydalanuvchi o‘zi tanlaganda (standart — har doim yorug‘) */
:root[data-theme="dark"] {
  --navy: #F5F5F7; --on-navy: #000000; --green: #30D158; --orange: #FF9F0A;
  --accent: #0A84FF; --accent-ink: #4DA3FF; --accent-soft: #0B2A4A;
  --bg: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E; --ink: #F5F5F7; --muted: #98989D;
  --line: #38383A; --line-2: #2C2C2E; --focus: #0A84FF;
  --p0: #8AB4F8; --p1: #F28B82; --p2: #FDD663; --p3: #81C995; --p-ink: #F5F5F7;
  --t-green-bg: #0F2E1A; --t-green: #81C995; --t-orange-bg: #3A2A05; --t-orange: #FDD663;
  --t-blue-bg: #10264A; --t-blue: #8AB4F8; --t-grey-bg: #2C2C2E; --t-grey: #BDC1C6;
  --shadow: 0 0 0 1px rgba(255,255,255,.06);
  --shadow-h: 0 0 0 1px rgba(255,255,255,.14), 0 14px 34px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
#sec-b { scroll-margin-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); padding-left: 104px; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -.022em; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: 16px; top: -60px; background: var(--navy); color: var(--on-navy); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Chap menyu (rail) */
.rail { position: fixed; inset: 0 auto 0 0; width: 104px; z-index: 25; background: var(--surface); border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column; align-items: center; padding: 28px 0 24px; gap: 24px; }
.logo { display: grid; place-items: center; width: 52px; height: 52px; }
.logo svg { width: 52px; height: 52px; color: var(--navy); stroke-width: 9; stroke-linecap: butt; }
.rail-nav { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.rail-b { width: 60px; height: 60px; border-radius: 50%; border: 0; background: none; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; }
.rail-b svg { width: 24px; height: 24px; }
.rail-b:hover { background: var(--surface-2); }
.rail-b.on { background: var(--accent-soft); color: var(--accent-ink); }

/* Sarlavha */
.top { max-width: 1440px; margin: 0 auto; padding: 36px 40px 8px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { flex: 1 1 360px; min-width: 0; }
.brand h1 { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.1; color: var(--ink); }
.wave { display: inline-block; transform-origin: 70% 70%; }
@media (prefers-reduced-motion: no-preference) { .wave { animation: wave 2.4s ease-in-out 1 .4s; } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } }
.sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.mode { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 99px; background: var(--t-orange-bg); color: var(--t-orange); font-weight: 500; font-size: 12px; }
.tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 22px; height: 22px; pointer-events: none; }
.search input { width: 380px; max-width: 100%; height: 60px; padding: 0 20px 0 54px; border: 0; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow); }
.search input::placeholder { color: var(--muted); }
.avatar { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 18px; flex: none; }
.ic { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; color: var(--ink); }
.ic:hover { border-color: var(--navy); }
.btn { height: 44px; padding: 0 20px; border-radius: 99px; border: 1px solid transparent; background: var(--navy); color: var(--on-navy); cursor: pointer; font-weight: 500; transition: transform .12s, background .12s; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.accent, .btn.green { background: var(--accent); color: #fff; }
.btn.accent:hover, .btn.green:hover { filter: brightness(1.08); }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.link { background: none; color: var(--accent-ink); border: 0; padding: 0 4px; height: auto; text-decoration: underline; }
.btn.danger { background: #A33A2A; color: #fff; }
.top #btn-auth { height: 60px; padding: 0 26px; border: 0; box-shadow: var(--shadow); }

/* Ikki ustun */
main { max-width: 1440px; margin: 0 auto; padding: 24px 40px 48px; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px 40px; align-items: start; }
.col-side { position: sticky; top: 24px; }
.block { margin-bottom: 36px; }
.block-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; min-height: 44px; }
.block-h h2 { font-size: clamp(24px, 2.2vw, 34px); }
.cnt { color: var(--muted); font-weight: 500; }

/* Urg‘u ranglari (Google’ning 4 rangi) — faqat belgi va nuqtalarda */
.t0 { --tile: var(--p0); } .t1 { --tile: var(--p1); } .t2 { --tile: var(--p2); } .t3 { --tile: var(--p3); }

/* Rangli doira ichidagi strelka */
.go { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: color-mix(in srgb, var(--tile, var(--accent)) 13%, var(--surface)); color: var(--tile, var(--accent)); flex: none; transition: transform .18s ease; }
.go svg { width: 22px; height: 22px; }

/* A kartalar (1-daraja: sarlavha) */
.grid-a { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-a > .card:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 150px; }
.folders { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.folders .card h3 { font-size: 20px; }
.card { position: relative; display: flex; align-items: flex-end; gap: 16px; min-height: 196px; width: 100%; padding: 26px 26px 26px 30px; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 0; border-radius: var(--r); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.card .ico { position: absolute; left: 26px; top: 24px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: color-mix(in srgb, var(--tile, var(--accent)) 13%, var(--surface)); color: var(--tile, var(--accent)); }
.card .ico svg { width: 24px; height: 24px; stroke-width: 1.8; }
.card:hover, .card:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-h); }
.card:hover .go, .card:focus-visible .go { transform: rotate(45deg); }
.card .go { margin-left: auto; }
.card h3 { flex: 1; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; max-width: 20ch; }
.card .chip { position: absolute; right: 22px; top: 22px; padding: 4px 12px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 500; }

/* KPI plitkalar */
.kpis { display: grid; grid-template-columns: repeat(var(--kn, 5), minmax(0, 1fr)); gap: 14px; }
.kpi.static { cursor: default; }
.kpi.static:hover { transform: none; box-shadow: var(--shadow); }
.kpi b { overflow-wrap: anywhere; }
/* Administrator: matnlarni tahrirlash rejimi */
body.tedit [data-t], body.tedit [data-f], body.tedit [data-rn], body.tedit .kpi { outline: 1.5px dashed var(--accent); outline-offset: 2px; border-radius: 4px; cursor: text; }
body.tedit .kpi { border-radius: var(--r); }
body.tedit [data-t]:hover, body.tedit [data-f]:hover, body.tedit [data-rn]:hover { background: var(--accent-soft); }
.kpi-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.kpi-row label, .fld label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); flex: 1 1 160px; }
.kpi-row input, .kpi-row select, .fld input, .fld select, .fld textarea { min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; }
.kpi-ctl { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.kpi-now { font-size: 14px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.fld { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.fld-h { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.fld-h > .who { padding-bottom: 10px; min-width: 140px; }
.fld-h > label:first-child { flex: 0 1 320px; }
.fld-h > .btn { margin-bottom: 2px; }
.fld > label[data-nopts] { color: var(--muted); font-size: 13px; }
.fld > label[data-nopts][hidden] { display: none !important; }
.fld-h > label.vis { flex: 0 0 auto; padding-bottom: 10px; }
.fld-sub { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; padding-left: 14px; border-left: 2px solid var(--line-2); }
.fld-sub .full { flex-basis: 100%; }
.fld-sub > .who { flex-basis: 100%; }
.kpi { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 168px; padding: 20px 20px; border: 0; border-radius: var(--r); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.kpi:hover, .kpi:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-h); }
.kpi span:first-child { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--muted); padding-left: 16px; position: relative; }
.kpi span:first-child::before { content: ''; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 50%; background: var(--tile); }
.kpi b { margin-top: auto; font-size: clamp(36px, 3.4vw, 52px); font-weight: 600; line-height: 1; letter-spacing: -.035em; }
.kpi .go { position: absolute; right: 14px; bottom: 14px; width: 46px; height: 46px; }
@media (max-width: 1400px) and (min-width: 1181px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* B kartalar: keng qatorlar */
.grid-b { display: grid; gap: 16px; }
.card.b { min-height: 0; align-items: center; padding: 22px 22px 22px 22px; }
.card.b .bi { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: color-mix(in srgb, var(--tile, var(--accent)) 13%, var(--surface)); color: var(--tile, var(--accent)); flex: none; }
.card.b .go { background: var(--surface-2); color: var(--muted); width: 48px; height: 48px; }
.card.b .bt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card.b small { color: var(--muted); font-size: 14px; }
.card.b h3 { max-width: none; font-size: clamp(19px, 1.7vw, 24px); }

/* Tadbirlar jadvali */
.mcal { background: var(--surface); border-radius: var(--r); padding: 26px 24px 22px; box-shadow: var(--shadow); }
.mcal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 0 6px; }
.mcal-h b { font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.mc-nav { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; color: var(--ink); }
.mc-nav:hover { background: var(--surface-2); }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 8px; text-align: center; }
.mc-wd { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; }
.mc { justify-self: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--ink); }
.mc:hover { background: var(--surface-2); }
.mc.out { color: var(--muted); opacity: .6; }
.mc.busy { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.mc.is-now { background: var(--accent); color: #fff; font-weight: 600; }
.soon { display: grid; gap: 14px; margin-top: 20px; }
.soon-i { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 20px 16px 16px; border: 0; border-radius: var(--r); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.soon-i:hover, .soon-i:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-h); }
.soon-i .bi { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--c, var(--accent)) 13%, var(--surface)); color: var(--c, var(--accent)); flex: none; }
.soon-i .st { min-width: 0; display: flex; flex-direction: column; }
.soon-i small { color: var(--muted); font-size: 13px; }
.soon-i b { font-weight: 500; font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 2-daraja: qisqa mazmun */
.pop { position: absolute; z-index: 30; width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 14px; animation: rise .14s ease; pointer-events: none; }
.pop p { margin: 0 0 4px; } .pop p:last-child { margin: 0; }
.pop .k { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

/* Teglar */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.g { background: var(--t-green-bg); color: var(--t-green); } .tag.o { background: var(--t-orange-bg); color: var(--t-orange); }
.tag.b { background: var(--t-blue-bg); color: var(--t-blue); } .tag.x { background: var(--t-grey-bg); color: var(--t-grey); }

/* 3-daraja: yon panel */
.scrim { position: fixed; inset: 0; background: rgba(8,18,32,.38); z-index: 40; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 100vw); z-index: 41; background: var(--surface); display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.18); animation: slide .2s ease; outline: none; }
@keyframes slide { from { transform: translateX(32px); opacity: .4; } }
.d-head { display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line-2); }
.d-head h2 { flex: 1; font-size: 21px; min-width: 0; }
.d-body { flex: 1; overflow: auto; padding: 20px 24px 40px; }
.d-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.d-tools input[type=search] { flex: 1 1 220px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.f { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); }
.f select { height: 40px; min-width: 150px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; font-size: 13.5px; }
.chip { padding: 3px 10px; border-radius: 99px; background: var(--t-blue-bg); color: var(--t-blue); }
.count { color: var(--muted); font-size: 13.5px; }
.count b { color: var(--ink); }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }

.rows { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line-2); }
.rows li { border-bottom: 1px solid var(--line-2); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; width: 100%; padding: 12px 8px; background: none; border: 0; text-align: left; cursor: pointer; border-radius: 8px; }
.row:hover { background: var(--surface-2); }
.row .t { font-weight: 500; }
.row .s { grid-column: 1; color: var(--muted); font-size: 13.5px; }
.row .r { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; color: var(--muted); }
.row.warn { box-shadow: inset 3px 0 0 var(--orange); }
.bar { height: 6px; width: 120px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); }

/* Tafsilot */
.dl { display: grid; grid-template-columns: 200px 1fr; gap: 10px 20px; margin: 0 0 24px; }
.dl dt { color: var(--muted); font-size: 13.5px; }
.dl dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sec-h { font: 600 16px var(--serif); margin: 26px 0 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
table.t .phone-in { width: 150px; min-width: 0; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.hist li { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.hist .who { color: var(--muted); }
.diff del { color: #A33A2A; } .diff ins { color: var(--green); text-decoration: none; }
:root[data-theme="dark"] .diff ins { color: #8FD3B2; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--t-orange-bg); color: var(--t-orange); margin-bottom: 16px; }
.notice .btn { margin: 8px 8px 0 0; }

/* Formalar */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.form input, .form select, .form textarea, .sub-row input, .sub-row select { min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 14px; }
.form textarea { min-height: 88px; resize: vertical; }
.form .err { color: #A33A2A; font-size: 12.5px; }
.tw { overflow-x: auto; max-width: 100%; }
/* Rasm maydoni */
.img-field { display: flex; flex-direction: column; gap: 6px; }
.img-l { font-size: 13px; color: var(--muted); }
.img-in { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.img-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.form .img-act label.btn { flex-direction: row; align-items: center; color: var(--ink); font-size: 13px; cursor: pointer; }
.img-act .who { font-size: 12.5px; }
.rec-img { display: inline-block; line-height: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface-2); max-width: 100%; }
.rec-img img { display: block; max-width: 100%; height: auto; }
.img-in .rec-img img { max-height: 160px; width: auto; }
.rec-fig { margin: 0 0 20px; }
.rec-fig .rec-img img { max-height: 420px; width: auto; margin: 0 auto; }
.rec-fig figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.t .rec-img img { max-height: 44px; width: auto; }
.sub-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.sub-row input { flex: 1; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.d-body .actions { position: sticky; bottom: -40px; z-index: 2; margin: 20px -24px -40px; padding: 12px 24px 16px; background: var(--surface); border-top: 1px solid var(--line-2); }

/* Diagramma */
.chart { width: 100%; height: auto; margin: 6px 0 18px; }
.chart rect { fill: var(--accent); cursor: pointer; }
.chart rect:hover, .chart rect:focus { fill: var(--navy); outline: none; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--sans); stroke: none; }
.chart .gl { stroke: var(--line-2); stroke-width: 1; }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; min-height: 200px; }
.col h4 { margin: 2px 4px 10px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.col.over { outline: 2px dashed var(--accent); }
.kcard { display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 14px; }
.kcard[draggable=true] { cursor: grab; }
.kcard small { display: block; color: var(--muted); margin-top: 2px; }

/* Haftalik post jadvali */
.week { display: grid; grid-template-columns: 110px repeat(7, 1fr); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; font-size: 12.5px; }
.week > div { padding: 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); min-height: 44px; }
.week .h { background: var(--surface-2); font-weight: 600; color: var(--muted); }
.week .emptyday { background: repeating-linear-gradient(45deg, transparent 0 6px, var(--line-2) 6px 7px); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* Modal, toast */
.modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(8,18,32,.42); display: grid; place-items: center; padding: 16px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); outline: none; animation: rise .15s; }
.modal h2 { font-size: 20px; margin-bottom: 14px; }
/* Uzun oynalarda “Saqlash” doim ko‘rinib tursin */
.modal > .actions:last-child { position: sticky; bottom: -24px; margin: 16px -24px -24px; padding: 14px 24px 18px; background: var(--surface); border-top: 1px solid var(--line-2); z-index: 1; }
/* Administrator boshqa rol sifatida ko‘rmoqda */
.viewas { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; padding: 8px 16px; background: var(--t-orange-bg); color: var(--t-orange); font-size: 14px; border-bottom: 1px solid var(--line-2); }
.viewas b { font-weight: 700; }
.viewas .btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.va-list { display: grid; gap: 10px; margin: 16px 0; }
.va-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; height: auto; padding: 12px 16px; border-radius: var(--r-s); }
.va-opt small { font-weight: 400; opacity: .8; font-size: 13px; }
.upd { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 16px); transform: translateX(-50%); z-index: 96; display: flex; align-items: center; gap: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-h); padding: 10px 12px 10px 18px; border-radius: 99px; font-size: 14px; max-width: calc(100vw - 32px); }
.upd .btn { background: var(--accent); color: #fff; border-color: transparent; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); }

/* Pastki qator */
.foot { border-top: 1px solid var(--line-2); }
.foot-in { max-width: 1440px; margin: 0 auto; padding: 20px 40px 28px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.foot .sep { flex: 1; }

/* Kirish ekrani */
.gate { position: fixed; inset: 0; z-index: 95; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.gate .box { width: min(440px, 100%); background: var(--surface); border-radius: var(--r); padding: 36px 32px; box-shadow: var(--shadow); }
.gate h2 { font-size: 28px; margin-bottom: 8px; }
.gate p { color: var(--muted); margin: 0 0 18px; }
.gate input { width: 100%; height: 54px; padding: 0 20px; border: 1px solid var(--line); border-radius: 99px; margin-bottom: 12px; background: var(--surface-2); }
.gate .btn { height: 54px; }
/* Parolni ko‘rsatish tugmasi */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 46px !important; }
.gate .pw-wrap { margin-bottom: 12px; }
.gate .pw-wrap > input { margin-bottom: 0; }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pw-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-eye:hover, .pw-eye.on { color: var(--accent); }
.pw-eye:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Moslashuvchanlik */
@media (max-width: 1180px) {
  main { grid-template-columns: 1fr; }
  .col-side { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
  .col-side .block-h { grid-column: 1 / -1; }
  .soon { margin-top: 0; align-content: start; }
}
@media (max-width: 760px) {
  body { padding-left: 0; padding-bottom: 84px; }
  .rail { inset: auto 0 0 0; width: auto; height: 76px; flex-direction: row; padding: 0 12px; gap: 0; border-right: 0; border-top: 1px solid var(--line-2); }
  .rail .logo { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; gap: 4px; }
  .rail-b, .rail-b.on { width: 52px; height: 52px; }
  .top, main, .foot-in { padding-inline: 16px; }
  .top { padding-top: 24px; }
  .tools { width: 100%; } .search { flex: 1 1 0; min-width: 0; } .search input { width: 100%; height: 52px; }
  .top #btn-auth { height: 52px; } .avatar { display: none; }
  .col-side { display: block; }
  .kpis { grid-template-columns: 1fr 1fr; } .kpi { min-height: 132px; } .kpi b { font-size: 40px; } .kpi .go { width: 44px; height: 44px; }
  .grid-a, .folders { grid-template-columns: 1fr; }
  .card { min-height: 140px; padding: 20px; } .go { width: 48px; height: 48px; }
  .card .ico { left: 20px; top: 20px; width: 44px; height: 44px; }
  .mc { width: 38px; height: 38px; }
  .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 10px; }
  .form { grid-template-columns: 1fr; }
  .d-head, .d-body { padding-inline: 16px; }
  .row { grid-template-columns: 1fr; } .row .r { grid-row: auto; grid-column: 1; flex-direction: row; align-items: center; }
  .foot .sep { display: none; } .foot .btn { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Chop etish: bir sahifalik xulosa */
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; }
  body > *:not(#print) { display: none !important; }
  .print-only { display: block; font-size: 11pt; }
  .print-only h1 { font-size: 18pt; color: #12315A; } .print-only h2 { font-size: 12.5pt; margin: 12px 0 4px; color: #12315A; }
  .print-only table { width: 100%; border-collapse: collapse; } .print-only td, .print-only th { border-bottom: 1px solid #ccc; padding: 3px 6px; text-align: left; font-size: 9.5pt; }
  @page { size: A4; margin: 14mm; }
}

/* ===== Kalendar (TT 4.2): tekis fon, naqshsiz, tizim sans-serif shrifti ===== */
.calendar { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #FFFFFF; color: #1D1D1F;
  font: 14px/1.45 var(--sans);
  --cl: #DADCE0; --cl2: #F1F3F4; --sel: #E8F0FE; --cm: #5F6368; --cs: #FFFFFF; --today: #1A73E8; }
:root[data-theme="dark"] .calendar { background: #000000; color: #F5F5F7; --cl: #38383A; --cl2: #1C1C1E; --sel: #10264A; --cm: #98989D; --cs: #1C1C1E; --today: #0A84FF; }
.calendar h2, .calendar h3 { font-family: inherit; }
.calendar .btn, .calendar .ic { font-family: inherit; }
.calendar .ic { background: transparent; border-color: var(--cl); color: inherit; }
.calendar .btn.ghost { background: transparent; color: inherit; border-color: var(--cl); }
.ic.sm { min-width: 32px; height: 32px; padding: 0; }
.cal-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--cl); flex-wrap: wrap; }
.cal-title { font-size: 21px; font-weight: 600; margin-right: 8px; }
.cal-burger { display: none; }
.cal-period { font-size: 20px; font-weight: 500; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-q { height: 40px; width: 220px; padding: 0 12px; border: 1px solid var(--cl); border-radius: 8px; background: transparent; color: inherit; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--cl); border-radius: 8px; overflow: hidden; }
.seg button { height: 40px; padding: 0 14px; border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--cl); }
.seg button.on { background: var(--sel); color: #1967D2; font-weight: 600; }
:root[data-theme="dark"] .seg button.on { color: #8AB4F8; }
.cal-main { flex: 1; display: grid; grid-template-columns: 264px 1fr; min-height: 0; }
.cal-side { border-right: 1px solid var(--cl); padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.cal-create { align-self: flex-start; border-radius: 22px; padding: 0 22px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.side-h { font-size: 13px; font-weight: 600; color: var(--cm); margin: 12px 0 2px; text-transform: none; }
.mini-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mini-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.mini-g span { color: var(--cm); font-size: 11px; padding: 2px 0; }
.mini-g button { aspect-ratio: 1; border: 0; background: none; border-radius: 50%; cursor: pointer; color: inherit; font-size: 12px; }
.mini-g button:hover { background: var(--cl2); }
.mini-g button.other { opacity: .45; }
.mini-g button.sel { background: var(--sel); }
.mini-g button.today { background: var(--today); color: #fff; font-weight: 700; }
.cats { display: flex; flex-direction: column; gap: 4px; }
.cats label, .chk { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.cats input { width: 18px; height: 18px; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.tzline { margin: 0; font-size: 13px; }
.calendar .f select { background: transparent; border-color: var(--cl); }
.cal-view { position: relative; overflow: auto; min-width: 0; display: flex; flex-direction: column; }

/* Hafta / Kun */
.tgrid { display: grid; grid-template-columns: 64px repeat(var(--n), minmax(0, 1fr)); }
.tgrid .th { text-align: center; padding: 8px 0 4px; font-size: 12px; color: var(--cm); border-bottom: 1px solid var(--cl); }
.tgrid .th.gut { display: flex; flex-direction: column; justify-content: flex-end; font-size: 10px; }
.tgrid .th .dnum { display: block; margin: 2px auto 0; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; font-size: 21px; color: inherit; cursor: pointer; }
.tgrid .th .dnum:hover { background: var(--cl2); }
.tgrid .th.is-today { color: var(--today); font-weight: 600; }
.tgrid .th.is-today .dnum { background: var(--today); color: #fff; }
.ad { min-height: 30px; padding: 2px; border-bottom: 1px solid var(--cl); border-left: 1px solid var(--cl2); display: flex; flex-direction: column; gap: 2px; }
.ad.gut { font-size: 10px; color: var(--cm); justify-content: center; border-left: 0; text-align: right; padding-right: 6px; }
.tscroll { flex: 1; overflow: auto; }
.tgrid.body { position: relative; }
.hours > div { position: relative; border-top: 1px solid transparent; font-size: 11px; color: var(--cm); text-align: right; padding-right: 6px; }
.hours > div span { position: relative; top: -8px; }
.hours > div small { display: block; position: relative; top: -8px; font-size: 10px; opacity: .8; }
.tcol { position: relative; border-left: 1px solid var(--cl2); background-image: linear-gradient(var(--cl2) 1px, transparent 1px); background-size: 100% 48px; touch-action: pan-y; }
.ev { position: absolute; border-radius: 6px; padding: 3px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; border-left: 3px solid var(--edge); box-shadow: 0 1px 2px rgba(0,0,0,.15); user-select: none; }
.ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { font-size: 11px; opacity: .92; }
.ev.short { padding-top: 1px; }
.ev.dragging { opacity: .8; z-index: 3; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.ev .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cancel, .ev.cancel b, .chip-ev.cancel, .ag-ev.cancel .nm { text-decoration: line-through; }
.ev.cancel, .chip-ev.cancel, .ag-ev.cancel { opacity: .5; }
.now { position: absolute; left: 0; right: 0; height: 2px; background: #D93025; z-index: 2; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #D93025; }
.ghost-sel { position: absolute; left: 2px; right: 2px; background: rgba(26,115,232,.18); border: 1px solid #1A73E8; border-radius: 6px; font-size: 11px; padding: 2px 6px; pointer-events: none; }
.chip-ev { display: flex; align-items: center; gap: 4px; width: 100%; padding: 2px 6px; border: 0; border-radius: 4px; background: none; color: inherit; font-size: 12px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 22px; }
.chip-ev:hover { background: var(--cl2); }
.chip-ev.filled { font-weight: 500; }
.chip-ev .tm { color: var(--cm); flex: none; }
.chip-ev .dot { flex: none; margin-right: 0; }

/* Oy */
.mgrid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(96px, 1fr)); }
.mh { text-align: center; font-size: 12px; color: var(--cm); padding: 6px 0; border-bottom: 1px solid var(--cl); }
.mcell { border-right: 1px solid var(--cl2); border-bottom: 1px solid var(--cl2); padding: 4px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mcell.other { opacity: .5; }
.mcell .dnum { align-self: center; width: 28px; height: 28px; border-radius: 50%; border: 0; background: none; font-size: 12px; cursor: pointer; color: inherit; }
.mcell .dnum.today { background: var(--today); color: #fff; font-weight: 700; }
.more { border: 0; background: none; color: inherit; font-size: 12px; font-weight: 600; text-align: left; padding: 2px 6px; cursor: pointer; }
.more:hover { text-decoration: underline; }

/* Jadval */
.agenda { padding: 12px 20px 40px; max-width: 900px; }
.ag-day { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--cl2); }
.ag-date { text-align: center; color: var(--cm); font-size: 12px; }
.ag-date b { display: block; font-size: 22px; font-weight: 500; color: inherit; }
.ag-day.is-today .ag-date b { color: var(--today); }
.ag-ev { display: grid; grid-template-columns: 14px 120px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 6px; font-size: 14px; }
.ag-ev:hover { background: var(--cl2); }
.ag-ev .tm, .ag-ev .ty { color: var(--cm); font-size: 13px; }
.calendar .empty { border-color: var(--cl); }

/* Tadbir oynasi */
.cal-pop { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(8,18,32,.25); padding: 16px; }
.cp-box { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--cs); border-radius: 12px; border-top: 6px solid; padding: 16px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.3); outline: none; }
.cp-h { display: flex; gap: 10px; align-items: flex-start; }
.cp-h h3 { flex: 1; font-size: 20px; font-weight: 500; margin: 0; }
.cp-box p { margin: 8px 0; }
.cp-box .desc { white-space: pre-wrap; }
.cp-box .hist li { padding: 6px 0; }

/* Forma */
.cal-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.cal-form .when > label { margin-top: 8px; }
.cal-form .chk, .cal-form .inl { flex-direction: row !important; align-items: center; gap: 6px; }
.cal-form .inl { display: inline-flex; margin-right: 10px; }
.cal-form .rec { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cal-form legend { font-size: 13px; color: var(--muted); }
.cal-form .days { display: flex; flex-wrap: wrap; }
.cal-form input, .cal-form select, .cal-form textarea { font-size: 14px; }
.colors { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sw-pick { position: relative; flex-direction: row !important; }
.sw-pick input { position: absolute; opacity: 0; }
.sw-pick span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.sw-pick input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.sw-pick input:focus-visible + span { outline: 2px solid var(--focus); }

@media (max-width: 760px) {
  .cal-burger { display: inline-flex; }
  .cal-title { display: none; }
  .cal-period { order: 10; flex-basis: 100%; font-size: 17px; }
  .cal-q { order: 11; width: 100%; }
  .seg { order: 12; width: 100%; } .seg button { flex: 1; padding: 0 6px; }
  .cal-main { grid-template-columns: 1fr; }
  .cal-side { display: none; position: absolute; z-index: 4; top: 0; bottom: 0; left: 0; width: 280px; background: var(--cs); box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  .calendar.side-open .cal-side { display: flex; }
  .cal-main { position: relative; }
  .tgrid { grid-template-columns: 48px repeat(var(--n), minmax(0, 1fr)); }
  .mgrid { grid-template-rows: auto repeat(6, minmax(56px, 1fr)); }
  .mcell { align-items: center; } .mcell .dot { margin: 0 1px; }
  .ag-ev { grid-template-columns: 14px 1fr; } .ag-ev .tm { grid-column: 2; } .ag-ev .nm { grid-column: 2; } .ag-ev .ty { grid-column: 2; }
  .agenda { padding: 8px 12px 32px; }
  .cal-form .two { grid-template-columns: 1fr; }
}
