:root {
  --bg: #f6f7fb; --card: #fff; --line: #e4e8f1; --line-soft: #eef1f7; --text: #0b1230; --muted: #5b6480; --faint: #8b93ab;
  --brand: #3355ff; --brand-dark: #2440d6; --brand-soft: #eaeefe; --navy: #0b1030; --field: #f4f6fb;
  --ok: #0f8a55; --warn: #a86400; --bad: #cf3a36;
  --radius: 14px; --shadow: 0 1px 2px rgba(11, 18, 48, .04), 0 12px 32px -18px rgba(11, 18, 48, .18);
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; font: 14px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -.01em; color: var(--text); background: var(--bg); min-height: 100vh; position: relative; }
body::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(620px 360px at 8% 18%, rgba(51, 85, 255, .16), transparent 70%), radial-gradient(520px 300px at 92% 0%, rgba(51, 85, 255, .07), transparent 70%); }
a { color: var(--brand); text-decoration: none; font-weight: 500; }
a:hover { color: var(--brand-dark); }
code { background: var(--brand-soft); color: #23308f; padding: 2px 6px; border-radius: 6px; font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.03em; margin: 6px 0 10px; }
h1 em, .login h1 span { font-style: normal; color: var(--muted); font-weight: 500; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin: 26px 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.r { text-align: right; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Koka */
.top { display: flex; align-items: center; gap: 22px; padding: 0 28px; height: 64px; background: rgba(255, 255, 255, .82); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--brand); white-space: nowrap; }
.brand:hover { color: var(--brand); }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px -6px rgba(51, 85, 255, .7); }
.logo .ico { width: 17px; height: 17px; stroke-width: 2; }
.top nav { display: flex; gap: 2px; flex: 1; align-self: stretch; }
.top nav a { display: flex; align-items: center; gap: 7px; padding: 0 11px; color: var(--text); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.top nav a .ico { color: var(--faint); width: 17px; height: 17px; }
.top nav a:hover { color: var(--brand); }
.top nav a.on { color: var(--brand); border-color: var(--brand); }
.top nav a.on .ico, .top nav a:hover .ico { color: var(--brand); }
.pill { background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 600; line-height: 18px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.who .names { display: grid; line-height: 1.25; text-align: right; }
.who strong { color: var(--text); font-weight: 600; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.who a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); border: 1px solid var(--line); background: #fff; }
.who a:hover { color: var(--bad); border-color: #f1c9c7; }

main { max-width: 1440px; margin: 0 auto; padding: 30px 28px 80px; }
main > h1 + p.muted { font-size: 15.5px; max-width: 900px; margin-bottom: 22px; }
.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.bar h1 { margin: 0 auto 0 0; display: flex; align-items: center; gap: 10px; }
.search { display: flex; gap: 8px; align-items: center; }
.search input[type=search] { width: 280px; margin: 0; background: #fff; }

/* Kartat */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin: 16px 0; box-shadow: var(--shadow); }
.card > h3:first-child, .card h3:first-of-type { margin-top: 0; }
.card.login { width: 400px; max-width: 100%; margin: 0; display: grid; gap: 14px; padding: 32px; }
.login-wrap { min-height: calc(100vh - 110px); display: grid; place-items: center; align-content: center; gap: 22px; }
.login-wrap .brand { font-size: 21px; }
.login-wrap .logo { width: 38px; height: 38px; border-radius: 11px; }
.login-wrap .logo .ico { width: 21px; height: 21px; }
.card.login h1 { font-size: 24px; margin: 0; }
.card.login p { color: var(--muted); margin: -8px 0 4px; }
.card.login .btn { padding: 12px; }

/* Fushat */
label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 14px; }
label.inline, form.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0 10px 0 0; }
label.narrow { max-width: 240px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; border: 1px solid #dde2ee; border-radius: 10px; font: inherit; letter-spacing: inherit; color: var(--text); background: var(--field); transition: border-color .15s, box-shadow .15s, background .15s; }
select { appearance: none; padding-right: 34px; 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='%235b6480' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input::placeholder { color: var(--faint); }
input[type=checkbox] { display: inline; width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); background-color: #fff; box-shadow: 0 0 0 4px rgba(51, 85, 255, .14); }
input:disabled, select:disabled { background-color: #eef0f5; color: var(--muted); }
label.low input { border-color: #e8b455; background: #fff8e8; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g4 { grid-template-columns: repeat(4, 1fr); }

/* Butonat */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border: 1px solid #d9deea; border-radius: 10px; background: #fff; color: var(--text); font: inherit; font-weight: 500; letter-spacing: inherit; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--field); border-color: #c8cfdf; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 8px 18px -10px rgba(51, 85, 255, .8); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f1c9c7; }
.btn.danger:hover { background: #fdf0ef; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--field); }
.btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.armed { background: var(--bad); color: #fff; border-color: var(--bad); }

/* Njoftimet */
.note { padding: 12px 16px; border-radius: 12px; background: var(--brand-soft); border: 1px solid #d3dbfd; color: #1e2a78; margin: 0 0 16px; }
.note.ok { background: #e7f7ef; border-color: #bfe6d2; color: #0b5c39; }
.note.warn { background: #fff6e2; border-color: #f3dca6; color: #6f4500; }
.note.err { background: #fdeeed; border-color: #f4c9c6; color: #8f2320; }
.note code { background: rgba(255, 255, 255, .7); color: inherit; }

/* Skedat */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.tabs a span { background: #e9ecf4; color: var(--muted); border-radius: 10px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; margin-left: 4px; }
.tabs a.on span { background: var(--brand-soft); color: var(--brand); }

/* Tabelat */
table { border-collapse: collapse; width: 100%; }
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border-collapse: separate; border-spacing: 0; }
.card .list { box-shadow: none; }
.list th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 12px 16px; background: #fafbfe; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list th.r { text-align: right; }
.list td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.list td.r { font-variant-numeric: tabular-nums; }
.list tbody tr:last-child td { border-bottom: 0; }
.list:not(.plain) tbody tr { cursor: pointer; transition: background .12s; }
.list:not(.plain) tbody tr:hover { background: #f6f8ff; }
.list input { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 56px 0; }

/* Etiketat */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eceff6; color: #454d68; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.s-needs_review { background: #fff1d3; color: #8a5200; }
.s-approved { background: #dff5ea; color: #0b6a41; }
.s-exported { background: var(--brand-soft); color: #2440d6; }
.s-failed, .s-rejected { background: #fde4e2; color: #a12a26; }
.s-processing { background: #ece8ff; color: #4f39c2; }
.conf { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.conf.hi { background: #dff5ea; color: #0b6a41; }
.conf.mid { background: #fff1d3; color: #8a5200; }
.conf.lo { background: #fde4e2; color: #a12a26; }

/* Ngarkimi */
.drop { border: 1.5px dashed #c5cdea; border-radius: var(--radius); padding: 44px; text-align: center; cursor: pointer; display: grid; gap: 6px; justify-items: center; color: var(--muted); font-weight: 400; font-size: 14px; background: #fafbff; transition: border-color .15s, background .15s; }
.drop::before { content: ""; width: 46px; height: 46px; border-radius: 13px; margin-bottom: 6px; background: var(--brand-soft) center / 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233355ff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3'/%3E%3C/svg%3E"); }
.drop strong { color: var(--text); font-size: 16px; font-weight: 600; }
.drop:hover, .drop.over { border-color: var(--brand); background: #f3f6ff; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Kontrolli i faturës */
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.doc { position: sticky; top: 84px; height: calc(100vh - 104px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.doc iframe { width: 100%; height: 100%; border: 0; }
.imgwrap { height: 100%; overflow: auto; }
.imgwrap img { width: 100%; display: block; }
.data { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.data h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 0; }
.checks { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 5px; }
.checks li { padding: 7px 12px 7px 34px; border-radius: 9px; position: relative; font-weight: 500; font-size: 13px; }
.checks li::before { position: absolute; left: 12px; font-weight: 700; }
.checks li.ok { color: var(--ok); } .checks li.ok::before { content: "✓"; }
.checks li.bad { color: #a12a26; background: #fdeeed; } .checks li.bad::before { content: "✕"; }
.checks li.warn { color: #7a4a00; background: #fff6e2; } .checks li.warn::before { content: "!"; }
.checks small { display: block; font-weight: 400; color: var(--text); }

.scroll { overflow-x: auto; }
.edit th { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 0 4px 6px; font-weight: 600; white-space: nowrap; }
.edit td { padding: 3px; min-width: 78px; }
.edit td.w, .edit th.w { min-width: 200px; width: 40%; }
.edit td:last-child { min-width: 0; }
.edit input { margin: 0; padding: 7px 9px; border-radius: 8px; }
.x { border: 0; background: none; color: var(--faint); font-size: 18px; cursor: pointer; border-radius: 6px; width: 26px; height: 26px; }
.x:hover { color: var(--bad); background: #fdeeed; }

.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding: 16px 0 8px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }
.spacer { flex: 1; }

/* Numrat kryesorë */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 4px 0 12px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 1px; box-shadow: var(--shadow); }
.stats b { font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats span { font-weight: 600; margin-top: 6px; }
.stats small { color: var(--muted); font-size: 12.5px; }

@media (max-width: 1250px) {
  .top nav a span.t { display: none; }
  .top nav a { padding: 0 12px; }
}
@media (max-width: 1000px) {
  .review { grid-template-columns: 1fr; }
  .doc { position: static; height: 60vh; }
  .grid.g3, .grid.g4 { grid-template-columns: 1fr 1fr; }
  .top { overflow-x: auto; padding: 0 16px; }
  .who .names { display: none; }
  main { padding: 20px 16px 60px; }
  h1 { font-size: 25px; }
}
