:root {
  --bg: #f4f6f8; --card: #fff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --brand: #0f766e; --brand-2: #115e59; --good: #15803d; --bad: #b91c1c; --warn: #b45309;
  --radius: 14px; --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f14; --card: #151b23; --text: #e5e7eb; --muted: #9ca3af; --line: #263040;
          --brand: #14b8a6; --brand-2: #0d9488; --good: #4ade80; --bad: #f87171; --warn: #fbbf24; }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text);
       -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* Struktura */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
          padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: var(--brand); color: #fff; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 650; }
.topbar .icon-btn { background: transparent; border: 0; color: #fff; font-size: 22px; padding: 4px 8px; cursor: pointer; position: relative; }
.badge { position: absolute; top: -2px; right: -2px; background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px;
         min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 4px; }
main { max-width: 760px; margin: 0 auto; padding: 16px 12px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
nav.bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--card);
             border-top: 1px solid var(--line); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
             padding-bottom: env(safe-area-inset-bottom); }
nav.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
               color: var(--muted); text-decoration: none; font-size: 11.5px; }
nav.bottom a .i { font-size: 20px; }
nav.bottom a.active { color: var(--brand); font-weight: 600; }

/* Karta */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 15px; margin: 0 0 10px; }
.hero { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: 0; }
.hero .label { opacity: .85; font-size: 13px; }
.hero .big { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.card .grid2 { margin: 10px 0 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .val { font-size: 18px; font-weight: 650; }
.pos { color: var(--good); } .neg { color: var(--bad); } .muted { color: var(--muted); } .warn { color: var(--warn); }
.small { font-size: 12.5px; }

/* Lista */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { color: var(--muted); font-size: 12.5px; }
.list .amt { font-weight: 650; white-space: nowrap; }
.list li.click { cursor: pointer; }
.empty { color: var(--muted); text-align: center; padding: 18px 0; }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--text); }
.pill.good { background: rgba(21,128,61,.15); color: var(--good); }
.pill.bad { background: rgba(185,28,28,.15); color: var(--bad); }
.pill.warn { background: rgba(180,83,9,.15); color: var(--warn); }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: var(--brand); }

/* Butona */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
       border-radius: 10px; padding: 10px 14px; cursor: pointer; font-weight: 550; min-height: 42px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 13.5px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .btn { flex: 1; }
.seg { display: flex; background: var(--line); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 550; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Formularë */
label.f { display: block; margin-bottom: 12px; }
label.f span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
label.f input, label.f select, label.f textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
       background: var(--bg); font-size: 16px; }
label.check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
label.check input { width: 20px; height: 20px; }
.err { color: var(--bad); font-size: 13.5px; margin: 6px 0; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0;
         padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 18px; } }
.sheet h3 { margin: 0 0 14px; font-size: 17px; }
.req-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.req-card .row .btn { flex: 1; }

/* Hyrja */
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 16px; }
.login .logo { text-align: center; margin-bottom: 20px; }
.login .logo img { width: 64px; height: 64px; }
.login .logo h1 { margin: 8px 0 0; font-size: 22px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
         background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: 90vw; font-size: 14px; }
.toast.error { background: var(--bad); }
.code { font-family: ui-monospace, monospace; font-size: 22px; letter-spacing: 3px; text-align: center; padding: 10px;
        background: var(--bg); border-radius: 10px; margin: 8px 0; user-select: all; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td, table.simple th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }
