/* Osilanda valdymas: išvaizda.
   Prekės ženklas (brand/SKAITYK.md): grafitas #202D33, šalavijo žalia #80A675, Manrope (antraštės), Inter (tekstas).
   Šviesi ir tamsi tema; spalvos tik per kintamuosius. Pirmiausia kompiuteriui (lentelės), telefone – peržiūra. */
:root {
  color-scheme: light;
  --brand-graphite: #202d33;
  --brand-green: #80a675;
  --accent: #80a675;
  --accent-d: #6d9462;
  --accent-soft: #ebf2e8;
  --accent-ink: #46663d;

  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --surface-3: #edf1ef;
  --ink: #202d33;
  --ink-2: #3d4c52;
  --muted: #667479;
  --line: #e2e8e5;
  --line-2: #d0d9d5;

  --side: #202d33;
  --side-2: #2a3a41;
  --on-side: #f1f5f3;
  --on-side-2: #a7b5b9;

  --red: #d93d42;
  --ok-bg: #e2f5ec; --ok-ink: #1a7a4c;
  --wait-bg: #fdf1dc; --wait-ink: #8a5a00;
  --no-bg: #fde6e7; --no-ink: #b02a30;
  --tag-bg: #edf1ef; --tag-ink: #3d4c52;
  --info-bg: #e6eff6; --info-ink: #2b5876;

  --sh-1: 0 1px 2px rgba(32, 45, 51, .06), 0 1px 3px rgba(32, 45, 51, .04);
  --sh-3: 0 4px 10px rgba(32, 45, 51, .07), 0 18px 44px rgba(32, 45, 51, .16);
  --r-sm: 6px;
  --r: 10px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-h: Manrope, Inter, "Segoe UI", system-ui, sans-serif;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141c20; --surface: #1b252a; --surface-2: #202c32; --surface-3: #26343b;
    --ink: #e8eeeb; --ink-2: #c4cfcb; --muted: #8fa0a4; --line: #2b3a41; --line-2: #36474e;
    --side: #10171a; --side-2: #1b252a; --accent-soft: #24331f; --accent-ink: #a9cb9d;
    --ok-bg: #173628; --ok-ink: #7fd3a6; --wait-bg: #3a2d12; --wait-ink: #f0c36b; --no-bg: #3d1c1e; --no-ink: #f2989b;
    --tag-bg: #26343b; --tag-ink: #c4cfcb; --info-bg: #1c2f3d; --info-ink: #9cc6e4;
  }
}
:root[data-theme="dark"] {
  --bg: #141c20; --surface: #1b252a; --surface-2: #202c32; --surface-3: #26343b;
  --ink: #e8eeeb; --ink-2: #c4cfcb; --muted: #8fa0a4; --line: #2b3a41; --line-2: #36474e;
  --side: #10171a; --side-2: #1b252a; --accent-soft: #24331f; --accent-ink: #a9cb9d;
  --ok-bg: #173628; --ok-ink: #7fd3a6; --wait-bg: #3a2d12; --wait-ink: #f0c36b; --no-bg: #3d1c1e; --no-ink: #f2989b;
  --tag-bg: #26343b; --tag-ink: #c4cfcb; --info-bg: #1c2f3d; --info-ink: #9cc6e4;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-h); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 700; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Logotipas */
.lg { display: block; flex: none; --logo-ink: var(--ink); }
.lg .lg-k { fill: var(--logo-ink); stroke: var(--logo-ink); stroke-width: 3; stroke-linejoin: round; }
.lg .lg-t { fill: var(--logo-ink); }
.lg .lg-z { fill: var(--brand-green); stroke: var(--brand-green); stroke-width: 3; stroke-linejoin: round; }
.side .lg { --logo-ink: #ffffff; }

/* Įkėlimas */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Prisijungimas */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; box-shadow: var(--sh-1); }
.auth-logo { height: 34px; width: auto; margin-bottom: 22px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card p { color: var(--muted); margin: 0 0 18px; }

/* Išdėstymas */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--on-side); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .side-logo { height: 26px; width: auto; margin: 4px 8px 6px; }
.side .side-sub { color: var(--on-side-2); font-size: 12px; margin: 0 8px 18px; letter-spacing: .02em; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--on-side-2); text-decoration: none; font-weight: 500; }
.nav:hover { background: var(--side-2); color: var(--on-side); }
.nav.on { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .soon { margin-left: auto; font-size: 10.5px; color: var(--on-side-2); border: 1px solid var(--side-2); border-radius: 99px; padding: 1px 7px; }
.nav.dis { opacity: .55; pointer-events: none; }
.side-sep { height: 1px; background: var(--side-2); margin: 10px 4px; }
.side-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--side-2); font-size: 13px; }
.side-foot .who { color: var(--on-side); font-weight: 600; }
.side-foot .role { color: var(--on-side-2); font-size: 12px; margin-bottom: 8px; }
.side-foot button { background: none; border: 0; color: var(--on-side-2); padding: 4px 0; cursor: pointer; display: block; }
.side-foot button:hover { color: #fff; }

.main { padding: 28px 36px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumb { color: var(--muted); text-decoration: none; font-size: 13px; display: inline-block; margin-bottom: 6px; }
.crumb:hover { color: var(--ink); }

/* Mygtukai ir laukai */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; background: var(--accent); color: var(--brand-graphite); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent-d); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { background: none; color: var(--red); border-color: var(--line-2); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, select.input, textarea.input { height: 38px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 0 11px; width: 100%; outline: none; }
textarea.input { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 2px 0 14px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent-d); }
.err { color: var(--no-ink); background: var(--no-bg); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; font-size: 13px; }
.search { max-width: 280px; }

/* Kortelės, lentelės */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.card + .card { margin-top: 18px; }
.card-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h2 { flex: 1; }
.card-b { padding: 16px 18px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .mut { color: var(--muted); }
.tbl .code { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--tag-bg); color: var(--tag-ink); white-space: nowrap; }
.tag.planned { background: var(--info-bg); color: var(--info-ink); }
.tag.active { background: var(--ok-bg); color: var(--ok-ink); }
.tag.warranty { background: var(--wait-bg); color: var(--wait-ink); }
.tag.done, .tag.archived { background: var(--tag-bg); color: var(--muted); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { padding: 10px 14px; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab.dis { opacity: .5; cursor: default; }
.tab .soon { font-size: 10.5px; font-weight: 500; margin-left: 4px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 13px; }
.chip.on { background: var(--brand-graphite); border-color: var(--brand-graphite); color: #fff; }

/* Projekto informacija */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; }
.fact .k { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.fact .v { font-weight: 500; }
.fact .v.none { color: var(--muted); font-weight: 400; }

/* Etapų laiko juosta */
.gantt { padding: 6px 18px 16px; }
.g-axis { position: relative; height: 22px; margin-left: 220px; border-bottom: 1px solid var(--line); }
.g-axis span { position: absolute; top: 2px; font-size: 11.5px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.g-row { display: flex; align-items: center; height: 34px; border-bottom: 1px dashed var(--line); }
.g-name { width: 220px; flex: none; padding-right: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; flex: 1; height: 100%; }
.g-bar { position: absolute; top: 9px; height: 16px; border-radius: 8px; background: var(--accent); opacity: .85; }
.g-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--red); }

/* Šoninis langas formoms */
.drawer-bg { position: fixed; inset: 0; background: rgba(16, 23, 26, .38); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 21; box-shadow: var(--sh-3); display: flex; flex-direction: column; }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { flex: 1; font-size: 18px; }
.drawer-b { padding: 20px 22px; overflow: auto; flex: 1; }
.drawer-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.x { width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; }
.x:hover { background: var(--surface-3); color: var(--ink); }
.sect { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 6px 0 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--brand-graphite); color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--sh-3); z-index: 40; font-weight: 500; }
.toast.bad { background: var(--red); }

/* Telefonas: meniu viršuje */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 2px; }
  .side .side-logo { height: 20px; margin: 0 10px 0 4px; }
  .side .side-sub, .side-sep { display: none; }
  .nav { padding: 7px 9px; font-size: 13px; }
  .nav .soon, .nav.dis { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 10px; align-items: center; }
  .side-foot .who, .side-foot .role { display: none; }
  .main { padding: 18px 14px 40px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .tbl .hide-m { display: none; }
  .g-name { width: 120px; }
  .g-axis { margin-left: 120px; }
}
