/* ============================================================
   KontaPro — Design System
   Premium, i pastër, Apple-style. Ngjyra të hapura, hapësirë e bardhë.
   ============================================================ */

:root {
  /* Paleta */
  --bg: #F5F6F8;
  --bg-soft: #FAFAFC;
  --card: #FFFFFF;
  --border: #E8E8ED;
  --border-soft: #F0F0F4;

  --primary: #0071E3;
  --primary-dark: #0060C0;
  --primary-soft: #EAF3FF;

  --success: #34C759;
  --success-soft: #EAF9EF;
  --warning: #FF9F0A;
  --warning-soft: #FFF4E2;
  --danger: #FF3B30;
  --danger-soft: #FFECEB;
  --violet: #AF52DE;
  --violet-soft: #F6EDFC;
  --teal: #30B0C7;
  --teal-soft: #E9F7FA;

  --text: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #AEAEB2;

  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.04);
  --shadow-lift: 0 2px 8px rgba(0,0,0,.06), 0 16px 40px rgba(0,0,0,.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --sidebar-w: 248px;
  --bottomnav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

::selection { background: var(--primary-soft); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 48px;
  margin-left: var(--sidebar-w);
}

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }

/* ---------- Sidebar (desktop) ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 22px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em;
}
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #0A84FF, #0055D4);
  display: grid; place-items: center; color: #fff; font-size: 17px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,113,227,.3);
}
.brand .brand-icon {
  width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: contain;
  box-shadow: 0 4px 12px rgba(20,71,181,.28);
}
.login-card .brand .brand-icon { width: 52px; height: 52px; }
.brand span em { font-style: normal; color: var(--primary); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a svg { width: 20px; height: 20px; flex: none; }

.sidebar-foot {
  border-top: 1px solid var(--border-soft); padding-top: 14px;
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #667EEA, #764BA2);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { font-size: 12px; color: var(--text-3); }
.sidebar-foot a { color: var(--text-3); display: grid; place-items: center; }
.sidebar-foot a:hover { color: var(--danger); }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottomnav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-soft);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-3); font-size: 10.5px; font-weight: 600;
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav a.active { color: var(--primary); }
.bottomnav a svg { width: 23px; height: 23px; }

/* ---------- Kartelat ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: 16px; font-weight: 650; letter-spacing: -0.01em;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 16px;
}
.card-title small { font-weight: 500; color: var(--text-3); font-size: 13px; }

/* ---------- Stat cards ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px;
}
.stat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.stat .ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
}
.stat .ico svg { width: 22px; height: 22px; }
.stat .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat .value {
  font-size: clamp(19px, 1.3vw + 9px, 27px);
  font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat .value.danger { color: var(--danger); }

.ico-blue    { background: var(--primary-soft); color: var(--primary); }
.ico-green   { background: var(--success-soft); color: var(--success); }
.ico-red     { background: var(--danger-soft); color: var(--danger); }
.ico-orange  { background: var(--warning-soft); color: var(--warning); }
.ico-violet  { background: var(--violet-soft); color: var(--violet); }
.ico-teal    { background: var(--teal-soft); color: var(--teal); }

/* ---------- Grid 2 kolona ---------- */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* ---------- Butonat ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: all .2s;
  text-decoration: none !important; white-space: nowrap;
  min-height: 42px;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(0,113,227,.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,113,227,.35); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: #DCEBFF; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-danger-soft:hover { background: #FFDDDB; }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 2px 8px rgba(52,199,89,.25); }
.btn-success:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-whatsapp { background: #E8F9EF; color: #1DA851; }
.btn-whatsapp:hover { background: #D4F3E1; }
.btn-sm { padding: 7px 13px; font-size: 13px; min-height: 34px; border-radius: 10px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: 14px; min-height: 50px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: #248A3D; }
.badge-warning { background: var(--warning-soft); color: #B25000; }
.badge-danger  { background: var(--danger-soft); color: #D70015; }
.badge-muted   { background: #F2F2F7; color: var(--text-2); }
.badge-info    { background: var(--primary-soft); color: var(--primary); }

/* ---------- Format ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 6px;
}
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 14.5px; color: var(--text);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
  min-height: 44px;
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,113,227,.12); }
.input::placeholder { color: var(--text-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ---------- Search ---------- */
.searchbar { position: relative; flex: 1; max-width: 420px; }
.searchbar svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--text-3); pointer-events: none;
}
.searchbar .input { padding-left: 42px; background: var(--card); }

/* ---------- Tabelat ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 12px; border-bottom: 1px solid var(--border-soft);
}
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--bg-soft); }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.table a.rowlink { color: var(--text); font-weight: 600; }
.table a.rowlink:hover { color: var(--primary); text-decoration: none; }

/* ---------- Grid-i vjetor i pagesave ---------- */
.months-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
}
.month-cell {
  border-radius: var(--radius-sm); padding: 13px 8px 11px;
  text-align: center; cursor: pointer; border: 1.5px solid transparent;
  transition: transform .15s, box-shadow .15s;
  user-select: none;
}
.month-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.month-cell .m { font-size: 13px; font-weight: 700; }
.month-cell .amt { font-size: 11.5px; margin-top: 3px; font-variant-numeric: tabular-nums; opacity: .85; }
.month-cell.paid    { background: var(--success-soft); color: #1E7A35; border-color: #C4EDD0; }
.month-cell.partial { background: var(--warning-soft); color: #9A4A00; border-color: #FFE3B8; }
.month-cell.unpaid  { background: var(--danger-soft); color: #C11227; border-color: #FFD4D1; }
.month-cell.future  { background: var(--bg-soft); color: var(--text-3); border-color: var(--border-soft); cursor: default; }
.month-cell.future:hover { transform: none; box-shadow: none; }

.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend .l-paid i { background: var(--success); }
.legend .l-partial i { background: var(--warning); }
.legend .l-unpaid i { background: var(--danger); }

/* ---------- Modalet ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,30,40,.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lift);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  padding: 26px; animation: slideUp .25s cubic-bezier(.2,.9,.3,1.1);
}
.modal-lg { max-width: 640px; }
.modal h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.modal .modal-sub { color: var(--text-2); font-size: 13.5px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1D1D1F; color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 500; z-index: 200; opacity: 0;
  transition: all .3s cubic-bezier(.2,.9,.3,1.2);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success::before { content: '✓'; color: var(--success); font-weight: 800; }
.toast.error::before { content: '✕'; color: var(--danger); font-weight: 800; }

/* ---------- Empty states ---------- */
.empty {
  text-align: center; padding: 52px 20px; color: var(--text-2);
}
.empty .art {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 24px;
  background: var(--primary-soft); display: grid; place-items: center; color: var(--primary);
}
.empty .art svg { width: 38px; height: 38px; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; letter-spacing: -0.01em; }
.empty p { font-size: 14px; max-width: 340px; margin: 0 auto 20px; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, #F5F6F8 0%, #EDF2FA 55%, #E8F0FC 100%);
  padding: 20px;
}
.login-card {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 24px; box-shadow: 0 4px 16px rgba(0,0,0,.05), 0 24px 60px rgba(30,60,120,.12);
  width: 100%; max-width: 400px; padding: 40px 36px;
  animation: slideUp .4s cubic-bezier(.2,.9,.3,1.05);
}
.login-card .brand { justify-content: center; padding-bottom: 6px; }
.login-card .login-sub { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 28px; }
.login-error {
  background: var(--danger-soft); color: #C11227; border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13.5px; font-weight: 500; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.login-foot { text-align: center; margin-top: 22px; font-size: 12.5px; color: var(--text-3); }

/* ---------- Vault ---------- */
.cred-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px; border-bottom: 1px solid var(--border-soft);
}
.cred-item:last-child { border-bottom: none; }
.cred-ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: var(--violet-soft); color: var(--violet);
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.cred-body { flex: 1; min-width: 0; }
.cred-body b { display: block; font-size: 14.5px; }
.cred-body span { font-size: 13px; color: var(--text-2); }
.cred-pass {
  font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 13px;
  letter-spacing: .08em; color: var(--text-2);
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: none; cursor: pointer;
  background: var(--bg-soft); color: var(--text-2);
  display: grid; place-items: center; transition: all .15s; flex: none;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Lista items (dashboard) ---------- */
.list-item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 2px; border-bottom: 1px solid var(--border-soft);
}
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .grow span { font-size: 12.5px; color: var(--text-2); }
.list-item .amount { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.list-item .amount.pos { color: #248A3D; }
.list-item .amount.neg { color: var(--danger); }

/* ---------- Alert banner ---------- */
.banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px;
  font-size: 14px; font-weight: 500;
}
.banner svg { width: 20px; height: 20px; flex: none; }
.banner-warning { background: var(--warning-soft); color: #8A4500; }
.banner-danger { background: var(--danger-soft); color: #C11227; }
.banner-info { background: var(--primary-soft); color: var(--primary-dark); }
.banner .banner-action { margin-left: auto; }

/* ---------- Tasks ---------- */
.task-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--border-soft); }
.task-item:last-child { border-bottom: none; }
.task-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--success); cursor: pointer; flex: none; }
.task-item .t-title { flex: 1; font-size: 14px; }
.task-item.done .t-title { text-decoration: line-through; color: var(--text-3); }
.task-item .t-due { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.task-item .t-due.overdue { color: var(--danger); font-weight: 600; }

/* ---------- Profile header ---------- */
.biz-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.biz-avatar {
  width: 64px; height: 64px; border-radius: 18px; flex: none;
  display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  box-shadow: 0 6px 18px rgba(0,113,227,.25);
  overflow: hidden;
}
.biz-avatar.has-logo { background: #fff; border: 1px solid var(--border-soft); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.biz-avatar.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.biz-head h2 { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.biz-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.biz-meta a { color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.biz-meta a:hover { color: var(--primary); text-decoration: none; }
.biz-meta svg { width: 14px; height: 14px; }
.biz-head .head-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Info grid në profil ---------- */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.info-grid .lbl { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.info-grid .val { font-size: 14.5px; margin-top: 2px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; background: #ECECF1; border-radius: var(--radius-sm); padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button {
  border: none; background: transparent; cursor: pointer;
  padding: 8px 18px; border-radius: 9px; font-family: var(--font);
  font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap;
  transition: all .15s;
}
.tabs button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- Company profile / logo uploader ---------- */
.company-form { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.logo-uploader { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.logo-preview {
  width: 160px; height: 160px; border-radius: 20px;
  background: var(--bg-soft); border: 2px dashed var(--border);
  display: grid; place-items: center; overflow: hidden; color: var(--text-3);
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.logo-preview svg { width: 48px; height: 48px; }
.logo-controls { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.logo-controls .btn { cursor: pointer; }
.logo-controls .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.company-fields { min-width: 0; }

/* Firma në sidebar */
.brand .company-logo {
  width: 36px; height: 36px; border-radius: 10px; object-fit: contain;
  background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); flex: none;
}
.brand .brand-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand .brand-name b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .brand-name small { font-size: 11px; color: var(--text-3); font-weight: 500; }

/* Kokëfaqja e firmës në raporte (për printim/fatura) */
.company-header {
  display: flex; align-items: center; gap: 16px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft); margin-bottom: 18px;
}
.company-header img { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; }
.company-header .ch-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.company-header .ch-meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

@media (max-width: 900px) {
  .company-form { grid-template-columns: 1fr; gap: 20px; }
  .logo-uploader { flex-direction: row; align-items: center; text-align: left; }
  .logo-preview { width: 96px; height: 96px; }
}

/* ---------- Biz logo uploader (modal) ---------- */
.biz-logo-field {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border-soft);
}
.biz-logo-preview {
  width: 72px; height: 72px; border-radius: 16px; flex: none;
  background: var(--bg-soft); border: 2px dashed var(--border);
  display: grid; place-items: center; overflow: hidden; color: var(--text-3);
}
.biz-logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.biz-logo-preview svg { width: 30px; height: 30px; }
.biz-logo-field .btn { cursor: pointer; }
.biz-logo-field .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* Mini logo në listën e bizneseve */
.biz-cell { display: inline-flex; align-items: center; gap: 10px; }
.biz-mini {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
img.biz-mini { border: 1px solid var(--border-soft); background: #fff; object-fit: contain; }

/* ---------- Welcome / onboarding (përdorimi i parë) ---------- */
.welcome-card { text-align: center; padding: 46px 28px; }
.welcome-ico { width: 76px; height: 76px; margin: 0 auto 18px; }
.welcome-ico img { width: 100%; height: 100%; object-fit: contain; }
.welcome-card h2 { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
.welcome-card > p { color: var(--text-2); max-width: 480px; margin: 10px auto 30px; font-size: 15px; }
.welcome-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 680px; margin: 0 auto 30px; text-align: left; }
.wstep { background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 18px; }
.wstep .wnum { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; font-weight: 800; margin-bottom: 11px; font-size: 15px; }
.wstep b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.wstep small { color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
@media (max-width: 700px) { .welcome-steps { grid-template-columns: 1fr; } .welcome-card { padding: 32px 18px; } }

/* ---------- Collapsible (details) ---------- */
.collapse-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; user-select: none; }
.collapse-head:hover .collapse-meta { color: var(--text-2); }
.collapse-meta { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.collapse-chev { width: 18px; height: 18px; transition: transform .25s; }
.collapse .collapse-body { display: none; margin-top: 14px; }
.collapse.open .collapse-body { display: block; animation: fadeIn .2s ease; }
.collapse.open .collapse-chev { transform: rotate(180deg); }

/* ---------- PWA install banner (vetëm telefon) ---------- */
.install-banner {
  display: none;
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--bottomnav-h) + 12px);
  z-index: 60; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lift); padding: 11px 12px 11px 14px;
  animation: slideUp .3s cubic-bezier(.2,.9,.3,1.1);
  padding-bottom: max(11px, env(safe-area-inset-bottom));
}
.install-banner.show { display: flex; }
.install-ico { width: 44px; height: 44px; border-radius: 11px; flex: none; box-shadow: 0 2px 8px rgba(20,71,181,.2); }
.install-txt { flex: 1; min-width: 0; }
.install-txt b { display: block; font-size: 14.5px; letter-spacing: -0.01em; }
.install-txt span { font-size: 12px; color: var(--text-2); }
.install-close { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 6px; display: grid; place-items: center; flex: none; }
.install-close svg { width: 16px; height: 16px; }
@media (min-width: 901px) { .install-banner { display: none !important; } }

/* ---------- Ndjesi app-like në telefon ---------- */
@media (max-width: 900px) {
  * { -webkit-tap-highlight-color: transparent; }
  body { overscroll-behavior-y: contain; }
  .nav a, .bottomnav a, .btn, .tabs button, .icon-btn { -webkit-user-select: none; user-select: none; }
  /* Titujt e mëdhenj pak më kompaktë në telefon */
  .page-head { margin-bottom: 18px; }
}
/* Kur hapet si aplikacion i instaluar (standalone) — hapësirë për status bar */
@media all and (display-mode: standalone) {
  .main { padding-top: max(18px, env(safe-area-inset-top)); }
  .sidebar { padding-top: max(24px, env(safe-area-inset-top)); }
}

/* ---------- Chart container ---------- */
.chart-box { position: relative; height: 280px; }

/* ---------- Year switch ---------- */
.year-switch { display: inline-flex; align-items: center; gap: 6px; }
.year-switch b { font-size: 16px; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Utility ---------- */
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.muted { color: var(--text-2); } .muted-3 { color: var(--text-3); }
.small { font-size: 13px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.right { text-align: right; }
.hide-mobile { display: initial; }
.num { font-variant-numeric: tabular-nums; }
.text-danger { color: var(--danger); }
.text-success { color: #248A3D; }

/* ============================================================
   MOBILE  (mobile-first refinements)
   ============================================================ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .bottomnav { display: flex; }
  .main { margin-left: 0; padding: 18px 16px calc(var(--bottomnav-h) + 28px); }
  .page-title { font-size: 24px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat .value { font-size: 22px; }
  .stat .ico { width: 38px; height: 38px; }

  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
  .months-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .card { padding: 18px; border-radius: 14px; }
  .modal { padding: 22px; border-radius: 18px; }
  .hide-mobile { display: none !important; }
  .page-head .btn span.btn-label { display: none; }
  .page-head .btn { padding: 10px 14px; }
  .biz-head .head-actions { margin-left: 0; width: 100%; }
  .info-grid { grid-template-columns: 1fr; }

  /* Tabela → kartela të stakuara */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr {
    background: var(--card); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); padding: 8px 14px; margin-bottom: 10px;
  }
  .table-cards td { padding: 6px 0; border: none; }
  .table-cards td[data-label]::before {
    content: attr(data-label);
    display: block; font-size: 11px; color: var(--text-3);
    font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  }
}

@media (max-width: 400px) {
  .month-cell { padding: 11px 4px 9px; }
  .month-cell .amt { font-size: 10.5px; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .bottomnav, .btn, .page-head .head-actions, .searchbar { display: none !important; }
  .main { margin: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid var(--border); }
  body { background: #fff; }
}
