:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #111827;
  --accent: #2563eb;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 8px;
  --shadow: none;   /* light framing only — borders, not shadows */
  --hover: #f8fafc;
  --accent-soft: #dbeafe;   /* rrethi i ikonave — i dukshëm mbi sfond */
}
html[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111c30;
  --ink: #e2e8f0;
  --muted: #8b9bb1;
  --line: #263450;
  --hover: #182742;
  --shadow: none;
  --accent-soft: #1e3a8a;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 13.5px; line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Icons (SVG sprite, referenced via <use>) */
.icon {
  width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; background: var(--brand); color: #e5e7eb; padding: 18px 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 12px 20px; }
.sidebar .brand { font-weight: 700; font-size: 18px; color: #fff; }
.nav-toggle { background: none; border: none; color: #9ca3af; cursor: pointer; padding: 5px; border-radius: 6px; display: flex; }
.nav-toggle:hover { color: #fff; background: rgba(255,255,255,.1); }
.sidebar .company { padding: 0 20px 14px; font-size: 12px; color: #9ca3af; border-bottom: 1px solid #374151; margin-bottom: 10px; }
.sidebar a { display: block; color: #d1d5db; padding: 7px 20px; font-size: 13px; }
.sidebar a:hover { background: #1f2937; color: #fff; text-decoration: none; }
.sidebar a.active { background: #1f2937; color: #fff; border-left: 3px solid var(--accent); }
/* active menu: system-accent icon (also on the collapsed rail & its section) */
.sidebar .nav-link.active .icon { color: var(--accent); }
.sidebar .nav-link:hover.active .icon { color: var(--accent); }
.sidebar .section.has-active > .icon { color: var(--accent); }
.sidebar .subnav .nav-link.active { color: var(--accent); font-weight: 600; }
.sidebar .section { padding: 14px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; }
.sidebar .section .section-label { flex: 1; }
.sidebar .section .icon { color: #6b7280; }
.sidebar .section.collapsible { cursor: pointer; position: relative; display: flex; align-items: center; gap: 10px; }
.sidebar .section.collapsible:hover { color: #fff; }
.sidebar .section.collapsible:hover .icon { color: #fff; }
.sidebar .section.collapsible .chevron { margin-left: auto; width: 15px; height: 15px; transition: transform .2s ease; }
.sidebar .section.collapsible[aria-expanded="true"] { color: #fff; }
.sidebar .section.collapsible[aria-expanded="true"] .icon { color: var(--accent); }
.sidebar .section.collapsible[aria-expanded="true"] .chevron { transform: rotate(180deg); color: #9ca3af; }
/* Printing: only the content, full width */
@media print {
  .sidebar, .topnav, .no-print, .quickcreate-overlay, .flash { display: none !important; }
  .print-only { display: block !important; }
  .main { padding: 0; }
  .card { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; }
}

/* Dashboard glance cards (QBO-style) */
.glance-head { display: flex; justify-content: space-between; font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700; margin-bottom: 8px; }
.glance-big { font-size: 24px; font-weight: 800; }
.glance-change { font-size: 12px; color: var(--muted); margin: 2px 0 10px; }
.glance-bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  font-size: 12.5px; margin-top: 8px; }
.glance-bar { grid-column: 1 / -1; height: 8px; background: var(--hover);
  border-radius: 4px; overflow: hidden; }
.glance-bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.glance-bar i.dim { background: #9ca3af; }
.glance-link { display: inline-block; margin-top: 12px; font-size: 12.5px; }
.glance-bank { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px;
  color: var(--ink); }
.glance-bank:hover { background: var(--hover); text-decoration: none; border-color: var(--muted); }

/* Cash-flow mini chart */
.cashflow-chart { display: flex; gap: 6px; align-items: flex-end; height: 140px; margin-top: 10px; }
.cf-col { flex: 1; display: flex; flex-direction: column; height: 100%; }
.cf-bar-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.cf-bar-area i { display: block; width: 70%; min-height: 2px; background: var(--brand);
  border-radius: 3px 3px 0 0; }
.cf-bar-area i.neg { background: #9ca3af; }
.cf-label { text-align: center; font-size: 10.5px; color: var(--muted); margin-top: 4px; }

/* Company logo / initials fallback — circular, never stretched by flex parents */
.company-logo { border-radius: 50%; object-fit: contain; flex: 0 0 auto; background: var(--surface); }
.company-logo-fallback { display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-weight: 700; border-radius: 50%; }

/* Company switcher (header, left of search) */
.company-switch { flex-shrink: 0; }
.company-switch-btn { display: flex; align-items: center; gap: 10px; max-width: 260px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 12px; cursor: pointer; color: var(--ink); text-align: left; font-family: inherit; }
.company-switch-btn:hover { background: var(--hover); border-color: var(--muted); }
.company-switch-info { display: flex; flex-direction: column; min-width: 0; }
.company-switch-info strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-switch-info .muted { font-size: 10.5px; }
.company-switch-btn .chevron { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.company-switch-menu { left: 0; right: auto; min-width: 280px; }
.company-switch-menu a { justify-content: flex-start; }
.company-switch-menu a.company-current { font-weight: 700; display: flex; }
.dropdown-sep { border-top: 1px solid var(--line); margin: 5px 0; }

.sidebar .quickmenu { padding: 0 20px 16px; margin-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .quickmenu-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.sidebar .quickmenu-header span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; }
.sidebar .quickmenu-list { display: grid; gap: 3px; }
/* Compact when confirmed (Done); roomier while customizing */
.sidebar .quickmenu-item { display: flex; justify-content: space-between; align-items: center; padding: 3px 8px; background: rgba(255,255,255,.04); border-radius: 6px; font-size: 12.5px; }
.sidebar.customize-mode .quickmenu-item { padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.sidebar .quickmenu-item a { color: #d1d5db; }
.sidebar .quickmenu-item a:hover { color: #fff; text-decoration: none; }
/* × only while customizing — hidden in confirmed mode */
.sidebar .quickmenu-remove { display: none; border: none; background: none; color: #9ca3af; font-size: 18px; cursor: pointer; }
.sidebar.customize-mode .quickmenu-remove { display: block; }
.sidebar .quickmenu-remove:hover { color: #fff; }
/* Overflow rows hide behind "Më shumë"; customize mode always shows all */
.sidebar .quickmenu-item.qm-hidden { display: none; }
.sidebar.customize-mode .quickmenu-item.qm-hidden { display: flex; }
.sidebar .quickmenu-more { border: none; background: none; color: #9ca3af; font-size: 12px;
  text-align: left; padding: 3px 8px; cursor: pointer; }
.sidebar .quickmenu-more:hover { color: #fff; }
.sidebar.customize-mode .quickmenu-more { display: none; }
.sidebar .quickmenu-empty { font-size: 12px; color: #9ca3af; padding-left: 0; }
.sidebar .menu-item { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.sidebar .nav-link { flex: 1; display: flex; align-items: center; gap: 10px; }
.sidebar .nav-link .icon { color: #9ca3af; }
.sidebar .nav-link:hover .icon, .sidebar .nav-link.active .icon { color: #fff; }
.sidebar .bookmark { display: none; align-items: center; margin-left: 8px; padding: 4px; border: none; background: none; color: #9ca3af; cursor: pointer; }
.sidebar .bookmark .icon { width: 16px; height: 16px; }
.sidebar.customize-mode .bookmark { display: inline-flex; }
.sidebar .bookmark.selected .icon { color: #facc15; fill: #facc15; }
.sidebar .bookmark:hover { color: #fff; }
.sidebar .subnav { display: none; margin-bottom: 10px; }
.sidebar .subnav.open { display: block; }
.sidebar .subnav .menu-item { padding: 0; }
.sidebar .subnav .nav-link { padding-left: 34px; }
.content-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main { flex: 1; padding: 16px 24px; width: 100%; }

/* ---- Collapsed sidebar: QBO-style icon rail with tiny labels + flyouts ---- */
html.nav-collapsed .sidebar { width: 76px; padding: 12px 0; overflow: visible; }
html.nav-collapsed .brand-row { flex-direction: column; gap: 8px; padding: 0 0 10px; align-items: center; }
html.nav-collapsed .sidebar .brand { font-size: 12px; }
html.nav-collapsed .sidebar .quickmenu { display: none; }
html.nav-collapsed .qc-btn-label { display: none; }
html.nav-collapsed .quickcreate-btn { width: 40px; height: 40px; border-radius: 50%;
  margin: 4px auto 10px; padding: 0; font-size: 18px; line-height: 1; }
html.nav-collapsed .sidebar .bookmark { display: none !important; }
/* sections & direct items → stacked icon + tiny label */
html.nav-collapsed .sidebar .section.collapsible { flex-direction: column; gap: 3px;
  padding: 9px 2px; font-size: 9.5px; letter-spacing: 0; text-transform: none;
  text-align: center; border-radius: 8px; margin: 0 8px; }
html.nav-collapsed .sidebar .section.collapsible:hover { background: #1f2937; }
html.nav-collapsed .sidebar .section .chevron { display: none; }
/* larger icons on the rail */
html.nav-collapsed .sidebar .section.collapsible > .icon,
html.nav-collapsed .sidebar .menu-item .nav-link > .icon { width: 24px; height: 24px; stroke-width: 1.7; }
html.nav-collapsed .sidebar .section .section-label { flex: none; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 64px; }
html.nav-collapsed .sidebar .menu-item { padding: 0 8px; }
html.nav-collapsed .sidebar .menu-item .nav-link { flex-direction: column; gap: 3px;
  font-size: 9.5px; padding: 9px 2px; text-align: center; border-radius: 8px; }
html.nav-collapsed .sidebar .menu-item .nav-link span { max-width: 64px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
/* submenus become flyout panels (like QBO 'All apps') */
html.nav-collapsed .sidebar .subnav { display: none; margin: 0; }
html.nav-collapsed .sidebar .subnav.open { display: block; position: fixed; left: 80px;
  width: 230px; background: var(--surface); opacity: 1; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.35); padding: 6px; z-index: 2000;
  max-height: calc(100vh - 40px); overflow-y: auto; }
html.nav-collapsed .sidebar .subnav.open::before { content: attr(data-title); display: block;
  font-weight: 700; font-size: 12.5px; color: var(--ink); padding: 7px 12px 8px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px; }
html.nav-collapsed .sidebar .subnav.open .nav-link { color: var(--ink); padding: 7px 12px;
  border-radius: 6px; font-size: 13px;
  flex-direction: row; justify-content: flex-start; align-items: center; text-align: left; }
html.nav-collapsed .sidebar .subnav.open .nav-link:hover { background: var(--hover); color: var(--ink); }
html.nav-collapsed .sidebar .subnav.open .menu-item { padding: 0; }

/* Full-screen editor shell (QBO-style) */
.fs-topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 28px; background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 500; }
.fs-title { font-size: 17px; font-weight: 700; display: flex; align-items: baseline; gap: 12px; }
.fs-company { font-weight: 400; font-size: 12px; color: #9ca3af; }
.fs-close { font-size: 30px; line-height: 1; color: #d1d5db; padding: 0 6px; border-radius: 8px; }
.fs-close:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.1); }
.fs-main { padding: 18px 28px; }

/* Top navigation bar */
.topnav { display: flex; align-items: center; gap: 16px; padding: 8px 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 500; }
.topnav-search { flex: 1; max-width: 540px; margin: 0 auto; display: flex; align-items: center;
  gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; }
.topnav-search .icon { color: var(--muted); width: 15px; height: 15px; }
.topnav-search input { border: none; background: transparent; padding: 3px 0; font-size: 13px; }
.topnav-search input:focus { outline: none; }
.topnav-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.iconbtn { background: none; border: none; padding: 7px; border-radius: 8px; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn:disabled { opacity: .4; cursor: default; }
.iconbtn:disabled:hover { background: none; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
  border: none; font-weight: 700; font-size: 12px; cursor: pointer; margin-left: 6px; flex-shrink: 0; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  min-width: 230px; padding: 6px; z-index: 600; }
.dropdown-menu a, .dropdown-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  border-radius: 6px; color: var(--ink); font-size: 13px; width: 100%; background: none;
  border: none; cursor: pointer; text-align: left; font-family: inherit; }
.dropdown-menu a:hover, .dropdown-item:hover { background: var(--hover); text-decoration: none; }
.dropdown-menu .qc-soon { display: block; padding: 7px 12px; font-size: 13px; }
.dropdown-menu .icon { width: 15px; height: 15px; color: var(--muted); }
.dropdown-header { padding: 7px 12px 8px; font-weight: 700; font-size: 12.5px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.topbar h1 { font-size: 19px; margin: 0; }

/* Cards & tables */
/* Seksionet e faqes: vetëm kornizë gri e lehtë, sfond i njëjtë me faqen */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 12px 16px; margin-bottom: 12px; }
.grid { display: grid; gap: 12px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: none; }
.stat .label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 20px; font-weight: 700; margin-top: 4px; }
/* monochrome: state shown by sign/label, not colour */
.stat .value.pos, .stat .value.neg { color: var(--ink); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 11.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: var(--hover); }
tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }

/* Forms */
label { display: block; font-size: 12.5px; font-weight: 600; margin: 8px 0 3px; }
input, select, textarea {
  width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--muted); }
.row { display: flex; gap: 14px; } .row > * { flex: 1; }
.row > .company-logo, .company-logo { flex: 0 0 auto !important; aspect-ratio: 1 / 1; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.check input { width: auto; }

/* Butonat: flat — sfondi i faqes; në hover ngjyrë e lehtë diferencuese */
.btn { display: inline-block; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 13.5px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--hover); border-color: var(--accent); text-decoration: none; }
.btn.secondary { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
/* Primar (accent/green): dallohet me tekst & kornizë theksi; hover me sfond të lehtë theme */
.btn.accent, .btn.green { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.btn.accent:hover, .btn.green:hover { background: var(--accent-soft); }
/* Destructive stays quiet: outline, red only on the text */
.btn.red { background: var(--bg); color: var(--red); border-color: var(--line); }
.btn.red:hover { border-color: var(--red); background: var(--hover); }

/* Badges: neutral chip + small status dot (no coloured backgrounds) */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.badge.green::before { background: var(--green); }
.badge.amber::before { background: var(--amber); }
.badge.red::before   { background: var(--red); }
.badge.blue::before  { background: var(--accent); }

/* Flash: neutral surface, thin status edge */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left-width: 3px; }
.flash.success { border-left-color: var(--green); }
.flash.danger  { border-left-color: var(--red); }
.flash.warning { border-left-color: var(--amber); }
.flash.info    { border-left-color: var(--muted); }

.muted { color: var(--muted); } .right { text-align: right; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; }
/* Company chooser (post-login, Intuit-style) */
.choose-body { background: var(--bg); }
.choose-wrap { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; }
.choose-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  width: 100%; max-width: 480px; padding: 28px 30px; }
.choose-brand { text-align: center; font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.choose-title { text-align: center; font-size: 18px; margin: 14px 0 4px; }
.choose-sub { text-align: center; margin: 0 0 16px; font-size: 12.5px; }
.choose-search { margin: 0 0 16px; max-width: none; }
.choose-list { max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.choose-group-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 12px 2px 6px; font-weight: 700; }
.choose-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px;
  color: var(--ink); }
.choose-item:hover { border-color: var(--muted); text-decoration: none; background: var(--hover); }
.choose-item-info { display: flex; flex-direction: column; min-width: 0; }
.choose-item-info strong { font-size: 13.5px; }
.choose-item-info .muted { font-size: 11.5px; }
.choose-item .chevron { color: var(--muted); flex-shrink: 0; }
.choose-empty { text-align: center; padding: 14px 0; }
.choose-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line);
  margin-top: 16px; padding-top: 14px; font-size: 13px; }

/* Quick-create “+ I ri” (QBO-style) */
.quickcreate-btn { display: block; width: calc(100% - 32px); margin: 12px 16px 4px; text-align: center; }
/* .btn.accent uses var(--brand) — invisible on the equally-dark sidebar, so
   the sidebar's create button gets the blue accent instead */
.sidebar .quickcreate-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.sidebar .quickcreate-btn:hover { background: #1d4ed8; border-color: #1d4ed8; }
.quickcreate-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; }
.quickcreate-overlay[hidden] { display: none; }
.quickcreate-panel { background: var(--surface); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.25);
  max-width: 980px; width: 100%; padding: 24px 28px; max-height: 80vh; overflow-y: auto; }
.quickcreate-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 28px; }
@media (max-width: 900px) { .quickcreate-grid { grid-template-columns: repeat(2, 1fr); } }
.quickcreate-grid h4 { margin: 0 0 8px; font-size: 13.5px; }
.quickcreate-grid a, .quickcreate-grid .qc-soon { display: block; padding: 6px 0; font-size: 13.5px; }
.quickcreate-grid a:hover { text-decoration: underline; }
.qc-soon { color: #9ca3af; cursor: default; }
.qc-hint { font-size: 11px; }
.quickcreate-footer { display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }

/* Reports catalog (QBO-style, collapsible categories) */
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px 28px; margin-top: 8px; }
.report-row { display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px; border-bottom: 1px solid var(--line); border-radius: 6px; }
.report-row:hover { background: var(--hover); }
.report-cat-head { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.report-cat-head .chevron { margin-top: 3px; transition: transform .15s ease; color: var(--muted); flex-shrink: 0; }
.report-cat-head h3 { margin: 0; font-size: 14px; }
.report-cat-desc { color: var(--muted); font-size: 12px; margin-top: 1px; }
.report-category.collapsed .report-cat-head .chevron { transform: rotate(-90deg); }
.report-category.collapsed .report-grid { display: none; }
.report-category .count { font-weight: 400; color: var(--muted); font-size: 12px; }
.report-star { background: none; border: none; cursor: pointer; font-size: 15px;
  color: #d1d5db; padding: 0 4px; }
.report-star:hover, .report-star.active { color: #f59e0b; }

/* Bank pending row: RULE chip + expandable detail (QBO-style) */
.rule-chip { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 10px;
  font-weight: 700; letter-spacing: .04em; background: #d1fae5; color: #065f46; flex-shrink: 0; }
.txn-detail-panel { background: var(--hover); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; margin: 4px 0; }
.txn-detail > td { border-bottom: none; padding-top: 0; }

/* Bank account picker: strip head + view toggle */
.bank-strip-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.bank-view-toggle { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.bank-view-toggle button { background: var(--surface); border: none; padding: 4px 10px;
  font-size: 12px; cursor: pointer; color: var(--muted); font-family: inherit; }
.bank-view-toggle button.active { background: var(--brand); color: #fff; }

/* Cards strip with horizontal scroll + edge arrows */
.bank-strip-wrap { position: relative; }
.bank-cards { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px;
  scroll-behavior: smooth; scrollbar-width: thin; }
.bs-arrow { position: absolute; top: 50%; transform: translateY(-60%); z-index: 10;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 17px; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.bs-arrow:hover { border-color: var(--muted); }
#bs-left { left: -8px; } #bs-right { right: -8px; }

/* The card itself — fixed rows, no awkward wrapping */
.bank-card { flex: 0 0 215px; min-width: 215px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
  text-decoration: none; color: inherit; transition: border-color .15s; }
.bank-card:hover { border-color: var(--muted); text-decoration: none; }
.bank-card.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.bank-card .bc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bank-card .bc-top strong { font-size: 13px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; min-width: 0; }
.bank-card .bc-balance { font-size: 16px; font-weight: 700; margin-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bank-card .bc-cur { font-size: 11px; font-weight: 600; color: var(--muted); }
.bank-card .bc-sub { display: flex; justify-content: space-between; gap: 8px;
  margin-top: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.bank-card .bc-sub span:first-child { overflow: hidden; text-overflow: ellipsis; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.tabs a.active { background: var(--brand); color: #fff; }

/* Dashboard */
.dashboard-wrapper { max-width: none; }
.dashboard-welcome h1 { font-size: 28px; margin: 0 0 2px; }
.dashboard-welcome p { margin: 0; }

.dashboard-modules {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;   /* të qendërzuara në rresht */
  gap: 8px;
  margin: 18px 0;
}
/* Kartë kompakte pill: ikonë majtas në rreth me ngjyrë theme, tekst djathtas */
.module {
  display: inline-flex;      /* gjerësi sipas përmbajtjes */
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.module:hover { border-color: var(--accent); background: var(--hover); }
.module-icon {
  width: 28px; height: 28px; flex: 0 0 auto;
  padding: 6px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); stroke-width: 2;
}
.module-label { font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* Personalizimi i panelit: modaliteti + paneli i seksioneve */
.dash-customize-panel { border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin: 12px 0; background: var(--bg); }
.dash-customize-panel h4 { margin: 0 0 8px; font-size: 13px; }
.dash-customize-panel .dcp-group { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-customize-panel label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.dash-widget.dw-hidden { display: none; }
body.dash-customizing .dash-widget { outline: 1.5px dashed var(--accent); outline-offset: 4px; border-radius: var(--radius); }
body.dash-customizing .dash-widget.dw-hidden { display: block; opacity: .35; }
body.dash-customizing .dashboard-modules.dash-widget.dw-hidden { display: flex; }

.dashboard-actions {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0;
  border: 1px solid var(--line);
}
.dashboard-actions h3 { margin: 0 8px 0 0; font-size: 14px; white-space: nowrap; }
.action-buttons {
  display: flex;
  align-items: center;       /* titulli dhe pill-et në një rresht */
  gap: 8px;
  flex-wrap: wrap;
}
/* Pill kompakt si kartat e moduleve: sfond faqeje, hover me ngjyrë të lehtë */
.action-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease;
}
.action-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
/* Drawer djathtas, full height — përzgjedhja e veprimeve të shpejta */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 2100; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 320px; max-width: 90vw;
  background: var(--surface); border-left: 1px solid var(--line); z-index: 2200;
  padding: 16px 18px; overflow-y: auto; box-shadow: -12px 0 34px rgba(0,0,0,.2); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.drawer-head h3 { margin: 0; font-size: 15px; }
.drawer-list { display: flex; flex-direction: column; gap: 4px; }
.drawer-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin: 12px 0 2px; padding: 0 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.drawer-group-title:first-child { margin-top: 0; }
.drawer-list label { display: flex; align-items: center; gap: 8px; font-size: 13px;
  cursor: pointer; padding: 7px 10px; border-radius: 8px; }
.drawer-list label:hover { background: var(--hover); }
.drawer-list input { width: auto; }

.expense-list {
  display: grid;
  gap: 12px;
}
.expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.expense-item:last-child { border-bottom: none; }
.expense-name { font-size: 13.5px; }
.expense-amount { font-weight: 700; }

.bank-list {
  display: grid;
  gap: 12px;
}
.bank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
}
.bank-info { flex: 1; }
.bank-name { font-weight: 700; }
.bank-meta { font-size: 12px; color: var(--muted); }
.bank-balance { font-weight: 700; font-size: 15px; text-align: right; }

/* Auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--brand); }
.auth-card { background: #fff; padding: 34px; border-radius: 14px; width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card .sub { color: var(--muted); margin-bottom: 18px; font-size: 13px; }

/* Company Selection */
.company-selection-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.company-selection-card {
  width: min(460px, 100%);
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 32px;
}
.company-selection-brand {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.company-selection-card h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}
.company-selection-sub {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 14px;
}
.company-selection-search input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  margin-bottom: 20px;
}
.company-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}
.company-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(229, 231, 235, 0.9);
}
.company-item-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.company-item-meta {
  color: var(--muted);
  font-size: 13px;
}
.company-item-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.company-selection-empty {
  color: var(--muted);
  text-align: center;
  padding: 22px 0;
}
.company-selection-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
}
.company-selection-footer a {
  color: var(--accent);
}
.company-selection-footer a:hover {
  text-decoration: underline;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Combobox (kërko-ose-krijo, p.sh. klienti te fatura) */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 3px); z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; padding: 4px; }
.combo-item { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.combo-item:hover { background: var(--hover); }
.combo-item.combo-create { color: var(--accent); font-weight: 600;
  border-top: 1px solid var(--line); margin-top: 3px; padding-top: 9px; }

/* Attachments dropzone (evidencat me drag & drop) */
.dropzone { display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border: 2px dashed var(--line); border-radius: 10px; cursor: pointer;
  color: var(--muted); transition: border-color .15s ease, background .15s ease; }
.dropzone:hover, .dropzone:focus { border-color: var(--accent); color: var(--ink); }
.dropzone.dragover { border-color: var(--accent); background: rgba(37, 99, 235, .06);
  color: var(--ink); }
.dropzone.busy { opacity: .7; pointer-events: none; }
.dropzone input[type=file] { display: none; }
.dropzone .dz-status { margin-left: auto; font-size: 12px; white-space: nowrap; }
.dropzone.dz-compact { padding: 7px 12px; gap: 8px; border-radius: 8px; font-size: 12px; }
.attach-inline { margin-top: 8px; }
.attach-inline-row { display: flex; align-items: center; gap: 10px; padding: 4px 2px;
  font-size: 12.5px; }
.attach-inline-row .js-att-delete { margin-left: auto; border: none; background: none;
  color: var(--muted); cursor: pointer; font-size: 14px; }
.attach-inline-row .js-att-delete:hover { color: var(--red); }

/* Share-style export dropdown (every table's companion) */
.export-menu { position: relative; display: inline-block; }
.export-menu > summary { list-style: none; cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; user-select: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu > summary .icon { width: 15px; height: 15px; }
.export-menu[open] > summary { background: var(--hover); }
.export-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
  min-width: 200px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.export-menu-list a { display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 7px; color: var(--ink); font-size: 13px; }
.export-menu-list a:hover { background: var(--hover); text-decoration: none; }
.export-menu-list a .muted { font-size: 11.5px; margin-left: auto; }
.export-menu-list .icon { width: 17px; height: 17px; flex-shrink: 0; }
.icon.ft-csv { color: #059669; }
.icon.ft-xlsx { color: #107c41; }
.icon.ft-pdf { color: #dc2626; }
@media print { .export-menu { display: none; } }

/* QBO-style report sheet (raportet e menaxhimit) */
.rpt-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.rpt-controls label { display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.rpt-controls .spacer { margin-left: auto; }
.rpt-sheet { background: var(--surface); max-width: 880px; margin: 18px auto 0;
  padding: 30px 38px 44px; border: 1px solid var(--line); border-radius: var(--radius); }
.rpt-head { text-align: center; margin-bottom: 20px; }
.rpt-head .co { font-size: 20px; font-weight: 800; }
.rpt-head .title { font-size: 15px; font-weight: 600; margin-top: 2px; }
.rpt-head .period { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
table.rpt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rpt th { font-weight: 600; border-bottom: 2px solid var(--ink);
  padding: 6px 8px; text-align: left; }
table.rpt th.num { text-align: right; }
table.rpt td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
table.rpt td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.rpt tr:hover td { background: var(--hover); }
tr.rpt-section > td { font-weight: 700; }
tr.rpt-section > td .chev { display: inline-block; width: 14px; color: var(--muted);
  transition: transform .15s ease; }
tr.rpt-toggle { cursor: pointer; user-select: none; }
tr.rpt-toggle.collapsed > td .chev { transform: rotate(-90deg); }
tr.rpt-total > td { font-weight: 700; border-top: 1px solid var(--ink); }
tr.rpt-grand > td { font-weight: 800; border-top: 2px solid var(--ink);
  border-bottom: 3px double var(--ink); }
tr.rpt-plain > td { border-bottom: none; }
.rpt-ind-1 { padding-left: 28px !important; }
.rpt-ind-2 { padding-left: 50px !important; }
@media print {
  .rpt-sheet { border: none; max-width: none; margin: 0; padding: 0; border-radius: 0; }
  table.rpt tr:hover td { background: transparent; }
}
