/* QKUK Parking */

:root {
  --ink: #14273A;
  --ink-2: #4A5B6B;
  --paper: #EEF2F5;
  --panel: #FFFFFF;
  --line: #D3DBE3;
  --line-2: #B8C4CF;
  --blue: #164C8F;
  --blue-dark: #0F3866;
  --blue-soft: #E4EDF8;
  --green: #1E8C4E;
  --green-dark: #166A3B;
  --green-soft: #E3F3EA;
  --red: #C8272E;
  --red-dark: #9E1B21;
  --red-soft: #FBE7E8;
  --amber: #C77800;
  --amber-soft: #FFF2DC;
  --focus: #F5B400;

  --kat-1: #1F5FBF;
  --kat-2: #2F3E9E;
  --kat-3: #C8272E;
  --kat-4: #D9731A;
  --kat-5: #1E8C4E;
  --kat-6: #6B3FA0;
  --kat-7: #566573;

  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Segoe UI Mono", "Roboto Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--blue); }
h1, h2, h3, p { margin: 0; }
img, svg { vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Top bar ---------- */
.topbar { background: var(--blue-dark); color: #fff; }
.topbar-in {
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; min-height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.brand-p { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; background: #fff; color: var(--blue); }
.brand-p.big { width: 56px; height: 56px; border-radius: 12px; background: var(--blue); color: #fff; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px;
  color: #DCE7F5; text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active { background: #fff; color: var(--blue-dark); }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.who-t { text-align: right; line-height: 1.25; font-size: .9rem; white-space: nowrap; }
.who-t strong { display: block; }
.who-pika { display: inline-flex; align-items: center; gap: 4px; color: #BFD4EE; text-decoration: none; font-size: .85rem; }
.who-pika:hover { color: #fff; text-decoration: underline; }
.inline { display: inline; }

.subnav { background: #fff; border-bottom: 1px solid var(--line); }
.subnav-in { max-width: 1160px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; }
.subnav a { padding: 12px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a.active { color: var(--blue-dark); border-bottom-color: var(--blue); }

/* ---------- Layout ---------- */
.main { padding: 28px 0 60px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 720px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.h1-tight { font-size: 1.6rem; }
.h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.h2.mt { margin-top: 22px; }
.lead { color: var(--ink-2); margin-top: 6px; max-width: 60ch; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.mono { font-family: var(--mono); font-size: .95em; }
.table .mono { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.backlink { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; margin-bottom: 14px; padding: 6px 0; }
.backlink:hover { text-decoration: underline; }
.spacer { flex: 1; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols-2 > .card { margin-bottom: 20px; }
.cols-2-side { grid-template-columns: minmax(300px, 420px) 1fr; align-items: start; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border-radius: 9px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; cursor: pointer; text-decoration: none;
  color: var(--ink); background: #fff; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-danger-ghost { background: #fff; border-color: var(--line-2); color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); border-color: var(--red); }
.btn-secondary { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-2); background: #F7F9FB; }
.btn-ghost { background: transparent; border-color: transparent; color: inherit; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-ghost:hover { background: rgba(20,39,58,.06); }
.btn-lg { min-height: 54px; font-size: 1.05rem; padding: 12px 22px; }
.btn-xl { min-height: 66px; font-size: 1.25rem; padding: 14px 28px; border-radius: 12px; }
.btn-sm { min-height: 38px; font-size: .88rem; padding: 6px 12px; }
.btn-block { width: 100%; }
.btn-tile {
  width: 100%; justify-content: flex-start; min-height: 74px; margin-bottom: 12px; font-size: 1.2rem;
  background: #fff; border-color: var(--line-2); gap: 14px;
}
.btn-tile:hover { border-color: var(--blue); background: var(--blue-soft); }
.btn-tile.is-current { border-color: var(--green); background: var(--green-soft); }
.btn-tile small { margin-left: auto; color: var(--ink-2); font-weight: 500; font-size: .9rem; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.form-actions-final { margin-top: 26px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--line-2); border-radius: 9px; padding: 12px 14px; min-height: 52px;
}
.field input:focus, .field select:focus { border-color: var(--blue); outline: 3px solid var(--blue-soft); outline-offset: 0; }
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234A5B6B' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field-big > span { font-size: 1.15rem; }
.field-big input { min-height: 72px; font-size: 1.6rem; padding: 14px 18px; border-radius: 12px; }
.field-big .input-code { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.field-big .input-code::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font); color: #9AA7B3; }
.field.has-error input { border-color: var(--red); background: #FFF8F8; }
.hint { display: block; color: var(--ink-2); font-size: .9rem; margin-top: 6px; }
.field-inline { margin: 0; flex: 1; }
.form-card { padding: 26px; }
.searchbar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.searchbar input { min-height: 54px; }
.filter-card { margin-bottom: 22px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.filter-grid .field { margin-bottom: 4px; }
.filter-grid .field-wide { grid-column: 1 / -1; }
.filter-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid; margin-bottom: 18px; font-size: 1rem;
}
.alert .ico { flex: none; margin-top: 2px; }
.alert-success { background: var(--green-soft); border-color: #A9D8BC; color: var(--green-dark); }
.alert-error { background: var(--red-soft); border-color: #F0B2B5; color: var(--red-dark); }
.alert-info { background: var(--blue-soft); border-color: #B9CDEA; color: var(--blue-dark); }
.alert-list { margin: 6px 0 0; padding-left: 18px; }
.alert-flash { margin-bottom: 8px; }

/* ---------- Category grid (main screen) ---------- */
.today-pill {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 18px; color: var(--ink-2); font-size: .95rem; white-space: nowrap;
}
.today-pill strong { color: var(--ink); font-size: 1.15rem; }
.kat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kat-tile {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 190px;
  background: #fff; border: 2px solid var(--line); border-left: 10px solid var(--kat); border-radius: 12px;
  padding: 18px 18px 18px 20px; text-decoration: none; color: var(--ink);
  transition: transform .08s ease, border-color .12s ease, background-color .12s ease;
}
.kat-tile:hover, .kat-tile:focus-visible { border-color: var(--kat); background: color-mix(in srgb, var(--kat) 7%, #fff); transform: translateY(-2px); }
.kat-tile:active { transform: translateY(0); }
.kat-num {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--kat); color: #fff; font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}
.kat-ico { color: var(--kat); }
.kat-name { font-size: 1.3rem; font-weight: 700; line-height: 1.2; margin-top: auto; }
.kat-check { color: var(--ink-2); font-size: .9rem; }
.kat-1 { --kat: var(--kat-1); } .kat-2 { --kat: var(--kat-2); } .kat-3 { --kat: var(--kat-3); } .kat-4 { --kat: var(--kat-4); }
.kat-5 { --kat: var(--kat-5); } .kat-6 { --kat: var(--kat-6); } .kat-7 { --kat: var(--kat-7); }

/* Fallback per shfletues te vjeter pa color-mix */
@supports not (background: color-mix(in srgb, red 10%, white)) {
  .kat-tile:hover, .kat-tile:focus-visible { background: #F4F7FB; }
}

/* ---------- Category page head ---------- */
.kat-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--line); }
.kat-head-ico { display: inline-flex; width: 64px; height: 64px; border-radius: 14px; background: var(--kat); color: #fff; align-items: center; justify-content: center; flex: none; }
.kat-head-lbl { color: var(--ink-2); font-size: .9rem; font-weight: 600; }

/* ---------- Check / verdict ---------- */
.check-card { padding: 20px 24px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; align-items: baseline; }
.dl dt { color: var(--ink-2); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; }
.dd-big { font-size: 1.5rem; font-weight: 800; letter-spacing: .02em; }
.verdict { display: flex; gap: 18px; align-items: flex-start; padding: 22px 24px; border-radius: 12px; margin-bottom: 18px; border: 2px solid; }
.verdict-ico { flex: none; width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.verdict-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }
.verdict p { font-size: 1.05rem; }
.verdict-ok { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.verdict-ok .verdict-ico { background: var(--green); }
.verdict-no { background: var(--red-soft); border-color: var(--red); color: var(--red-dark); }
.verdict-no .verdict-ico { background: var(--red); }
.hist { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; margin-bottom: 8px; }
.hist summary { cursor: pointer; padding: 14px 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.hist table { margin-bottom: 14px; }

/* ---------- Ticket ---------- */
.ticket {
  position: relative; background: #fff; border: 1px solid var(--line-2); border-radius: 6px;
  max-width: 460px; margin: 0 auto 24px; padding: 22px 26px 18px; box-shadow: 0 8px 24px rgba(20,39,58,.08);
}
.ticket-top { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin: 0 -26px 18px; padding-left: 26px; padding-right: 26px; border-bottom: 2px dashed var(--line-2); }
.ticket-org { font-weight: 800; font-size: 1.15rem; line-height: 1.1; }
.ticket-kind { color: var(--ink-2); font-size: .9rem; }
.ticket-code {
  font-family: var(--mono); font-size: 2.9rem; font-weight: 700; letter-spacing: .08em; text-align: center;
  padding: 10px 0 6px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.ticket-void { position: absolute; top: 40%; left: 50%; transform: translate(-50%,-50%) rotate(-18deg); font-size: 3.2rem; font-weight: 900; color: var(--red); opacity: .55; letter-spacing: .1em; border: 5px solid var(--red); padding: 4px 18px; border-radius: 8px; pointer-events: none; }
.ticket.is-anuluar .ticket-code { color: var(--ink-2); text-decoration: line-through; }
.ticket-body { padding: 10px 0 14px; }
.ticket-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid #EDF1F4; }
.ticket-row:last-child { border-bottom: 0; }
.ticket-row span { color: var(--ink-2); }
.ticket-row strong { text-align: right; }
.ticket-foot { margin: 6px -26px 0; padding: 14px 26px 0; border-top: 2px dashed var(--line-2); text-align: center; color: var(--ink-2); font-size: .85rem; }
.cancel-box { max-width: 460px; margin: 10px auto 0; color: var(--ink-2); }
.cancel-box summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; font-weight: 600; }
.cancel-box form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 8px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--ink-2); font-weight: 600; font-size: .85rem; background: #F7F9FB; }
.table-rows tbody tr:hover { background: #F7F9FB; }
.table-sm th, .table-sm td { padding: 7px 8px; font-size: .9rem; }
.row-anuluar td { color: var(--ink-2); }
.row-anuluar .kat-badge { opacity: .55; }
.row-mine td:first-child { box-shadow: inset 4px 0 0 var(--blue); }
.kat-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: #fff; background: var(--kat); white-space: nowrap; }
.status { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: .82rem; font-weight: 700; }
.status-aktive { background: var(--green-soft); color: var(--green-dark); }
.status-anuluar { background: var(--red-soft); color: var(--red-dark); }
.status-admin { background: var(--blue-soft); color: var(--blue-dark); }
.chip { display: inline-block; background: #F1F4F7; border-radius: 6px; padding: 2px 8px; margin: 2px 0; font-size: .82rem; }
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 16px; }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-2); background: #fff; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty p { margin: 12px 0 20px; font-size: 1.05rem; }

/* ---------- Stats & bars (admin) ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat-n { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.stat-l { color: var(--ink-2); margin-top: 6px; font-size: .92rem; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; padding: 7px 0; }
.bar-lbl { font-weight: 600; text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-lbl:hover { text-decoration: underline; }
.bar { height: 22px; background: #EEF2F5; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 6px; min-width: 2px; }
.bar-n { text-align: right; font-weight: 700; }
.kat-bg-1 { background: var(--kat-1); } .kat-bg-2 { background: var(--kat-2); } .kat-bg-3 { background: var(--kat-3); } .kat-bg-4 { background: var(--kat-4); }
.kat-bg-5 { background: var(--kat-5); } .kat-bg-6 { background: var(--kat-6); } .kat-bg-7 { background: var(--kat-7); }
.report-title { margin: 6px 0 16px; }

/* ---------- Login ---------- */
.login-body { background: var(--blue-dark); background-image: linear-gradient(160deg, #0F3866 0%, #164C8F 100%); }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 16px; }
.login-card { background: #fff; border-radius: 16px; padding: 34px 34px 28px; width: 100%; max-width: 460px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.install-card { max-width: 560px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-title { font-size: 1.55rem; font-weight: 800; line-height: 1.15; }
.login-sub { color: var(--ink-2); }
.login-foot { color: #BFD4EE; margin-top: 22px; font-size: .9rem; }
.pika-list { margin-top: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .kat-grid { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols-2, .cols-2-side { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  html { font-size: 17px; }
  .topbar-in { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav { order: 3; width: 100%; margin: 0; }
  .nav a { flex: 1; justify-content: center; padding: 10px 6px; font-size: .85rem; white-space: nowrap; }
  .nav a svg { display: none; }
  .who { margin-left: auto; }
  .who-t { display: none; }
  .kat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kat-tile { min-height: 150px; padding: 14px 14px 14px 16px; }
  .kat-name { font-size: 1.1rem; }
  .row-2 { grid-template-columns: 1fr; }
  .stats, .stats-3 { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 40px; }
  .btn-xl { width: 100%; }
  .form-actions .btn { flex: 1 1 auto; }
  .page-head .btn { width: 100%; }
}
@media (max-width: 460px) {
  .kat-grid { grid-template-columns: 1fr; }
  .kat-tile { min-height: 110px; flex-direction: row; align-items: center; padding-right: 60px; }
  .kat-ico svg { width: 34px; height: 34px; }
  .kat-name { margin-top: 0; }
  .kat-check { display: none; }
}

/* ---------- Print ---------- */
@media print {
  @page { margin: 8mm; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .topbar, .subnav, .no-print, .backlink, .cancel-box, .alert-flash { display: none !important; }
  .main { padding: 0; }
  .wrap { padding: 0; max-width: none; }
  .ticket { box-shadow: none; border: 1px solid #000; max-width: 80mm; margin: 0; padding: 14px 16px 12px; }
  .ticket-top, .ticket-foot { border-color: #000; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .ticket-code { font-size: 26pt; color: #000; }
  .ticket-row { border-bottom-color: #ccc; }
  .ticket-row span, .ticket-kind, .ticket-foot { color: #333; }
  .card { border: 1px solid #999; break-inside: avoid; }
  .stats { display: flex; }
  .stat { border: 1px solid #999; flex: 1; }
  .table th { background: #eee; color: #000; }
  a { color: #000; text-decoration: none; }
  .kat-badge { border: 1px solid #000; color: #000 !important; background: none !important; }
}
