/* DigitalJizzakh DSS — «Ситуацион марказ» тўқ дизайн тизими */
:root {
  --bg: #0b1220; --bg-2: #0f172a; --card: #111b31; --card-2: #16213a; --line: #1e2a44; --line-2: #2c3a57;
  --ink: #e4e9f2; --ink-2: #9aa8c2; --ink-3: #7c8aa5;
  --sky: #38bdf8; --sky-2: #7dd3fc; --emerald: #34d399; --amber: #fbbf24; --rose: #fb7185; --violet: #a78bfa;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #9085e9; --s7: #e66767; --s8: #1f9fae;
  --radius: 14px; --shadow: 0 10px 30px -12px rgba(0,0,0,.6), 0 0 0 1px rgba(148,163,184,.06) inset;
}
html { color-scheme: dark; }
body { background: radial-gradient(1200px 600px at 10% -10%, rgba(56,189,248,.10), transparent 60%),
                   radial-gradient(900px 500px at 100% 0%, rgba(167,139,250,.10), transparent 55%), var(--bg); color: var(--ink); }
::selection { background: rgba(56,189,248,.35); }
* { scrollbar-width: thin; scrollbar-color: #2c3a57 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; } *::-webkit-scrollbar-thumb { background: #2c3a57; border-radius: 8px; }
a { transition: color .15s; }
h1 { letter-spacing: -.01em; color: #fff; font-weight: 700; }
select[multiple] option:checked { background: rgba(56,189,248,.25) linear-gradient(0deg, rgba(56,189,248,.25), rgba(56,189,248,.25)); color: #fff; }
select[multiple] option { padding: 2px 6px; border-radius: 4px; }
select[multiple], select[size] { background-image: none !important; }

/* ---------- каркас ---------- */
#sidebar { background: linear-gradient(180deg, #0c1527 0%, #0a1020 100%); border-right: 1px solid var(--line); }
#sidebar .nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; margin: 1px 10px; border-radius: 10px; color: #b6c1d6; font-size: 13.5px; transition: background .15s, color .15s, transform .15s; }
#sidebar .nav-item:hover { background: rgba(56,189,248,.08); color: #fff; }
#sidebar .nav-item.active { background: linear-gradient(90deg, rgba(56,189,248,.22), rgba(56,189,248,.05)); color: #fff; box-shadow: inset 3px 0 0 var(--sky); }
#sidebar .nav-item svg { width: 18px; height: 18px; flex: none; opacity: .8; }
#sidebar .nav-item.active svg { opacity: 1; color: var(--sky); }
#sidebar .nav-sub { display: block; margin: 0 10px 0 42px; padding: 4px 10px; border-radius: 8px; font-size: 12px; color: #7c8aa5; border-left: 1px solid var(--line-2); }
#sidebar .nav-sub:hover { color: #fff; } #sidebar .nav-sub.active { color: var(--sky-2); border-left-color: var(--sky); }
#topbar { background: rgba(11,18,32,.75); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
#topbar input { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: conic-gradient(from 210deg, #38bdf8, #a78bfa, #34d399, #38bdf8); box-shadow: 0 0 24px rgba(56,189,248,.45); display: grid; place-items: center; }
.brand-mark span { width: 30px; height: 30px; border-radius: 8px; background: #0b1220; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 13px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: pulse 2s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6);} 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0);} 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0);} }
.clock { font-variant-numeric: tabular-nums; letter-spacing: .04em; }

/* ---------- контент анимацияси ---------- */
#content { animation: fadeUp .35s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none;} }
.stagger > * { animation: fadeUp .45s ease-out both; }
.stagger > *:nth-child(1) { animation-delay: .02s } .stagger > *:nth-child(2) { animation-delay: .06s } .stagger > *:nth-child(3) { animation-delay: .10s }
.stagger > *:nth-child(4) { animation-delay: .14s } .stagger > *:nth-child(5) { animation-delay: .18s } .stagger > *:nth-child(6) { animation-delay: .22s }
.stagger > *:nth-child(7) { animation-delay: .26s } .stagger > *:nth-child(8) { animation-delay: .30s } .stagger > *:nth-child(9) { animation-delay: .34s }
.stagger > *:nth-child(10) { animation-delay: .38s } .stagger > *:nth-child(n+11) { animation-delay: .42s }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- карточкалар ---------- */
.card, .kpi { background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0)) , var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card { position: relative; }
.card-title { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.card-sub { font-size: 11px; color: var(--ink-3); }
.kpi { padding: 14px 16px; position: relative; overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s; }
.kpi::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px; background: var(--accent, var(--sky)); opacity: .9; }
.kpi:hover { transform: translateY(-2px); border-color: rgba(56,189,248,.45); box-shadow: 0 16px 40px -16px rgba(56,189,248,.35); }
.kpi .v { font-size: 27px; font-weight: 800; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .l { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.kpi .d { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi .spark { position: absolute; right: 8px; bottom: 4px; width: 110px; height: 36px; opacity: .55; pointer-events: none; z-index: 0; }
.kpi > *:not(.spark):not(.kpi-icon) { position: relative; z-index: 1; }
.kpi-icon { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent, var(--sky)) 18%, transparent); color: var(--accent, var(--sky)); }
.kpi-icon svg { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.chip.good { background: rgba(52,211,153,.16); color: #6ee7b7; } .chip.bad { background: rgba(251,113,133,.16); color: #fda4af; } .chip.neutral { background: rgba(148,163,184,.14); color: #cbd5e1; }
.up { color: #6ee7b7; } .down { color: #fda4af; }
.hero-num { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.glow-sky { box-shadow: 0 0 40px -10px rgba(56,189,248,.5); }

/* ---------- жадваллар ---------- */
table.data { width: 100%; font-size: 13px; border-collapse: collapse; }
table.data th { background: #0f1930; color: #9aa8c2; font-weight: 600; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; white-space: nowrap; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
table.data td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td.whitespace-normal, table.data th.whitespace-normal { white-space: normal; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: rgba(56,189,248,.05); }
table.data tr.total td { font-weight: 600; background: rgba(148,163,184,.08); }
table.data tr.parent td { font-weight: 600; background: rgba(56,189,248,.07); }
.rank-bar { height: 6px; border-radius: 4px; background: linear-gradient(90deg, var(--sky), var(--violet)); transform-origin: left; animation: grow .8s cubic-bezier(.2,.7,.2,1) both; }
@keyframes grow { from { transform: scaleX(0);} to { transform: scaleX(1);} }

/* ---------- белгилар ---------- */
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: rgba(148,163,184,.16); color: #cbd5e1; font-weight: 500; }
.badge.est { background: rgba(251,191,36,.16); color: #fde68a; }
.badge.ok { background: rgba(52,211,153,.16); color: #6ee7b7; }
.badge.err { background: rgba(251,113,133,.18); color: #fda4af; }
.badge.warn { background: rgba(251,191,36,.16); color: #fde68a; }
.tl-GREEN { background: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,.7); } .tl-YELLOW { background: #eab308; box-shadow: 0 0 10px rgba(234,179,8,.7); }
.tl-RED { background: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,.7); } .tl-GRAY { background: #64748b; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.chart { width: 100%; height: 340px; }
.chart.sm { height: 220px; } .chart.xs { height: 150px; } .chart.lg { height: 460px; }

/* ---------- тугмалар, формалар ---------- */
.btn { display: inline-flex; align-items: center; gap: 4px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card-2); padding: 6px 12px; font-size: 13px; color: #dbe3f0; cursor: pointer; transition: all .15s; }
.btn:hover { background: #1c2a47; border-color: #3b4c6e; color: #fff; }
.btn-primary { display: inline-flex; align-items: center; gap: 4px; border-radius: 8px; background: linear-gradient(135deg, #0ea5e9, #2563eb); padding: 6px 14px; font-size: 13px; color: #fff; cursor: pointer; border: 0; box-shadow: 0 6px 16px -6px rgba(14,165,233,.6); transition: filter .15s, transform .15s; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
input, select, textarea { background-color: var(--card) !important; color: var(--ink) !important; border-color: var(--line-2) !important; border-radius: 8px !important; }
input:focus, select:focus, textarea:focus { border-color: var(--sky) !important; box-shadow: 0 0 0 3px rgba(56,189,248,.2) !important; }
input[type=checkbox], input[type=radio] { background-color: var(--card-2) !important; }
input::placeholder { color: #5b6a86 !important; }
select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239aa8c2' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-indicator { display: none; }
.ring-ok { box-shadow: 0 0 0 2px rgba(52,211,153,.5); }

/* ---------- MapLibre тўқ ---------- */
.maplibregl-popup-content { background: #111b31 !important; color: #e4e9f2; border: 1px solid var(--line-2); border-radius: 10px !important; box-shadow: 0 10px 30px rgba(0,0,0,.5) !important; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #111b31 !important; } .maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #111b31 !important; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #111b31 !important; } .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #111b31 !important; }
.maplibregl-popup-close-button { color: #9aa8c2; font-size: 18px; }
.maplibregl-ctrl-group { background: #16213a !important; border: 1px solid var(--line-2); } .maplibregl-ctrl-group button + button { border-top-color: var(--line-2) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) opacity(.8); }

/* ---------- ҳоким экрани ---------- */
.screen { position: fixed; inset: 0; background: radial-gradient(1400px 700px at 20% -10%, rgba(56,189,248,.14), transparent 60%), radial-gradient(1000px 600px at 90% 110%, rgba(167,139,250,.14), transparent 60%), #060b16; color: #e4e9f2; display: flex; flex-direction: column; overflow: hidden; font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; }
.screen-top { display: flex; align-items: center; gap: 18px; padding: 14px 28px; border-bottom: 1px solid rgba(148,163,184,.12); }
.screen-body { flex: 1; position: relative; min-height: 0; }
.slide { position: absolute; inset: 0; padding: 22px 28px; opacity: 0; transform: translateX(30px) scale(.985); transition: opacity .6s ease, transform .6s ease; pointer-events: none; display: flex; flex-direction: column; gap: 16px; }
.slide.active { opacity: 1; transform: none; pointer-events: auto; }
.slide h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.slide .grid { display: grid; gap: 16px; }
.panel { background: rgba(17,27,49,.7); border: 1px solid rgba(148,163,184,.14); border-radius: 18px; padding: 18px 20px; backdrop-filter: blur(6px); box-shadow: 0 20px 50px -30px rgba(0,0,0,.8); position: relative; overflow: hidden; }
.panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #9aa8c2; font-weight: 600; margin-bottom: 8px; }
.screen-kpi { display: flex; flex-direction: column; gap: 4px; }
.screen-kpi .v { font-size: 40px; font-weight: 800; letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.screen-kpi .l { font-size: 13px; color: #9aa8c2; }
.screen-kpi .spark { height: 44px; width: 100%; margin-top: 4px; }
.screen-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--sky), var(--violet)); width: 0; transition: width linear; }
.screen-nav { display: flex; gap: 8px; }
.screen-nav button { width: 10px; height: 10px; border-radius: 50%; background: rgba(148,163,184,.3); border: 0; cursor: pointer; transition: all .2s; }
.screen-nav button.active { background: var(--sky); width: 28px; border-radius: 6px; }
.ticker { white-space: nowrap; overflow: hidden; }
.ticker span { display: inline-block; padding-left: 100%; animation: ticker 40s linear infinite; }
@keyframes ticker { from { transform: translateX(0);} to { transform: translateX(-100%);} }
.medal { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; color: #0b1220; }
.medal-1 { background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 0 14px rgba(245,158,11,.6); }
.medal-2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); } .medal-3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #fff; }
.medal-n { background: rgba(148,163,184,.18); color: #cbd5e1; }

@media print { body { background: #fff; color: #000; } aside, header, footer, .print\:hidden { display: none !important; } #content { padding: 0; } .card, .kpi { background: #fff; border-color: #ccc; box-shadow: none; } }

/* ---------- M19: киритиш жадвали (Excel кўриниши) ---------- */
table.egrid { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
table.egrid th, table.egrid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; }
table.egrid thead th { position: sticky; top: 0; z-index: 3; background: #0f1930; color: #cdd5e4; font-weight: 600; vertical-align: bottom; padding: 6px 8px; min-width: 7.5rem; max-width: 12rem; }
table.egrid thead th .eg-h { white-space: normal; line-height: 1.2; font-size: 12px; }
table.egrid thead th .eg-hc { font-size: 10px; color: #7c8aa5; font-weight: 400; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.egrid .eg-rh { position: sticky; z-index: 2; background: #101a2f; padding: 4px 8px; }
table.egrid .eg-num { left: 0; width: 2.5rem; min-width: 2.5rem; text-align: right; color: #7c8aa5; font-size: 11px; }
table.egrid .eg-name { left: 2.5rem; min-width: 14rem; max-width: 18rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
table.egrid thead .eg-rh { z-index: 4; }
table.egrid td.eg-c { text-align: right; padding: 4px 8px; min-width: 7.5rem; height: 30px; outline: none; cursor: cell; background: var(--card); color: #fff; }
table.egrid td.eg-c[contenteditable]:hover { background: #16213a; }
table.egrid td.eg-c[contenteditable]:focus { box-shadow: inset 0 0 0 2px var(--sky); background: #0b1220; cursor: text; }
table.egrid td.eg-c:not([contenteditable]) { background: #0f172a; color: #9aa8c2; }
table.egrid td.eg-dirty { background: rgba(251,191,36,.18) !important; }
table.egrid td.eg-bad { box-shadow: inset 0 0 0 2px #f43f5e !important; color: #fda4af; }
table.egrid tr.eg-total td { background: rgba(56,189,248,.10); font-weight: 600; }
table.egrid tr.eg-total td.eg-rh { background: rgba(56,189,248,.16); }
table.egrid tr.eg-total td.eg-partial { color: #fbbf24; font-style: italic; }
table.egrid tbody tr:hover td.eg-rh { background: #1a2640; }
