/* ===== Shkronjat ===== */
@font-face { font-family: 'Plex'; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex'; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex'; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex'; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plex'; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plex'; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plex Mono'; font-weight: 400; font-display: swap; src: url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 500; font-display: swap; src: url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }

/* ===== Ngjyrat: betoni, letra, bojë panel elektrik, e verdha e sinjalizimit ===== */
:root {
  --bg: #e9e8e3;
  --paper: #fbfbf8;
  --paper-2: #f3f2ed;
  --ink: #1d2328;
  --steel: #5b6770;
  --line: #d6d4cb;
  --line-soft: #e5e3db;
  --panel: #0f5c4d;
  --panel-hover: #0b4a3e;
  --panel-soft: #dcebe5;
  --signal: #f4c20d;
  --signal-ink: #3b2f00;
  --danger: #b3261e;
  --danger-soft: #f7dedb;
  --ok: #2e7d4f;
  --ok-soft: #dcefe3;
  --warn: #a15c00;
  --warn-soft: #f7e8cf;
  --focus: #1b6ef3;
  --st-new: #66758a;
  --st-scheduled: #2b67d6;
  --st-dispatched: #7550c9;
  --st-in_progress: #d0690a;
  --st-on_hold: #8c7a3d;
  --st-completed: #2e7d4f;
  --st-invoiced: #1d2328;
  --st-cancelled: #a0a0a0;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;
  --rail: 228px;
  --font: 'Plex', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121618;
    --paper: #1a1f22;
    --paper-2: #21272b;
    --ink: #e9e7e0;
    --steel: #9aa6ae;
    --line: #2f383e;
    --line-soft: #262e33;
    --panel: #39a58b;
    --panel-hover: #4bb89d;
    --panel-soft: #1c3a33;
    --signal-ink: #3b2f00;
    --danger: #ef7a72;
    --danger-soft: #3a2220;
    --ok: #5cc287;
    --ok-soft: #1d3326;
    --warn: #e0a24a;
    --warn-soft: #382c16;
    --focus: #6aa0ff;
    --st-new: #8a99ad;
    --st-scheduled: #6d9cf0;
    --st-dispatched: #a58be8;
    --st-in_progress: #f09a4a;
    --st-on_hold: #c2ae6a;
    --st-completed: #5cc287;
    --st-invoiced: #e9e7e0;
    --st-cancelled: #7a7a7a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
a { color: var(--panel); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.mono { font-family: var(--mono); font-feature-settings: 'zero' 1; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--steel); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== Skeleti ===== */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: #14201d; color: #d9e3df; padding: 16px 12px; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand b { font-size: 15px; font-weight: 600; line-height: 1.15; display: block; }
.brand small { display: block; font-size: 12px; color: #93a8a1; font-weight: 400; }
.nav-group { margin: 14px 8px 4px; font-size: 12px; color: #7f948d; font-weight: 500; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md);
  color: #cfdcd7; font-weight: 500; font-size: 14px; position: relative;
}
.nav a:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, 0.11); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 4px; background: var(--signal); border-radius: 0 3px 3px 0; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.nav .count { margin-left: auto; background: var(--signal); color: var(--signal-ink); font-size: 12px; font-weight: 600; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.rail-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; }
.rail-foot .who { color: #fff; font-weight: 500; }
.rail-foot button { background: none; border: 0; color: #93a8a1; padding: 4px 0; cursor: pointer; font-size: 13px; }
.rail-foot button:hover { color: #fff; text-decoration: underline; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--paper);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper-2); }
.search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--steel); }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); overflow: hidden; z-index: 30;
}
.search-results a { display: flex; gap: 10px; padding: 9px 12px; color: var(--ink); border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.search-results a:last-child { border: 0; }
.search-results a:hover, .search-results a:focus { background: var(--paper-2); text-decoration: none; }
.search-results .kind { color: var(--steel); font-size: 12px; min-width: 70px; }
.top .spacer { flex: 1; }
.page { padding: 24px; max-width: 1360px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--steel); font-size: 14px; margin-top: 2px; }
.crumbs { font-size: 13px; color: var(--steel); margin-bottom: 4px; }
.crumbs a { color: var(--steel); }

.tabbar { display: none; }

/* ===== Paneli ===== */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { flex: 1; font-size: 15px; }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }
.cols { display: grid; gap: 16px; }
.cols.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* ===== Butonat ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 500; cursor: pointer; line-height: 1.2;
  min-height: 38px; white-space: nowrap;
}
.btn:hover { background: var(--paper-2); text-decoration: none; }
.btn.primary { background: var(--panel); border-color: var(--panel); color: #fff; }
.btn.primary:hover { background: var(--panel-hover); }
.btn.signal { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.lg { padding: 14px 20px; min-height: 52px; font-size: 16px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: var(--r-sm); cursor: pointer; color: var(--steel); display: inline-flex; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ===== Formularët ===== */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--steel); }
.field label .req { color: var(--danger); }
.field input, .field select, .field textarea, .inp {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); min-height: 38px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 30%, transparent); outline-offset: 0; }
.field .hint { font-size: 12px; color: var(--steel); margin-top: 3px; }
.field.check label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; margin: 0; min-height: 38px; }
.field.check input { width: 18px; height: 18px; min-height: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .inp { width: auto; min-width: 140px; }
.filters .inp.grow { flex: 1; min-width: 200px; }
.error-text { color: var(--danger); font-size: 14px; margin-top: 8px; }

/* ===== Etiketat e statusit: shirit i hollë me spinë ngjyrë ===== */
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 2px 9px 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--steel)) 13%, var(--paper)); color: var(--c, var(--steel)); white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--c, var(--steel)) 28%, transparent);
}
.tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--steel)); }
.tag.st-new { --c: var(--st-new); } .tag.st-scheduled { --c: var(--st-scheduled); } .tag.st-dispatched { --c: var(--st-dispatched); }
.tag.st-in_progress { --c: var(--st-in_progress); } .tag.st-on_hold { --c: var(--st-on_hold); } .tag.st-completed { --c: var(--st-completed); }
.tag.st-invoiced { --c: var(--st-invoiced); } .tag.st-cancelled { --c: var(--st-cancelled); }
.tag.st-draft { --c: var(--st-new); } .tag.st-sent { --c: var(--st-scheduled); } .tag.st-paid { --c: var(--st-completed); }
.tag.st-partial { --c: var(--warn); } .tag.st-overdue { --c: var(--danger); } .tag.st-approved { --c: var(--st-completed); }
.tag.st-rejected { --c: var(--danger); } .tag.st-converted { --c: var(--st-dispatched); } .tag.st-active { --c: var(--st-completed); }
.tag.st-expired { --c: var(--st-cancelled); } .tag.st-inactive { --c: var(--st-cancelled); } .tag.st-retired { --c: var(--st-cancelled); }
.prio { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 4px; }
.prio.urgent { background: var(--signal); color: var(--signal-ink); }
.prio.high { background: var(--warn-soft); color: var(--warn); }
.prio.low { color: var(--steel); background: var(--paper-2); }

/* ===== Kartat e punës: spinë ngjyrë sipas statusit ===== */
.jobs { display: grid; gap: 8px; }
.job {
  display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; color: inherit; cursor: pointer;
}
.job:hover { border-color: var(--steel); text-decoration: none; }
.job .spine { background: var(--c, var(--st-new)); }
.job.st-new { --c: var(--st-new); } .job.st-scheduled { --c: var(--st-scheduled); } .job.st-dispatched { --c: var(--st-dispatched); }
.job.st-in_progress { --c: var(--st-in_progress); } .job.st-on_hold { --c: var(--st-on_hold); } .job.st-completed { --c: var(--st-completed); }
.job.st-invoiced { --c: var(--st-invoiced); } .job.st-cancelled { --c: var(--st-cancelled); }
.job.is-urgent { box-shadow: inset 0 0 0 1px var(--signal); }
.job-body { padding: 10px 14px; min-width: 0; }
.job-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--steel); }
.job-title { font-weight: 500; margin: 2px 0; overflow-wrap: anywhere; }
.job-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--steel); }
.job-side { padding: 10px 14px; text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; justify-content: center; font-size: 13px; color: var(--steel); }
.avatar { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; background: var(--panel); flex: none; }

/* ===== Tabelat ===== */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 13px; color: var(--steel); padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); 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(--paper-2); }
.tbl .num, .tbl th.num { text-align: right; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: var(--paper-2); }
.tbl input.inp { min-height: 32px; padding: 4px 8px; }
.empty { padding: 36px 20px; text-align: center; color: var(--steel); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 10px 14px; font-size: 13px; color: var(--steel); }

/* ===== Treguesit (dashboard) ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px 12px 16px; position: relative; overflow: hidden; color: inherit; display: block; }
a.stat:hover { border-color: var(--steel); text-decoration: none; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--line)); }
.stat .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .l { font-size: 13px; color: var(--steel); }
.stat.alert { --c: var(--signal); }
.stat.bad { --c: var(--danger); }
.stat.good { --c: var(--ok); }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 12px; background: var(--paper-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--line-soft); }
.bar-row .fill { height: 100%; background: var(--panel); }
.bar-row .fill.hot { background: var(--st-in_progress); }
.bar-row .fill.over { background: var(--danger); }
.cols-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 170px; padding-top: 8px; }
.cols-chart .c { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; gap: 2px; text-align: center; font-size: 11px; color: var(--steel); }
.cols-chart .pair { display: flex; gap: 2px; align-items: flex-end; flex: 1; }
.cols-chart .pair i { flex: 1; background: var(--line); border-radius: 2px 2px 0 0; min-height: 1px; }
.cols-chart .pair i.paid { background: var(--panel); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--steel); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; background: var(--line); }
.legend i.paid { background: var(--panel); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--steel); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--panel); border-bottom-color: var(--panel); }

/* ===== Detaje ===== */
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--steel); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.list-plain li:last-child { border: 0; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.checklist input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--panel); flex: none; }
.checklist .done span { text-decoration: line-through; color: var(--steel); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 14px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: -21px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); border: 2px solid var(--steel); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumbs a { display: block; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 1; background: var(--paper-2); font-size: 12px; color: var(--steel); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .file { padding: 8px; overflow-wrap: anywhere; display: flex; align-items: center; justify-content: center; height: 100%; text-align: center; }
.sig-box { border: 1px dashed var(--steel); border-radius: var(--r-md); background: #fff; touch-action: none; width: 100%; height: 170px; display: block; }
.notice { padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-size: 14px; border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.notice.bad { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.timer { font-family: var(--mono); font-size: 26px; font-weight: 500; }

/* ===== Dispatch ===== */
.board-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.pool { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow-y: auto; }
.pool .job { grid-template-columns: 4px minmax(0, 1fr); }
.pool .job-side { display: none; }
.board { overflow-x: auto; }
.board table { border-collapse: separate; border-spacing: 0; min-width: 760px; width: 100%; table-layout: fixed; }
.board th { background: var(--paper-2); font-size: 13px; font-weight: 500; padding: 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); text-align: left; }
.board th.today { box-shadow: inset 0 -3px 0 var(--signal); color: var(--ink); }
.board th.tech { width: 140px; }
.board td { vertical-align: top; padding: 5px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); height: 96px; min-width: 0; }
.board td.tech { background: var(--paper-2); font-weight: 500; font-size: 14px; }
.board td.drop-over { background: var(--panel-soft); }
.chip {
  display: block; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--st-new)); border-radius: 4px; background: var(--paper);
  padding: 4px 6px; margin-bottom: 4px; font-size: 12.5px; cursor: grab; color: var(--ink); line-height: 1.3;
}
.chip:hover { text-decoration: none; border-color: var(--steel); border-left-color: var(--c); }
.chip.st-new { --c: var(--st-new); } .chip.st-scheduled { --c: var(--st-scheduled); } .chip.st-dispatched { --c: var(--st-dispatched); }
.chip.st-in_progress { --c: var(--st-in_progress); } .chip.st-on_hold { --c: var(--st-on_hold); } .chip.st-completed { --c: var(--st-completed); }
.chip.st-invoiced { --c: var(--st-invoiced); } .chip.st-cancelled { --c: var(--st-cancelled); }
.chip.is-urgent { background: color-mix(in srgb, var(--signal) 22%, var(--paper)); }
.chip.dragging { opacity: 0.4; }
.chip b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { color: var(--steel); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Modal, toast ===== */
.modal-back { position: fixed; inset: 0; background: rgba(10, 16, 14, 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; z-index: 100; }
.modal { background: var(--paper); border-radius: var(--r-lg); width: 100%; max-width: 640px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); gap: 10px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--paper-2); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.toast.err { background: var(--danger); color: #fff; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--panel); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Hyrja ===== */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art { background: #14201d; color: #d9e3df; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .tagline { font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; color: #fff; max-width: 14em; }
.login-art .tagline em { font-style: normal; color: var(--signal); }
.login-art ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; color: #a9bcb5; max-width: 28em; }
.login-art li { display: flex; gap: 10px; }
.login-art li::before { content: ''; width: 5px; flex: none; background: var(--signal); border-radius: 2px; margin-top: 4px; height: 14px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--paper); }
.login-form form { width: 100%; max-width: 360px; display: grid; gap: 14px; }

/* ===== Dokumentet për printim ===== */
.doc { background: #fff; color: #111; border: 1px solid var(--line); border-radius: var(--r-md); padding: 36px 40px; max-width: 820px; margin: 0 auto; font-size: 14px; }
.doc h1 { font-size: 24px; margin-bottom: 2px; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 18px; }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.doc th { text-align: left; font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid #111; color: #333; }
.doc td { padding: 7px 8px; border-bottom: 1px solid #ddd; vertical-align: top; }
.doc .totals { margin-left: auto; width: 280px; }
.doc .totals td { border: 0; padding: 3px 8px; }
.doc .totals tr.grand td { border-top: 2px solid #111; font-weight: 700; font-size: 16px; }
.doc .muted { color: #555; }
.doc-actions { max-width: 820px; margin: 0 auto 12px; display: flex; gap: 8px; flex-wrap: wrap; }

@media print {
  body { background: #fff; }
  .rail, .top, .tabbar, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  .page { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; }
}

/* ===== Përshtatje për ekrane të vogla ===== */
@media (max-width: 1100px) {
  .cols.main-side { grid-template-columns: minmax(0, 1fr); }
  .cols.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-wrap { grid-template-columns: minmax(0, 1fr); }
  .pool { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .top { padding: 8px 12px; }
  .page { padding: 14px 12px 88px; }
  .cols.two, .cols.three { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .bar-row { grid-template-columns: 100px minmax(0, 1fr) 56px; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 94vh; overflow-y: auto; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11.5px; color: var(--steel); font-weight: 500; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--panel); }
  .tabbar a.active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; background: var(--signal); border-radius: 0 0 3px 3px; }
  .toasts { bottom: 76px; }
  .job { grid-template-columns: 5px minmax(0, 1fr); }
  .job-side { display: none; }
  .hide-sm { display: none !important; }
  h1 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* ===== Shtesa ===== */
.p-body { padding: 14px 16px; }
.neg { color: var(--danger); font-weight: 600; }
.totals-box { margin-left: auto; width: min(320px, 100%); display: grid; gap: 4px; padding: 8px 4px; }
.totals-box .grand { border-top: 2px solid var(--ink); padding-top: 6px; font-size: 16px; }
.tbl.lines td { padding: 4px 6px; }

/* ===== Gjuha ===== */
.lang-sel { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); cursor: pointer; }
.lang-corner { position: absolute; top: 16px; right: 16px; }
.login-form { position: relative; }
.lang-rail { margin: 6px 0 2px; background: rgba(255, 255, 255, 0.08); color: #d9e3df; border-color: rgba(255, 255, 255, 0.18); }
.lang-rail option { color: #111; }

/* ===== Veglat · Automjetet · Ekipi ===== */

.wh { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: var(--ink); color: #fff; flex: none; }
.wh svg { width: 13px; height: 13px; }
.chk { width: 34px; padding-right: 0 !important; }
.chk input { width: 17px; height: 17px; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag.st-c-good { --c: var(--ok); } .tag.st-c-worn { --c: var(--warn); } .tag.st-c-repair { --c: var(--danger); }
.tag.st-i-open { --c: var(--danger); } .tag.st-i-prog { --c: var(--st-in_progress); } .tag.st-i-service { --c: var(--st-dispatched); } .tag.st-i-done { --c: var(--ok); }

.kind-tag { display: inline-block; margin-top: 3px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2); color: var(--steel); }
.kind-tag.out { background: var(--panel-soft); border-color: transparent; color: var(--panel); }
.kind-tag.in { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.kind-tag.xfer { background: #e7e1f6; border-color: transparent; color: #55379b; }

.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--panel-soft); border-bottom: 1px solid var(--line); font-size: 14px; }
.bulk:empty { display: none; }
.count-pill { display: inline-block; min-width: 24px; padding: 0 8px; line-height: 22px; text-align: center; border-radius: 11px; background: var(--paper-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.count-pill.hot { background: var(--danger); border-color: var(--danger); color: #fff; }

/* gjurma e lëvizjeve */
.trail { list-style: none; margin: 0; padding: 0 0 0 4px; }
.trail li { position: relative; padding: 0 0 18px 24px; }
.trail li::before { content: ''; position: absolute; left: 5px; top: 7px; bottom: -7px; width: 2px; background: var(--line); }
.trail li:last-child::before { display: none; }
.trail li::after { content: ''; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--steel); }
.trail li.now::after { background: var(--signal); border-color: var(--ink); }

/* automjetet */
.due { font-size: 13px; white-space: nowrap; }
.due.ok { color: var(--ok); } .due.warn { color: var(--warn); font-weight: 600; } .due.bad { color: var(--danger); font-weight: 600; }
.issue-li, .hist-li { cursor: pointer; }
.issue-li:hover, .hist-li:hover { background: var(--paper-2); }
.issue-li > div + div, .hist-li > div + div { margin-top: 3px; }
.stat.bad .v { color: var(--danger); }

/* ekipi: tabela e pranisë */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 12px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.lg { font-style: normal; width: 22px; height: 22px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
table.att { border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.att th, table.att td { padding: 0; border-bottom: 1px solid var(--line-soft); text-align: center; }
table.att th { background: var(--paper-2); color: var(--steel); font-weight: 500; height: 30px; }
table.att .name { text-align: left; min-width: 128px; padding: 0 8px 0 12px; position: sticky; left: 0; background: var(--paper); z-index: 2; border-right: 1px solid var(--line); display: table-cell; }
table.att thead .name { background: var(--paper-2); }
table.att td.name { white-space: nowrap; }
table.att td.name .nm { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 34px; }
table.att td.name .rm { opacity: 0; }
table.att tr:hover td.name .rm, table.att td.name .rm:focus { opacity: 1; }
.rm { background: none; border: 0; padding: 2px; color: var(--steel); cursor: pointer; border-radius: 4px; }
.rm svg { width: 14px; height: 14px; }
.rm:hover { color: var(--danger); background: var(--danger-soft); }
table.att .ac { min-width: 22px; width: 22px; }
table.att .ac.we { background: var(--paper-2); }
table.att th.td, table.att td.td { box-shadow: inset 0 -3px 0 var(--signal); }
table.att td.sel, table.att th.sel { background: color-mix(in srgb, var(--focus) 12%, transparent); }
.dh { background: none; border: 0; width: 100%; height: 100%; min-height: 30px; font: inherit; color: inherit; cursor: pointer; }
.dh:hover { background: var(--panel-soft); }
table.att .sum { min-width: 28px; padding: 0 4px; font-variant-numeric: tabular-nums; border-left: 1px solid var(--line-soft); }
table.att .sum.pr { min-width: 50px; }
.ab { width: 100%; height: 34px; padding: 0; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--line); }
.ab:hover { background: color-mix(in srgb, var(--focus) 12%, transparent); }
.ab.a-ok:hover { color: var(--steel); }
.ab.a-leave, i.a-leave, .chip-s.a-leave { background: #dbe8fb; color: #1d4ed8; }
.ab.a-sick, i.a-sick, .chip-s.a-sick { background: #f9e0e0; color: #b3261e; }
.ab.a-excused, i.a-excused, .chip-s.a-excused { background: #fbeccb; color: #8a5300; }
.ab.a-unexcused, i.a-unexcused, .chip-s.a-unexcused { background: #b3261e; color: #fff; }
.who-here { line-height: 2; }
.chip-s { display: inline-block; font-size: 13px; padding: 1px 9px; margin: 0 4px 2px 0; border-radius: 12px; background: var(--ok-soft); color: var(--ok); }
.chip-s.away { font-weight: 500; }
.qty-pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 9px; border-radius: 11px; background: var(--signal); color: var(--signal-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.field { margin-bottom: 12px; }
textarea.inp { width: 100%; resize: vertical; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat .v { font-size: 22px; }
  table.att .name { min-width: 120px; }
  .filters .inp { min-width: 0; }
}
.cols > .panel { margin-top: 0 !important; }

.who-line { display: inline-flex; align-items: center; gap: 7px; }
.sign-row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 56px; }
.sign-line { border-bottom: 1px solid #111; height: 36px; margin-bottom: 4px; }

/* menuja më kompakte në ekrane të ulëta, që të hyjë tërë */
@media (min-width: 861px) and (max-height: 980px) {
  .nav a { padding-top: 6px; padding-bottom: 6px; }
  .nav-group { margin-top: 8px; }
  .rail { padding-top: 12px; }
  .brand { padding-bottom: 8px; }
}

/* ---- Rolet dhe lejet ---- */
.roles-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.role-list { padding: 6px; }
.role-list .list-plain li { padding: 0; border: 0; }
.role-item { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-left: 3px solid transparent; border-radius: 6px; padding: 9px 10px; cursor: pointer; color: var(--ink); font: inherit; }
.role-item small { color: var(--steel); }
.role-item:hover { background: var(--paper-2); }
.role-item.on { background: var(--paper-2); border-left-color: var(--panel); }
.role-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
.role-flags { display: grid; gap: 8px; margin: 14px 0 4px; }
.role-flag { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.role-flag input, .role-cap input { width: 17px; height: 17px; margin-top: 2px; flex: none; accent-color: var(--panel); }
.role-flag span { display: grid; gap: 1px; }
.role-flag small { color: var(--steel); }
.role-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-top: 18px; }
.role-group h3 { font-size: 14px; margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line-soft); }
.role-group h3 small { color: var(--steel); font-weight: 400; }
.role-cap { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; cursor: pointer; font-size: 14px; }
.role-cap input:disabled + span { color: var(--steel); }
@media (max-width: 860px) {
  .roles-layout { grid-template-columns: minmax(0, 1fr); }
  .role-head, .role-groups { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Njoftimet në telefon ---- */
.push-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.push-banner .grow { flex: 1 1 220px; }
.main > .push-banner { margin: 12px 20px 0; }
@media (max-width: 860px) { .main > .push-banner { margin: 10px 12px 0; } }

/* ===== Prezenca, objektet, kontrolli ditor, mesazhet (2.0.1) ===== */
.tag.st-ok { --c: var(--ok); } .tag.st-warn { --c: var(--warn); } .tag.st-bad { --c: var(--danger); }
.grp { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--paper); }
.grp .tbl-wrap { margin-top: 8px; border: 0; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 12px; margin: 10px 0; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); cursor: pointer; min-height: 48px; }
.pick:hover { border-color: var(--steel); }
.pick input { width: 20px; height: 20px; flex: none; }
.pick small { color: var(--steel); }
.pick.dis { opacity: .55; cursor: not-allowed; }
.flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.flags li { padding: 8px 12px; border-radius: var(--r-md); font-size: 14px; background: var(--warn-soft); color: var(--warn); }
.flags li.high { background: var(--danger-soft); color: var(--danger); }
.crew-card.lvl-high { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.crew-card.lvl-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.crew-card .panel-head h2 { font-size: 16px; }
.tbl.grid-h th, .tbl.grid-h td { padding: 6px 7px; font-size: 13px; white-space: nowrap; }
.msgs li { padding: 12px 16px; }
.msgs li.unread { background: var(--warn-soft); border-left: 3px solid var(--signal); }
@media (max-width: 760px) { .picks { grid-template-columns: 1fr; } }
