/* =====================================================================
   Logjistika — stil
   Mjet i brendshëm pune: dendësi e lartë informacioni, zero dekor.
   Elementi kryesor është zinxhiri i statusit: në çdo rresht sheh
   menjëherë sa larg ka shkuar ngarkesa.
   ===================================================================== */

:root {
  --ink:      #17222e;
  --ink-2:    #3d4c5c;
  --muted:    #6b7a89;
  --paper:    #e9ecef;
  --surface:  #ffffff;
  --line:     #ccd3da;
  --line-2:   #e3e8ec;

  --signal:   #b4690e;   /* kërkon veprim */
  --signal-bg:#fdf3e3;
  --blue:     #1f5c9e;
  --blue-bg:  #e8f0f9;
  --indigo:   #4b4fa8;
  --purple:   #7a4a9e;
  --green:    #17703f;
  --green-bg: #e6f3ec;
  --red:      #a52a2a;
  --red-bg:   #fbecec;

  --r: 3px;
  --shadow: 0 1px 2px rgba(23,34,46,.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}

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

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 21px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

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

.anesor {
  width: 216px; flex: 0 0 216px;
  background: var(--ink); color: #c6d0da;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.marka { padding: 18px 18px 14px; border-bottom: 1px solid #2a3947; }
.marka b { display: block; color: #fff; font-size: 15px; letter-spacing: .01em; }
.marka span { display: block; font-size: 11.5px; color: #8899a8; margin-top: 2px; }

.menu { padding: 10px 0; flex: 1; overflow-y: auto; }
.menu a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 18px; color: #c6d0da; font-size: 13.5px; border-left: 3px solid transparent;
}
.menu a:hover { background: #1f2d3b; color: #fff; text-decoration: none; }
.menu a.aktiv { background: #1f2d3b; color: #fff; border-left-color: var(--signal); font-weight: 600; }
.menu .ndarje {
  padding: 14px 18px 5px; font-size: 11px; color: #6d7f90;
  letter-spacing: .04em; font-weight: 600;
}
.menu .num {
  background: var(--signal); color: #fff; border-radius: 9px;
  padding: 0 6px; font-size: 11px; font-weight: 700; min-width: 18px; text-align: center;
}

.llogaria { padding: 12px 18px; border-top: 1px solid #2a3947; font-size: 12.5px; }
.llogaria b { color: #fff; display: block; }
.llogaria span { color: #8899a8; }
.llogaria a { color: #8899a8; font-size: 12px; }

.perm { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.kreu {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.kreu p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.veprimet { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Kutitë ---------- */
.kuti {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 16px;
}
.kuti > h2, .kuti > .kuti-kreu {
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.kuti-trup { padding: 14px; }

/* ---------- Tabelat ---------- */
table.t { width: 100%; border-collapse: collapse; }
table.t th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover { background: #f7f9fa; }
.num-cel { text-align: right; white-space: nowrap; }
.tabela-scroll { overflow-x: auto; }

.kodi { font-weight: 650; color: var(--ink); white-space: nowrap; }
.nen { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }

/* ---------- Etiketat e statusit ---------- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 11px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.b-pa_order, .b-e_re      { background: var(--signal-bg); color: var(--signal); border-color: #eccfa0; }
.b-me_order               { background: #eef1f4; color: var(--ink-2); border-color: var(--line); }
.b-planifikuar, .b-ne_proces { background: var(--blue-bg); color: var(--blue); border-color: #bed4ea; }
.b-ngarkuar               { background: #ecedf8; color: var(--indigo); border-color: #c9cbec; }
.b-ne_rruge               { background: var(--blue-bg); color: var(--blue); border-color: #bed4ea; }
.b-ne_dogane              { background: #f3ecf8; color: var(--purple); border-color: #ddcbec; }
.b-dorezuar, .b-e_perfunduar { background: var(--green-bg); color: var(--green); border-color: #b9dcc8; }
.b-anuluar, .b-e_anuluar  { background: var(--red-bg); color: var(--red); border-color: #eac6c6; }

/* ---------- Zinxhiri i statusit (elementi kryesor) ---------- */
.zinxhir { display: flex; align-items: center; gap: 0; margin: 2px 0; }
.zinxhir .hap {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.zinxhir .pika {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface); flex: 0 0 auto;
  position: relative;
}
.zinxhir .hap.done .pika { border-color: var(--green); background: var(--green); }
.zinxhir .hap.done .pika::after {
  content: ""; position: absolute; left: 2.5px; top: .5px;
  width: 3px; height: 6px; border: solid #fff; border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}
.zinxhir .hap.done { color: var(--green); font-weight: 600; }
.zinxhir .hap.tani .pika { border-color: var(--signal); background: var(--signal-bg); }
.zinxhir .hap.tani { color: var(--signal); font-weight: 600; }
.zinxhir .lidhje { height: 2px; width: 22px; background: var(--line); flex: 0 0 auto; }
.zinxhir .lidhje.done { background: var(--green); }
.zinxhir.kompakt .hap span { display: none; }
.zinxhir.kompakt .lidhje { width: 16px; }

/* ---------- Butonat ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 550;
  cursor: pointer; font-family: inherit; line-height: 1.3;
}
.btn:hover { background: #f2f5f7; text-decoration: none; }
.btn.kryesor { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.kryesor:hover { background: #23313f; }
.btn.sinjal { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.sinjal:hover { background: #9c5a0b; }
.btn.vogel { padding: 4px 9px; font-size: 12px; }
.btn.rrezik { color: var(--red); border-color: #e3bcbc; }
.btn.rrezik:hover { background: var(--red-bg); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Formularët ---------- */
.rresht { display: flex; gap: 14px; flex-wrap: wrap; }
.fusha { margin-bottom: 13px; flex: 1 1 200px; min-width: 0; }
.fusha.gjere { flex-basis: 100%; }
.fusha label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.fusha .ndihme { font-size: 12px; color: var(--muted); margin-top: 4px; }

input[type=text], input[type=date], input[type=number], input[type=password],
input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 7px 9px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
}
textarea { min-height: 68px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(31,92,158,.13); }
input[readonly] { background: #f3f5f7; color: var(--muted); }

.filtra { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filtra .fusha { margin-bottom: 0; flex: 0 1 170px; }

/* ---------- Njoftimet ---------- */
.njoftim {
  padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px;
  border: 1px solid; font-size: 13.5px;
}
.njoftim.ok    { background: var(--green-bg); border-color: #b9dcc8; color: var(--green); }
.njoftim.gabim { background: var(--red-bg); border-color: #eac6c6; color: var(--red); }
.njoftim.info  { background: var(--blue-bg); border-color: #bed4ea; color: var(--blue); }

.bosh { padding: 44px 20px; text-align: center; color: var(--muted); }
.bosh h2 { color: var(--ink); margin-bottom: 6px; }
.bosh p { margin: 0 auto; max-width: 46ch; }

/* ---------- Treguesit ---------- */
.tregues { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tregues .kart {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.tregues .kart b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.tregues .kart span { color: var(--muted); font-size: 12.5px; }
.tregues .kart.alarm { border-left: 3px solid var(--signal); }
.tregues .kart.alarm b { color: var(--signal); }

/* ---------- Plani javor ---------- */
.java-kreu {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.java-kreu .titull { font-size: 15px; font-weight: 650; }
.java-kreu .titull span { color: var(--muted); font-weight: 400; }

.plani { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 8px; }
.dita {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  min-height: 130px; display: flex; flex-direction: column;
}
.dita > header {
  padding: 7px 9px; border-bottom: 1px solid var(--line-2);
  font-size: 12px; font-weight: 600; display: flex; justify-content: space-between;
}
.dita > header em { font-style: normal; color: var(--muted); font-weight: 400; }
.dita.sot { border-color: var(--signal); }
.dita.sot > header { background: var(--signal-bg); color: var(--signal); }
.dita .brenda { padding: 7px; display: flex; flex-direction: column; gap: 6px; }

.ngarkese {
  display: block; border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: var(--r); padding: 6px 8px; font-size: 12px; color: var(--ink);
  background: #fbfcfd;
}
.ngarkese:hover { background: #f2f6fa; text-decoration: none; }
.ngarkese b { display: block; font-size: 12px; }
.ngarkese em { font-style: normal; display: block; color: var(--muted); font-size: 11.5px; }
.ngarkese.vecante { border-left-color: var(--purple); }
.ngarkese.dorezuar { border-left-color: var(--green); opacity: .72; }
.ngarkese.vonuar { border-left-color: var(--red); }

/* ---------- Historiku ---------- */
.historia { list-style: none; margin: 0; padding: 0; }
.historia li {
  padding: 9px 0 9px 16px; border-bottom: 1px solid var(--line-2);
  position: relative; font-size: 13px;
}
.historia li::before {
  content: ""; position: absolute; left: 0; top: 15px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--line);
}
.historia li.krijim::before { background: var(--green); }
.historia li.checkpoint::before { background: var(--blue); }
.historia li:last-child { border-bottom: 0; }
.historia .kur { color: var(--muted); font-size: 12px; }
.historia .vjeter { text-decoration: line-through; color: var(--muted); }
.historia .re { font-weight: 600; }

/* ---------- Hyrja ---------- */
.hyrje {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--ink); padding: 20px;
}
.hyrje .kuti { width: 100%; max-width: 350px; margin: 0; }
.hyrje .kuti-trup { padding: 26px; }
.hyrje h1 { font-size: 19px; margin-bottom: 3px; }
.hyrje p.sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

/* ---------- Të vogla ---------- */
.vonuar { color: var(--red); font-weight: 600; }
.afer { color: var(--signal); font-weight: 600; }
.muted { color: var(--muted); }
.dysh { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
dl.info { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; font-weight: 550; }

@media (max-width: 1100px) { .plani { grid-template-columns: repeat(2, 1fr); } .dysh { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .anesor { width: 100%; flex: none; height: auto; position: static; }
  .menu { display: flex; flex-wrap: wrap; padding: 6px; }
  .menu a { border-left: 0; border-bottom: 3px solid transparent; padding: 7px 12px; }
  .menu a.aktiv { border-left: 0; border-bottom-color: var(--signal); }
  .menu .ndarje { display: none; }
  .perm { padding: 16px 14px 50px; }
  .plani { grid-template-columns: 1fr; }
}

@media print {
  .anesor, .veprimet, .filtra, .btn { display: none !important; }
  body { background: #fff; }
  .kuti { box-shadow: none; }
}

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