/* ════════════════════════════════════════════════════════════
   UDT TEXNIKA — dizayn sistemi
   Brend: qızılı #EDBA25 · qara #090A13 · ağ #FFFFFF

   Tailwind tələb etmir: nə Node, nə qurma addımı. Aşağıda əvvəlcə
   dəyişənlər və komponentlər, sonra lazım olan qədər yardımçı sinif.
   ════════════════════════════════════════════════════════════ */

:root {
  --gold-200: #f9e08e;
  --gold-300: #f5cc53;
  --gold-400: #f1bb2e;
  --gold-500: #edba25;
  --gold-600: #cf9610;
  --gold-700: #a86e10;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 13px;
  --radius-xl: 18px;

  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --line: #e4e6ec;
  --line-strong: #d0d3dd;
  --txt: #14151f;
  --txt-2: #5a5d70;
  --txt-3: #8b8fa3;
  --accent: #edba25;
  --accent-ink: #090a13;
  --nav-bg: #0d0e18;
  --nav-txt: #a7a9bd;
  --nav-active: #edba25;
  --shadow-sm: 0 1px 2px rgba(9, 10, 19, .06);
  --shadow-md: 0 2px 8px -2px rgba(9, 10, 19, .1), 0 4px 16px -4px rgba(9, 10, 19, .06);
  --shadow-lg: 0 8px 28px -8px rgba(9, 10, 19, .18);
  --ok: #128a4f;  --ok-bg: #e7f7ee;
  --warn: #a86e10; --warn-bg: #fdf4d9;
  --bad: #c92a3a; --bad-bg: #fdeaec;
  --info: #1d63c9; --info-bg: #e8f0fd;
  --violet: #6d3bc4; --violet-bg: #f0eafc;
}

:root[data-theme="dark"] {
  --bg: #090a13;
  --panel: #12131f;
  --panel-2: #171827;
  --line: #242638;
  --line-strong: #32354c;
  --txt: #eceef5;
  --txt-2: #9b9fb5;
  --txt-3: #6e7289;
  --nav-bg: #0b0c15;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 10px -2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 10px 34px -10px rgba(0, 0, 0, .7);
  --ok: #37cd85; --ok-bg: #0e2a1d;
  --warn: #f1bb2e; --warn-bg: #2e2510;
  --bad: #ff6b7a; --bad-bg: #2f1418;
  --info: #6aa4ff; --info-bg: #111e35;
  --violet: #b394f5; --violet-bg: #1e1636;
}

*, *::before, *::after { box-sizing: border-box; border-color: var(--line); }
* { margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "tnum";
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--txt-3); }

/* ───────────────── Tətbiq karkası ───────────────── */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex-shrink: 0;
  background: var(--nav-bg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 16px 14px;
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: -.02em;
}
.sidebar-logo {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent); color: #090a13;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  position: sticky; top: 0; z-index: 30;
}
.content { padding: 18px; flex: 1; min-width: 0; }
.page-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.page-ttl { font-size: 21px; font-weight: 680; letter-spacing: -.025em; }
.page-sub { font-size: 13px; color: var(--txt-2); margin-top: 3px; }

/* ───────────────── Səth və kartlar ───────────────── */

.surface { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.card-ttl { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.card-bd { padding: 16px; }
.card-ft { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel-2); }

/* ───────────────── Düymələr ───────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; line-height: 1;
  white-space: nowrap; border: 1px solid transparent; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s, transform .08s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary { background: var(--accent); color: #090a13; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--gold-300); }
.btn-dark { background: var(--nav-bg); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #1c1d2b; }
:root[data-theme="dark"] .btn-dark { background: var(--panel-2); border-color: var(--line-strong); }
.btn-ghost { background: transparent; color: var(--txt-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--txt); border-color: var(--line-strong); }
.btn-soft { background: var(--panel-2); color: var(--txt); border-color: var(--line); }
.btn-soft:hover:not(:disabled) { background: var(--line); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover:not(:disabled) { background: var(--bad); color: #fff; }
.btn-sm { height: 29px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-sm); gap: 5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 29px; }

/* ───────────────── Form elementləri ───────────────── */

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 11.5px; font-weight: 600; color: var(--txt-2); letter-spacing: .02em; text-transform: uppercase; }
.hint { font-size: 11.5px; color: var(--txt-3); }
.err { font-size: 12px; color: var(--bad); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 11px; height: 36px;
  font-size: 13.5px; color: var(--txt);
  transition: border-color .14s, box-shadow .14s;
}
.textarea { height: auto; padding: 9px 11px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--txt-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(237, 186, 37, .18);
}
.input:disabled, .select:disabled { background: var(--panel-2); color: var(--txt-3); cursor: not-allowed; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%238b8fa3' stroke-width='1.6' stroke-linecap='round' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
.input-sm { height: 29px; font-size: 12.5px; padding: 0 8px; border-radius: var(--radius-sm); }
.input-num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12.5px; }
.input-flush { border-color: transparent; background: transparent; border-radius: var(--radius-xs); }
.input-flush:hover { background: var(--panel-2); border-color: var(--line); }
.checkbox { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ───────────────── Cədvəllər ───────────────── */

.tbl-wrap { overflow: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--panel); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--panel-2); padding: 9px 12px; text-align: left;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--txt-2); border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.tbl tbody td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl tfoot td {
  padding: 10px 12px; background: var(--panel-2); font-weight: 700;
  border-top: 2px solid var(--line-strong); font-size: 13px;
}
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: -.02em; }
.tbl-dense tbody td { padding: 5px 9px; }
.tbl-dense thead th { padding: 7px 9px; }
.tbl-zebra tbody tr:nth-child(even) { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.row-muted td { opacity: .45; }
.row-flag-dup { box-shadow: inset 3px 0 0 var(--violet); }
.row-flag-removed td { text-decoration: line-through; opacity: .5; }
.row-flag-alert { box-shadow: inset 3px 0 0 var(--bad); }
.row-done { box-shadow: inset 3px 0 0 var(--ok); }
.col-sticky { position: sticky; left: 0; background: var(--panel); z-index: 2; }
.tbl tbody tr:hover .col-sticky { background: var(--panel-2); }

/* ───────────────── Nişanlar ───────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 650; line-height: 18px; white-space: nowrap;
}
.badge-dot::before { content: ""; width: 5px; height: 5px; border-radius: 99px; background: currentColor; }
.badge-slate { background: var(--panel-2); color: var(--txt-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge-amber { background: var(--warn-bg); color: var(--warn); }
.badge-green { background: var(--ok-bg); color: var(--ok); }
.badge-red { background: var(--bad-bg); color: var(--bad); }
.badge-blue { background: var(--info-bg); color: var(--info); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-gold { background: var(--accent); color: #090a13; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 99px;
  border: 1px solid var(--line-strong); background: var(--panel);
  font-size: 12px; font-weight: 550; color: var(--txt-2);
  cursor: pointer; transition: all .14s;
}
.chip:hover { border-color: var(--txt-3); color: var(--txt); }
.chip-on { background: var(--nav-bg); border-color: var(--nav-bg); color: #fff; }
:root[data-theme="dark"] .chip-on { background: var(--accent); color: #090a13; border-color: var(--accent); }
.chip-n { font-size: 10.5px; opacity: .75; font-variant-numeric: tabular-nums; }

/* ───────────────── Naviqasiya ───────────────── */

.nav { flex: 1; overflow-y: auto; padding: 0 10px 16px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 11px; border-radius: var(--radius-md);
  font-size: 13.2px; font-weight: 550; color: var(--nav-txt);
  transition: background .14s, color .14s; position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link-on { background: rgba(237,186,37,.13); color: var(--nav-active); font-weight: 650; }
.nav-link-on::before {
  content: ""; position: absolute; left: -9px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-sec {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #565a74; padding: 0 11px; margin: 16px 0 6px;
}
.nav-n {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  padding: 0 6px; height: 17px; line-height: 17px; border-radius: 99px;
  background: rgba(237,186,37,.2); color: var(--gold-400);
}

/* ───────────────── Köməkçi komponentlər ───────────────── */

.kpi-val { font-size: 25px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi-lbl { font-size: 11.5px; font-weight: 600; color: var(--txt-2); text-transform: uppercase; letter-spacing: .04em; }
.kpi { padding: 14px 16px; }

.meter { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }

.divider { height: 1px; background: var(--line); }
.link { color: var(--txt); font-weight: 550; }
.link:hover { color: var(--gold-600); text-decoration: underline; text-underline-offset: 2px; }
:root[data-theme="dark"] .link:hover { color: var(--accent); }

.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.02em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--txt-2); }
.faint { color: var(--txt-3); }
.pos { color: var(--ok); }
.neg { color: var(--bad); }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 52px 20px; text-align: center; color: var(--txt-3);
}
.empty-ttl { font-size: 14px; font-weight: 600; color: var(--txt-2); }

.avatar {
  width: 30px; height: 30px; border-radius: 99px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #090a13;
}

.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; margin-bottom: 12px;
  border: 1px solid transparent;
}
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-warning { background: var(--warn-bg); color: var(--warn); }
.flash-info { background: var(--info-bg); color: var(--info); }

/* Sütun diaqramı — kitabxana olmadan */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 168px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.chart-bar { flex: 1; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .4s ease; }
.chart-bar-a { background: var(--accent); }
.chart-bar-b { background: var(--ok); }
.chart-bar-c { background: var(--line-strong); }
.chart-bar-ghost { background: repeating-linear-gradient(135deg, var(--gold-200) 0 4px, transparent 4px 8px); border: 1px dashed var(--gold-400); }
.chart-lbl { font-size: 10.5px; color: var(--txt-3); font-weight: 600; white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--txt-2); }
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; }

.stripe-gold { background: repeating-linear-gradient(135deg, var(--accent) 0 10px, #090a13 10px 20px); }

.fade-in { animation: fadein .22s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ───────────────── Yardımçı siniflər ───────────────── */

.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.shrink0 { flex-shrink: 0; }
.ml-auto { margin-left: auto; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.gap0 { gap: 0; }
.gap4 { gap: 4px; }
.gap6 { gap: 6px; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.gap14 { gap: 14px; }
.gap18 { gap: 18px; }

.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }

.p0 { padding: 0; } .p12 { padding: 12px; } .p16 { padding: 16px; }

.t10 { font-size: 10.5px; } .t11 { font-size: 11.5px; } .t12 { font-size: 12.5px; }
.t13 { font-size: 13px; } .t15 { font-size: 15px; } .t17 { font-size: 17px; } .t21 { font-size: 21px; }
.w500 { font-weight: 500; } .w600 { font-weight: 600; } .w700 { font-weight: 700; }
.upper { text-transform: uppercase; letter-spacing: .04em; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.full { width: 100%; }

/* ───────────────── Çap (A4) ───────────────── */

@media print {
  @page { size: A4; margin: 11mm 10mm 13mm; }
  html, body { background: #fff !important; color: #000 !important; font-size: 10.5px; }
  .sidebar, .topbar, .no-print, .no-print * { display: none !important; }
  .app, .main, .content { display: block !important; padding: 0 !important; }
  .print-only { display: block !important; }
  .card, .tbl-wrap, .surface { border-color: #ccc !important; box-shadow: none !important; break-inside: avoid; }
  .tbl { font-size: 9.2px; }
  .tbl thead th {
    background: #f0f0f0 !important; color: #000 !important; padding: 4px 5px; font-size: 8.2px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .tbl tbody td { padding: 3px 5px; border-bottom: 1px solid #d8d8d8; }
  .tbl tbody tr { break-inside: avoid; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  .print-break { break-before: page; }
  .badge { border: 1px solid #bbb; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .grid { display: block !important; }
}
.print-only { display: none; }

/* ───────────────── Mobil ───────────────── */

@media (max-width: 1100px) {
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 14px; }
  .kpi-val { font-size: 21px; }
  .page-ttl { font-size: 18px; }
}

@media (min-width: 861px) { .menu-btn { display: none; } }
