/* ==========================================================================
   პროექტის ინსპექტირების სისტემა — ვიზუალური ენა
   ერთიანია buildsupervision.com-თან: Noto Sans Georgian, slate-900 გვერდითი
   პანელი, ლურჯი brand-700 მთავარ მოქმედებებზე, ქარვისფერი აქცენტი,
   თეთრი rounded-xl ბარათები slate-100 ფონზე. შესვლის გვერდი — ბნელი.
   ========================================================================== */

:root {
  /* ---- ბრენდი (ლურჯი) ---- */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;

  /* ---- ნეიტრალური (slate) ---- */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* ---- ქარვისფერი აქცენტი ---- */
  --accent:      #f5a524;
  --accent-hi:   #ffb638;
  --accent-on:   #1a1300;

  /* ---- სემანტიკური ზედაპირები ---- */
  --bg:         var(--slate-100);
  --surface:    #ffffff;
  --surface-2:  var(--slate-50);
  --border:     var(--slate-200);
  --border-2:   var(--slate-300);
  --text:       var(--slate-800);
  --heading:    var(--slate-900);
  --text-2:     var(--slate-500);
  --text-3:     var(--slate-400);

  --brand:      var(--brand-700);
  --brand-2:    var(--brand-800);

  --ok:   #047857;  --ok-soft:   #ecfdf5;  --ok-line:  #a7f3d0;
  --warn: #b45309;  --warn-soft: #fffbeb;  --warn-line:#fde68a;
  --bad:  #b91c1c;  --bad-soft:  #fef2f2;  --bad-line: #fecaca;

  /* ---- გეომეტრია ---- */
  --r-md:  6px;
  --r:     8px;    /* rounded-lg */
  --r-lg:  12px;   /* rounded-xl */
  --r-2xl: 16px;

  --sh-1: 0 1px 2px rgba(15, 23, 42, .06);
  --sh-3: 0 12px 40px -12px rgba(15, 23, 42, .32);

  --side-w: 256px;
  --main-w: 1280px;

  --sans: "Noto Sans Georgian", "Noto Sans", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b0f16;
    --surface:   #121a25;
    --surface-2: #17202c;
    --border:    #24303f;
    --border-2:  #33414f;
    --text:      #e8edf4;
    --heading:   #f3f6fa;
    --text-2:    #94a3b8;
    --text-3:    #6b7a8d;

    --brand:      var(--brand-500);
    --brand-2:    #60a5fa;

    --ok:   #34d399;  --ok-soft:   #0c2320;  --ok-line:  #1b5245;
    --warn: var(--accent);  --warn-soft: #241c08;  --warn-line:#523d10;
    --bad:  #f87171;  --bad-soft:  #2a1214;  --bad-line: #5a2426;

    --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-3: 0 14px 44px -14px rgba(0, 0, 0, .75);
  }
}

* { box-sizing: border-box; }

/*
 * hidden ატრიბუტი ყოველთვის უნდა მუშაობდეს.
 * ბრაუზერის წესი [hidden]{display:none} მხოლოდ HTML-ის სახელთა სივრცეს ეხება,
 * ამიტომ <svg hidden> (ხატულების ნაკრები) 300×150-ად იხატებოდა და გვერდს
 * ზემოდან ცარიელ ადგილს უტოვებდა. ამავე დროს ავტორის ნებისმიერი display-წესი
 * (მაგ. .page-back) ბრაუზერისას ჯაბნის — !important ორივეს კეტავს.
 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* სათაურები — სანსი, სქელი, შემჭიდროებული; სერიფი არ გამოიყენება */
h1, h2, h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -.025em; margin: 0; }
h1 { font-size: 21px; }
h2 { font-size: 15px; font-weight: 600; color: var(--text); }
h3 { font-size: 14.5px; font-weight: 600; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--brand-100); color: var(--slate-900); }


code {
  font-family: var(--mono); font-size: .92em;
  padding: 2px 6px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text);
}

/* ---------- კარკასი ---------- */

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

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

main {
  flex: 1;
  width: 100%;
  max-width: var(--main-w);
  margin: 0 auto;
  padding: 32px 24px 96px;
}

/* ---------- გვერდითი პანელი ---------- */

.side {
  width: var(--side-w);
  flex: none;
  background: var(--slate-900);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.side-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
}

.mark {
  width: 36px; height: 36px; flex: none;
  border-radius: var(--r);
  display: block;
  object-fit: contain;
}

.mark-txt { min-width: 0; line-height: 1.35; }
.mark-txt b { display: block; color: #fff; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark-txt span { display: block; font-size: 12px; color: var(--slate-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-nav { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 0; border-radius: var(--r);
  background: none; color: var(--slate-300);
  font: 500 14px/1.3 var(--sans); text-align: left;
  cursor: pointer; width: 100%;
  transition: background .13s, color .13s;
}
.nav-item svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-item.active { background: var(--brand-700); color: #fff; }

.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }

.side-acc {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; margin-bottom: 4px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, .05);
  font-size: 11.5px; line-height: 1.35;
}
.side-acc b { display: block; color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.side-acc span { color: var(--slate-400); }
.acc-dot {
  width: 7px; height: 7px; flex: none;
  background: var(--accent);
}

.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r); }
.side-user:hover { background: rgba(255, 255, 255, .1); }
.avatar {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--r-md);
  background: var(--brand-700); color: #fff;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600;
}
.who { min-width: 0; flex: 1; line-height: 1.35; }
.who b { display: block; font-size: 13.5px; color: #fff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { display: block; font-size: 12px; color: var(--slate-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ზედა ზოლი — მხოლოდ მობილურზე ---------- */
/* დესკტოპზე ზოლი არ არის: სათაური და მოქმედებები თვით გვერდშია. */

.topbar { display: none; }

.crumb {
  min-width: 0; flex: 1;
  font-size: 15px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- გვერდის სათაური ---------- */

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.page-head-main { min-width: 0; }
.page-head h1 { font-size: 24px; font-weight: 600; color: var(--heading); letter-spacing: -.025em; }
.page-sub { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }

.page-back {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0 0 2px -8px; padding: 6px 8px;
  font-size: 14px; color: var(--text-2); text-decoration: none;
  border-radius: var(--r-md);
}
.page-back:hover { color: var(--heading); text-decoration: none; background: var(--surface-2); }

/* ---------- ბარათი ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 16px;
  margin-bottom: 16px;
}
/* overflow: auto — ვიწრო ეკრანზე ცხრილი ბარათიდან არ გამოდის, გვერდითად ასქროლავს */
.card.flush { padding: 0; overflow: auto; }

.card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin: -16px -16px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
}
.card.flush .card-head { margin: 0; }
.card-head .sub { margin-top: 3px; width: 100%; }

.sub { color: var(--text-2); font-size: 13.5px; margin: 0; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.mt { margin-top: 16px; }
.rbody { min-width: 0; }

.sec-label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-2);
  margin: 20px 0 8px;
}
.sec-label:first-child { margin-top: 0; }

/* ---------- ღილაკები ---------- */

button, .btn {
  font: 500 15px/1 var(--sans);
  height: 44px; padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .13s, border-color .13s, color .13s;
}
button svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
button:hover { background: var(--surface-2); }
button:active { background: var(--slate-100); }
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--surface), 0 0 0 3px var(--brand-500);
}
button:disabled { opacity: .5; cursor: not-allowed; }

button.primary {
  background: var(--brand-700); border-color: var(--brand-700); color: #fff;
}
button.primary:hover { background: var(--brand-800); border-color: var(--brand-800); }
button.primary:active { background: var(--brand-900); border-color: var(--brand-900); }
button.primary:disabled { background: color-mix(in srgb, var(--brand-700) 50%, transparent); }

button.sm { height: 36px; padding: 0 12px; font-size: 14px; }

button.ghost { background: none; border-color: transparent; color: var(--text-2); }
button.ghost:hover { background: var(--slate-100); color: var(--text); }

button.danger { background: none; border-color: transparent; color: var(--bad); }
button.danger:hover { background: var(--bad-soft); }

.icon-btn {
  height: 36px; width: 36px; padding: 0;
  border-radius: var(--r);
  border-color: transparent; background: none; color: inherit;
}
.icon-btn:hover { background: var(--slate-100); }
.side .icon-btn { color: var(--slate-300); }
.side .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- ველები ---------- */

input, select, textarea {
  font: 15px/1.4 var(--sans);
  height: 44px; padding: 0 12px; width: 100%;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--surface); color: var(--text);
  transition: border-color .13s, box-shadow .13s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 76px; line-height: 1.6; }
input[type=checkbox] { height: auto; width: auto; accent-color: var(--brand-700); }

label {
  display: block;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* ---------- ტაბები ---------- */

.tabs {
  display: flex; min-width: max-content; gap: 4px;
  border-bottom: 1px solid var(--border);
}
.tabs-wrap { overflow-x: auto; margin-bottom: 20px; }

.tab {
  display: flex; align-items: center; gap: 8px;
  height: 44px; margin-bottom: -1px; padding: 0 12px;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; color: var(--text-2);
  font: 500 14px/1 var(--sans); white-space: nowrap;
  cursor: pointer;
  transition: color .13s, border-color .13s;
}
.tab:hover { background: none; color: var(--heading); }
.tab:active { background: none; }
.tab.active { border-bottom-color: var(--brand); color: var(--brand-2); }
.tab:focus-visible { box-shadow: none; outline: 2px solid var(--brand-500); outline-offset: -2px; }

.tab-count {
  padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 500;
}
.tab.active .tab-count { background: color-mix(in srgb, var(--brand-500) 12%, var(--surface)); color: var(--brand); }

/* ---------- ნიშნაკები ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.5;
  white-space: nowrap;
  /* ნაგულისხმევი ტონი ნაცრისფერია — უტონო ნიშნაკიც გამოიყურება */
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.badge svg { width: 13px; height: 13px; fill: currentColor; }
.badge.ok   { background: var(--ok-soft);   color: var(--ok);   border-color: var(--ok-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.bad  { background: var(--bad-soft);  color: var(--bad);  border-color: var(--bad-line); }
.badge.mute { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }

/* ---------- სტატისტიკის ფილები ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }

.stat {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 14px 16px;
}
.stat::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--brand);
}
.stat.ok::before   { background: var(--ok); }
.stat.warn::before { background: var(--accent); }
.stat.mute::before { background: var(--border-2); }
.stat .k { font-size: 12px; color: var(--text-2); font-weight: 500; }
.stat .v { font-size: 27px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .n { font-size: 11.5px; color: var(--text-3); }

/* ---------- ცხრილი ---------- */

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; }
.tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
.tbl th:last-child,  .tbl td:last-child  { padding-right: 16px; }
.tbl thead { background: var(--slate-50); }
.tbl th {
  font-size: 12px; font-weight: 600; letter-spacing: .025em;
  color: var(--text-2); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.tbl td { border-bottom: 1px solid var(--slate-100); }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .id { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl .obj { font-weight: 500; }
.tbl .meta { font-size: 12.5px; color: var(--text-3); }

/* ---------- ეტაპების ზოლი ---------- */

.steps { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 0 2px; }
.step { flex: 1; min-width: 86px; position: relative; text-align: center; }
.step::before {
  content: ''; position: absolute; top: 13px; right: 50%; left: -50%; height: 2px;
  background: var(--border);
}
.step:first-child::before { display: none; }
.step.done::before, .step.now::before { background: var(--brand); }
.step .dot {
  position: relative; z-index: 1;
  width: 28px; height: 28px; margin: 0 auto 7px;
  border-radius: 999px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text-3);
  display: grid; place-items: center;
}
.step .dot svg { width: 14px; height: 14px; fill: currentColor; }
.step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.now .dot {
  border-color: var(--brand); color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 28%, transparent);
}
.step .lbl { font-size: 11.5px; color: var(--text-3); line-height: 1.35; padding: 0 4px; }
.step.now .lbl { color: var(--brand); font-weight: 600; }
.step.done .lbl { color: var(--text-2); }

/* ---------- დასკვნის ბანერი ---------- */

.verdict {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  margin-bottom: 16px;
}
.verdict .vi { width: 38px; height: 38px; flex: none; border-radius: var(--r); display: grid; place-items: center; }
.verdict .vi svg { width: 21px; height: 21px; }
.verdict h2 { font-size: 16px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 3px; color: inherit; }
.verdict p { margin: 0; font-size: 14px; opacity: .92; }
.verdict.eligible { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.verdict.eligible .vi { background: var(--ok); } .verdict.eligible .vi svg { fill: var(--ok-soft); }
.verdict.partial { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.verdict.partial .vi { background: var(--accent); } .verdict.partial .vi svg { fill: var(--accent-on); }
.verdict.undetermined { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.verdict.undetermined .vi { background: var(--border-2); } .verdict.undetermined .vi svg { fill: var(--surface); }

/* ---------- მიმართულების სტრიქონი ---------- */

.dir {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface-2);
  transition: border-color .13s, background .13s;
}
.dir:hover { border-color: var(--border-2); }
.dir.picked { border-color: var(--brand); background: color-mix(in srgb, var(--brand-500) 12%, var(--surface)); }
.dir input[type=checkbox] {
  width: 20px; height: 20px; flex: none; margin: 1px 0 0;
}
.dir-main { flex: 1; min-width: 0; }
.dir-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14.5px; }
.dir-meta { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.dir-meta.dim { color: var(--text-3); }

.evidence {
  margin-top: 8px; padding: 8px 12px;
  border-left: 2px solid var(--border-2);
  background: var(--surface-2); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 13px; color: var(--text-2); line-height: 1.6;
}
.evidence b { font-style: normal; color: var(--text); font-weight: 600; }

/* ---------- შემოწმების სტრიქონი ---------- */

.chk { display: flex; gap: 11px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--slate-100); font-size: 13.5px; }
.chk:last-child { border-bottom: 0; }
.chk-main { flex: 1; min-width: 0; }

/* ---------- ჩეკლისტის პუნქტი ---------- */

.item {
  padding: 13px 16px; margin-bottom: 8px;
  border: 1px solid var(--border); border-left: 3px solid var(--border-2);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--surface);
}
.item.compliant     { border-left-color: var(--ok); }
.item.non_compliant { border-left-color: var(--bad); background: var(--bad-soft); }
.item.na            { border-left-color: var(--border-2); opacity: .68; }
.item-head { display: flex; align-items: flex-start; gap: 12px; }
.item-marker {
  width: 26px; height: 26px; flex: none;
  border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text-2);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.item-text { flex: 1; font-size: 14px; line-height: 1.6; }

.seg { display: inline-flex; flex: none; border: 1px solid var(--border-2); border-radius: var(--r); overflow: hidden; }
.seg button {
  height: 34px; padding: 0 11px; font-size: 13px;
  border: 0; border-radius: 0; background: var(--surface); color: var(--text-2);
}
.seg button + button { border-left: 1px solid var(--border-2); }
.seg button:hover { background: var(--surface-2); color: var(--text); }
.seg button:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-500); }
.seg button.on-ok  { background: #059669; color: #fff; }
.seg button.on-bad { background: #dc2626; color: #fff; }
.seg button.on-na  { background: var(--slate-500); color: #fff; }

.item-finding { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--slate-100); }

.progress { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.progress b { color: var(--text); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

.bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; display: flex; margin-top: 10px; }
.bar i { display: block; height: 100%; }
.bar .b-ok  { background: #059669; }
.bar .b-bad { background: #dc2626; }
.bar .b-na  { background: var(--border-2); }

/* ---------- ფაილები ---------- */

.drop {
  border: 1px dashed var(--border-2); border-radius: var(--r-lg);
  background: var(--surface-2);
  padding: 26px 20px; text-align: center;
  color: var(--text-2); font-size: 13.5px; cursor: pointer;
  transition: border-color .13s, background .13s, color .13s;
}
.drop svg { width: 26px; height: 26px; fill: var(--text-3); margin: 0 auto 7px; display: block; }
.drop:hover { border-color: var(--brand-500); color: var(--brand); }
.drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand-500) 12%, var(--surface)); color: var(--brand); }
.drop.over svg { fill: var(--brand); }

.flist { list-style: none; padding: 0; margin: 0; }
.flist li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--slate-100);
  font-size: 13.5px;
}
.flist li:last-child { border-bottom: 0; }
.flist .fi { width: 17px; height: 17px; fill: var(--text-3); flex: none; }
.flist .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flist .fsize { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- ისტორია ---------- */

.log { list-style: none; padding: 0; margin: 0; position: relative; }
.log li { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.log li::before {
  content: ''; position: absolute; top: 16px; bottom: 0; left: 5px; width: 2px;
  background: var(--border);
}
.log li:last-child { padding-bottom: 0; }
.log li:last-child::before { display: none; }
.log .pt {
  width: 12px; height: 12px; flex: none; margin-top: 4px;
  border-radius: 999px; border: 2px solid var(--surface);
  background: var(--brand); box-shadow: 0 0 0 1px var(--border);
}
.log .lmain { flex: 1; min-width: 0; }
.log .lev { font-size: 13.5px; }
.log .lmeta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- ცარიელი მდგომარეობა ---------- */

.empty { text-align: center; padding: 56px 24px; }
.empty .ei {
  width: 48px; height: 48px; margin: 0 auto 14px;
  border-radius: var(--r-lg); background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
}
.empty .ei svg { width: 24px; height: 24px; fill: var(--text-3); }
.empty h3 { margin-bottom: 6px; font-size: 16px; font-weight: 500; color: var(--slate-700); }
.empty p { color: var(--text-2); font-size: 14px; margin: 0 auto; max-width: 420px; }
.empty .row { justify-content: center; margin-top: 18px; }

/* ---------- საცნობარო სიები ---------- */

.ref-item { padding: 15px 0; border-bottom: 1px solid var(--slate-100); }
.ref-item:last-child { border-bottom: 0; }
.ref-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.ref-head h3 { font-size: 14.5px; }
.ref-list { margin: 7px 0 0; padding-left: 20px; font-size: 13px; color: var(--text-2); }
.ref-list li { margin-bottom: 3px; }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lib {
  padding: 13px 14px;
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface-2);
}
.lib.off { opacity: .6; }
.lib .lt { font-weight: 500; line-height: 1.5; margin-bottom: 6px; font-size: 14px; }
.lib .lm { font-size: 11.5px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- ავტომატური შეფასება ---------- */

.auto {
  margin-top: 12px; padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
}
.auto.ok { border-left-color: var(--ok); }
.auto-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.auto-tag {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--warn);
}
.auto .evidence { margin-top: 6px; border-left-color: var(--accent); }
.auto .evidence:first-of-type { margin-top: 0; }

/* ==========================================================================
   შესვლა — ბნელი გვერდი ქარვისფერი მოქმედებით
   ========================================================================== */

.login-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  background: #0b0b0c;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: url('/skyline.svg') center bottom / cover no-repeat;
  opacity: .5;
}
.login-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, #0b0b0c 8%, rgba(11, 11, 12, .72) 55%, rgba(11, 11, 12, .45) 100%);
}

.login-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr;
  gap: 40px; align-items: center;
  width: 100%; max-width: 980px;
}
@media (min-width: 1024px) {
  .login-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; }
}

/* მარცხენა მხარე — ბრენდი და დანიშნულება */
.login-intro { color: #fff; min-width: 0; }
.login-intro .lbrand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-intro .lbrand .mark { width: 44px; height: 44px; border-radius: var(--r); }
.login-intro .lbrand b { display: block; font-size: 14.5px; font-weight: 600; }
.login-intro .lbrand span {
  display: block; font-size: 11px; color: var(--slate-400);
  letter-spacing: .06em; text-transform: uppercase; margin-top: 2px;
}
.login-intro h1 {
  font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15;
  color: var(--accent); margin-bottom: 14px; text-wrap: balance;
}
@media (min-width: 1024px) { .login-intro h1 { font-size: 38px; } }
.login-intro .lead { font-size: 14.5px; line-height: 1.65; color: var(--slate-300); margin: 0 0 20px; }
.login-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.login-points li {
  display: flex; gap: 12px;
  font-size: 14px; line-height: 1.6; color: #e2e8f0;
}
.login-points li::before {
  content: ''; flex: none;
  width: 7px; height: 7px; margin-top: 9px;
  background: var(--accent);
}
.login-intro .lnorms {
  margin: 24px 0 0; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px; line-height: 1.65; color: var(--slate-400);
}

/* მარჯვენა მხარე — ფორმა */
.login {
  background: #15171b;
  border-radius: var(--r-2xl);
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .95);
  outline: 1px solid rgba(255, 255, 255, .12);
  padding: 24px;
  color: #fff;
  width: 100%;
}
.login h1 { font-size: 19px; font-weight: 700; letter-spacing: -.025em; color: #fff; }
@media (min-width: 640px) { .login h1 { font-size: 21px; } }
.login .hint { font-size: 13.5px; color: var(--slate-400); margin: 6px 0 20px; line-height: 1.6; }

.login label { color: var(--slate-400); margin-bottom: 6px; }
.login input {
  height: 48px;
  border-color: #33373f; background: #0c0d10; color: #fff;
}
.login input::placeholder { color: #6f757f; }
.login input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent);
}

.login button[type=submit] {
  width: 100%; margin-top: 8px;
  height: 50px; font-weight: 600;
  border: 0; background: var(--accent); color: var(--accent-on);
}
.login button[type=submit]:hover { background: var(--accent-hi); }
.login button[type=submit]:focus-visible {
  box-shadow: 0 0 0 1px #15171b, 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent);
}

.login .err {
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 16px; padding: 11px 14px;
  border: 1px solid rgba(254, 202, 202, .25); border-radius: var(--r);
  background: #2a1113; color: #fecaca;
  font-size: 13.5px; line-height: 1.5;
}
.login .err svg { width: 16px; height: 16px; fill: currentColor; flex: none; margin-top: 2px; }

.login .foot {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 11.5px; line-height: 1.6; color: #6f757f; text-align: center;
}

/* ---------- ტოსტი ---------- */

.toast {
  position: fixed; z-index: 90;
  left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 11px 18px;
  border-radius: var(--r);
  background: var(--slate-900); color: #fff;
  font-size: 14px; box-shadow: var(--sh-3);
  max-width: calc(100vw - 32px);
}
.toast.bad { background: #b91c1c; }

/* ---------- რესპონსივი ---------- */


@media (max-width: 900px) {
  .side {
    position: fixed; inset: 0 auto 0 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--sh-3);
    width: 288px; max-width: 85vw;
  }
  .side.open { transform: none; }
  main { padding: 20px 16px 80px; }
  .topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    height: 56px; flex: none;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(8px);
  }
  .page-head h1 { font-size: 20px; }
  .card { padding: 14px; }
  .card-head { margin: -14px -14px 14px; padding: 12px 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .item-head { flex-wrap: wrap; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  /* სფეროს პუნქტები და ფაილების რაოდენობა — დაკვეთის გვერდზე ისედაც ჩანს */
  .tbl th:nth-child(3), .tbl td:nth-child(3),
  .tbl th:nth-child(4), .tbl td:nth-child(4) { display: none; }
  .login { padding: 20px; }
}

/* ტელეფონზე ცხრილს ვტოვებთ მხოლოდ ობიექტს და ეტაპს */
@media (max-width: 620px) {
  .tbl th:nth-child(2), .tbl td:nth-child(2),
  .tbl th:nth-child(6), .tbl td:nth-child(6) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
