/* style.css — stilizimi i login-it dhe dashboard-it */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:        #eef2f9;
    --sidebar:   #1e293b;
    --sidebar-2: #0f172a;
    --accent:    #2563eb;
    --accent-2:  #1d4ed8;
    --text:      #1f2937;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
    --radius:    14px;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(180deg, #eef2f9 0%, #e6ebf5 100%);
    background-attachment: fixed;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- LOGIN ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
    padding: 20px;
}
.login-card {
    background: #fff;
    width: 100%;
    max-width: 360px;
    padding: 36px 30px;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.login-logo {
    text-align: center;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--accent);
    margin-bottom: 8px;
}
.login-card h1 {
    font-size: 20px;
    text-align: center;
    margin-bottom: 22px;
}
.login-card label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin: 12px 0 6px;
}
.login-card input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.login-card button:hover { background: #1d4ed8; }
.alert {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 6px;
}
.hint {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* ---------- LAYOUT ---------- */
/* --banner-h = lartësia e njoftimit të afatit (licBanner) kur është i pranishëm; ndryshe 0.
   Kështu sidebar-i s'del poshtë ekranit dhe footer-i (© …) mbetet gjithmonë i dukshëm. */
.layout { display: flex; min-height: calc(100vh - var(--banner-h, 0px)); }

.sidebar {
    width: var(--sidebar-w, 250px);
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    color: #e5e7eb;
    flex-shrink: 0;
    transition: margin-left .25s ease;
    /* Qëndron fiks kur scroll-on faqja; lartësia = ekrani, menyja scroll-on brenda */
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: calc(100vh - var(--banner-h, 0px));
    position: -webkit-sticky;
    position: sticky;
}
/* Shiriti i scroll-it te menyja (i dukshëm për tërheqje lart/poshtë) */
.sidebar-nav { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; overscroll-behavior: contain; }
.sidebar-nav::-webkit-scrollbar { width: 9px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.5); background-clip: padding-box; }
/* Doreza për zgjerim anësor (drag) */
.sidebar-resizer { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 25; }
.sidebar-resizer::after { content: ''; position: absolute; top: 0; left: 3px; width: 1px; height: 100%; background: transparent; transition: background .15s; }
.sidebar-resizer:hover::after, body.sidebar-resizing .sidebar-resizer::after { background: rgba(59,130,246,.85); width: 3px; left: 2px; }
body.sidebar-resizing { cursor: col-resize; user-select: none; }
.sidebar-brand {
    padding: 18px 20px;
    color: #fff;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
    text-transform: uppercase;
    word-break: break-word;
}
.sidebar-brand-uniq {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .5px;
    margin-top: 4px;
    color: rgba(255, 255, 255, .6);
}
.sidebar-nav { padding: 12px 0; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 15px;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
    background: rgba(37, 99, 235, .18);
    color: #fff;
    border-left-color: var(--accent);
}
.nav-ico { width: 20px; text-align: center; }
.nav-group {
    padding: 16px 22px 6px; font-size: 11px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: #64748b;
}
.nav-sub { padding-left: 30px; font-size: 14px; }
/* Grup i palosshëm me pamje butoni dropdown (p.sh. "Llojet") */
.nav-group-toggle {
    cursor: pointer; user-select: none;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin: 10px 12px 6px; padding: 11px 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 9px;
    color: #e7edf5;                 /* më e ndritshme se etiketat e tjera */
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(0,0,0,.18);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.nav-group-toggle:hover {
    background: linear-gradient(180deg, rgba(37,99,235,.30), rgba(37,99,235,.16));
    border-color: rgba(96,165,250,.55);
    color: #fff;
    box-shadow: 0 3px 8px -2px rgba(37,99,235,.5);
}
.nav-group-toggle .ng-label { display: flex; align-items: center; gap: 8px; }
.nav-caret {
    font-size: 12px; line-height: 1; color: #93c5fd;
    transition: transform .2s ease;
}
.nav-group-toggle:hover .nav-caret { color: #fff; }
.nav-group-toggle.collapsed .nav-caret { transform: rotate(-90deg); }
.nav-group-body.collapsed { display: none; }
/* Modeli i orientuar: zërat brenda një grupi ngjeshen pak nën kokën e grupit, që ndarja të lexohet qartë. */
html.sb-grouped .nav-group-body { margin-left: 10px; border-left: 2px solid rgba(255,255,255,.08); }
/* Të gjithë zërat brenda një grupi rreshtohen NJËSOJ (ikonat në një vijë të drejtë) — pa dhëmbëzim të veçantë për nën-zërat. */
html.sb-grouped .nav-group-body .nav-item { padding-top: 8px; padding-bottom: 8px; padding-left: 16px; font-size: 15px; }
html.sb-grouped .nav-group-body .nav-item.nav-sub { padding-left: 16px; font-size: 15px; }

/* MADHËSIA E MENYSË ANËSORE (Cilësitë → Pamja): sb-size-small/large/xl — rrit/zvogëlon zërat sipas dëshirës.
   Vendoset PAS rregullave të grupimit që të mbizotërojë (specifikë e barabartë, radhë më vonë). */
html.sb-size-large .nav-item,
html.sb-size-large .nav-group-body .nav-item,
html.sb-size-large .nav-group-body .nav-item.nav-sub { font-size: 16.5px; padding-top: 12px; padding-bottom: 12px; }
html.sb-size-large .nav-group-toggle { font-size: 14px; padding-top: 13px; padding-bottom: 13px; }
html.sb-size-large .nav-group { font-size: 12px; }
html.sb-size-large .nav-ico { font-size: 18px; }

html.sb-size-xl .nav-item,
html.sb-size-xl .nav-group-body .nav-item,
html.sb-size-xl .nav-group-body .nav-item.nav-sub { font-size: 18.5px; padding-top: 14px; padding-bottom: 14px; }
html.sb-size-xl .nav-group-toggle { font-size: 16px; padding-top: 15px; padding-bottom: 15px; }
html.sb-size-xl .nav-group { font-size: 13px; }
html.sb-size-xl .nav-ico { font-size: 20px; }

html.sb-size-small .nav-item,
html.sb-size-small .nav-group-body .nav-item,
html.sb-size-small .nav-group-body .nav-item.nav-sub { font-size: 13.5px; padding-top: 7px; padding-bottom: 7px; }
html.sb-size-small .nav-group-toggle { font-size: 11px; }
html.sb-mini.sb-grouped .nav-group-body { margin-left: 0; border-left: 0; }
/* MINI + grouped: kur sidebar-i është "vetëm ikona" DHE një grup mbetet i hapur, zërat e grupit
   duhet të fshehin tekstin e të tregojnë vetëm ikonën e qendërzuar (si çdo zë tjetër në mini).
   Pa këtë, rregullat html.sb-grouped … (font-size:15px) mbizotërojnë mbi mini (specifikë më e lartë)
   dhe teksti derdhet jashtë sidebar-it. */
html.sb-mini.sb-grouped .nav-group-body .nav-item,
html.sb-mini.sb-grouped .nav-group-body .nav-item.nav-sub {
    padding-left: 0; padding-right: 0; font-size: 0; justify-content: center; gap: 0;
}
html.sb-mini.sb-grouped .nav-group-body .nav-item .nav-ico { font-size: 17px; width: auto; }
.modal-grid label.chk { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.modal-grid label.chk input { width: auto; }

/* ---------- MAIN ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    padding: 8px 20px;
    min-height: 62px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}
.topbar-title { font-size: 18px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-badge {
    background: #eef2ff;
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.logout-btn {
    color: #b91c1c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.logout-btn:hover { text-decoration: underline; }

/* Hamburger */
.hamburger {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    border-radius: 8px;
}
.hamburger:hover { background: #f1f5f9; }
.hamburger span {
    display: block;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: .25s;
}

.content { padding: 24px; }

/* Sidebar si kolonë me footer (copyright) poshtë */
.sidebar { display: flex; flex-direction: column; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; }
.sidebar-footer { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sf-user {
    display: flex; align-items: center; gap: 11px;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
}
.sf-avatar {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: #fff; letter-spacing: .5px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
}
.sf-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sf-name { font-weight: 700; font-size: 14px; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-role { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #7c8aa0; }
.sf-logout {
    display: flex; align-items: center; gap: 9px; text-decoration: none;
    color: #f87171; font-weight: 700; font-size: 14px; padding: 8px 6px; border-radius: 8px;
    transition: background .15s ease, color .15s ease;
}
.sf-logout svg { width: 18px; height: 18px; }
.sf-logout:hover { background: rgba(248,113,113,.12); color: #fca5a5; }
.sf-cr {
    margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08);
    text-align: center; font-size: 11.5px; color: #94a3b8; line-height: 1.7; font-weight: 600;
}

/* Të dhënat e kompanisë te shiriti i sipërm (në çdo faqe) */
.topbar-company { flex: 1; min-width: 0; padding: 0 18px; line-height: 1.2; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
/* Brandi B KONT KONTABILITET (si te banderola) */
.bk-brand { display: flex; align-items: center; gap: 10px; }
.bk-badge {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px; color: #16284a;
    background: #fff; border: 2.5px solid #16284a; box-shadow: 0 0 0 2px #2f6bd6 inset;
}
.bk-words { display: flex; flex-direction: column; line-height: 1; }
.bk-1 { font-weight: 800; font-size: 18px; letter-spacing: 1px; color: #16284a; }
.bk-2 { font-weight: 700; font-size: 9.5px; letter-spacing: 4px; color: #2f6bd6; margin-top: 2px; }
.tc-tag { font-size: 11px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.tc-cred { font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 992px) { .topbar-company { display: none; } }

/* ---------- KARTAT ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}
.card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, var(--accent), #60a5fa);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-label { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.card-value { font-size: 28px; font-weight: 700; color: var(--accent); }

/* ---------- PANEL / TABELA ---------- */
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
}
.panel h2 { margin-bottom: 10px; font-size: 18px; }
.panel p { color: var(--muted); line-height: 1.6; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.data-table th { color: var(--muted); font-weight: 600; background: #f9fafb; }
.data-table .empty { text-align: center; color: var(--muted); padding: 28px; }
.type-badge {
    display: inline-block; background: #eef2ff; color: var(--accent);
    padding: 3px 10px; border-radius: 14px; font-size: 12.5px; font-weight: 600;
    border: 1px solid #c7d2fe; white-space: nowrap;
}

/* Raporte — badge-t e normave */
.summary-table { max-width: 720px; }
.summary-table tfoot .sum-row td { background: linear-gradient(180deg,#eef4ff,#e6eefc); font-weight:700; border-top:2px solid #c7d2fe; padding:13px 14px; }
.summary-table tfoot output { font-weight: 800; color: var(--accent); }
.rate-badge { display:inline-block; padding:3px 12px; border-radius:14px; font-size:13px; font-weight:700; }
.rate-badge.r0   { background:#f1f5f9; color:#475569; border:1px solid #cbd5e1; }
.rate-badge.r8   { background:#fef9c3; color:#854d0e; border:1px solid #fde68a; }
.rate-badge.r18  { background:#dcfce7; color:#166534; border:1px solid #a7f3d0; }
.rate-badge.rexp { background:#dbeafe; color:#1e40af; border:1px solid #bfdbfe; }
.rep-scope { font-size: 13px; font-weight: 400; color: var(--muted); }

/* Libër shitje (detaje) — blloqet e faturave me artikuj */
.inv-block { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.inv-block-head { background: linear-gradient(180deg, #f1f5f9, #e8eef6); padding: 11px 16px; border-bottom: 1px solid var(--border); }
.ibh-left { display: flex; flex-direction: column; gap: 2px; }
.ibh-no { font-weight: 800; color: var(--accent); font-size: 15px; }
.ibh-buyer { font-weight: 700; color: var(--text); font-size: 14px; }
.ibh-sub { font-size: 12px; color: var(--muted); }
.inv-items { width: 100%; border-collapse: collapse; }
.inv-items th { background: #f8fafc; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.inv-items td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
.inv-items tbody tr:last-child td { border-bottom: none; }
.inv-items tfoot td { background: #fbfcfe; border-top: 1px solid var(--border); padding: 9px 12px; font-size: 13.5px; }
.summary-table output { font-weight: 600; }

/* Kartat e llojeve të faturave */
.type-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.type-card {
    display: block; text-decoration: none; color: var(--text);
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-md); position: relative; overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.type-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--accent), #60a5fa); }
.type-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.type-card-ico { font-size: 38px; line-height: 1; margin-bottom: 12px; }
.type-card-title { font-size: 18px; font-weight: 800; color: var(--text); }
.type-card-desc { font-size: 13px; color: var(--muted); margin-top: 4px; min-height: 34px; }
.type-card-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.type-card-total { font-weight: 800; color: var(--accent); }
.type-card-seq { margin-top: 8px; font-size: 12px; color: #94a3b8; font-family: monospace; }

/* Shiriti i filtrave */
.filters-bar {
    display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap;
    background: #f8fafc; border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px; margin: 4px 0 18px;
}
.filter-field { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.filter-field input, .filter-field select {
    padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px;
    outline: none; background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.filter-field input:focus, .filter-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.filters-bar .btn-secondary { height: 39px; }

/* Rreshti i totalit (smart sum) */
.data-table tfoot .sum-row td {
    background: linear-gradient(180deg, #eef4ff, #e6eefc); font-weight: 700;
    padding: 13px 14px; border-top: 2px solid #c7d2fe; font-size: 14px;
}
.data-table tfoot .tfoot-label { color: #334155; letter-spacing: .3px; }
.data-table tfoot output { font-weight: 800; color: var(--accent); }

/* ---------- MENAXHIMI I SUBJEKTEVE (dashboard) ---------- */
.subjects-bar {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.subjects-head h2 {
    font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px;
}
.count-pill {
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    font-size: 13px; font-weight: 700; padding: 2px 11px; border-radius: 20px;
    box-shadow: 0 3px 8px rgba(37,99,235,.3);
}
.subjects-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.subjects-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); overflow: hidden;
}
.subjects-toolbar { padding: 16px 18px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.subj-filter {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--border); border-radius: 10px; font-size: 14px; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease; background: #fff;
}
.subj-filter:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }

.subjects-table { width: 100%; border-collapse: collapse; }
.subjects-table th {
    text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: var(--muted); padding: 12px 16px;
    background: #f8fafc; border-bottom: 1px solid var(--border);
}
.subjects-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; }
.subjects-table tbody tr { transition: background .12s ease; }
.subjects-table tbody tr:hover { background: #f6f9ff; }
.subjects-table tbody tr:last-child td { border-bottom: none; }

.subj-cell { display: flex; align-items: center; gap: 12px; }
.subj-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .5px;
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
}
.subj-id { display: flex; flex-direction: column; line-height: 1.3; }
.subj-name { font-weight: 700; color: var(--text); }
.subj-email { font-size: 12px; color: var(--muted); }
.tag {
    display: inline-block; padding: 2px 9px; border-radius: 14px; font-size: 12px; font-weight: 600;
}
.tag-vat { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.tag-admin { background: #eef2ff; color: var(--accent); border: 1px solid #c7d2fe; }
.tag-off { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Modali i gjerë + rrjeta e privilegjeve */
.modal.modal-wide { max-width: 720px; }
.perms-section { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
.perms-section h4 { font-size: 15px; margin-bottom: 10px; }
.perms-table { width: 100%; border-collapse: collapse; }
.perms-table th, .perms-table td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; text-align: center; }
.perms-table th { background: #f8fafc; color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; }
.perms-table th:first-child, .perms-table td.perm-mod { text-align: left; font-weight: 600; color: var(--text); vertical-align: middle; }
/* Etiketa e modulit rreshtohet MAJTAS njësoj për të gjitha (kutia + teksti fillojnë në një vijë). */
.perms-table td.perm-mod .mod-allw { display: inline-flex; align-items: center; text-align: left; }
.perm-chk { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }
.perm-na { color: #cbd5e1; }
/* Chips filtrimi te raportet (mënyra e pagesës etj.) — funksionale + të dekoruara. Global që të vlejnë edhe kur
   blloku i raportit del para stileve inline (p.sh. Raporti i pagesave). */
.rep-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.rep-chip {
    border: 1.5px solid #cbd5e1; background: #fff; color: #475569;
    padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; line-height: 1; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15,23,42,.06);
    transition: transform .12s ease, box-shadow .15s ease, background .15s, color .15s, border-color .15s;
}
.rep-chip:hover { border-color: #2563eb; color: #1d4ed8; transform: translateY(-1px); box-shadow: 0 5px 12px -5px rgba(37,99,235,.45); }
.rep-chip:active { transform: translateY(0); }
.rep-chip.is-active { background: linear-gradient(135deg,#2563eb,#1d4ed8); color: #fff; border-color: #1d4ed8; box-shadow: 0 6px 16px -5px rgba(37,99,235,.55); }
/* Koka e grupit të lejeve (njësoj si ndarjet e sidebar-it) — vetëm organizim pamor. */
.perm-group-row td {
    text-align: left; background: linear-gradient(180deg,#eef2ff,#e0e7ff);
    color: #1e3a8a; font-weight: 800; font-size: 12px; letter-spacing: .5px; text-transform: uppercase;
    padding: 8px 12px; border-top: 2px solid #c7d2fe; border-bottom: 1px solid #c7d2fe;
    position: sticky; top: 0;
}
.perm-group-row .pg-ico { font-size: 14px; margin-right: 4px; }
.perms-note { display: none; margin-top: 10px; font-size: 13px; color: var(--accent); background: #eff6ff; border: 1px solid #c7d2fe; border-radius: 8px; padding: 8px 12px; }
.perms-section.is-admin .perms-table { opacity: .45; pointer-events: none; }
.perms-section.is-admin .perms-note { display: block; }
.modal-grid label small { color: var(--muted); font-weight: 400; }

.row-actions { display: flex; gap: 8px; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* Butona ikonë (view/edit/delete) me SVG */
.icon-btn {
    width: 36px; height: 34px; border: 1px solid var(--border); background: #fff;
    border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    padding: 0; transition: background .15s ease, border-color .15s ease, transform .15s ease, color .15s ease;
}
.icon-btn svg { width: 17px; height: 17px; display: block; }
.icon-btn.btn-view { color: #475569; }
.icon-btn.btn-view:hover { background: #f1f5f9; border-color: #94a3b8; color: #1e293b; transform: translateY(-1px); }
.icon-btn.btn-edit { color: var(--accent); }
.icon-btn.btn-edit:hover { background: #eff6ff; border-color: var(--accent); transform: translateY(-1px); }
.icon-btn.btn-del { color: #dc2626; }
.icon-btn.btn-del:hover { background: #fef2f2; border-color: #fca5a5; transform: translateY(-1px); }

/* Badge "po editoni" */
.edit-badge {
    display: inline-block; margin-top: 8px; margin-left: 8px;
    background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
    padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
}

/* Faqja e shikimit të faturës */
.view-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.vrow {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 6px 0; border-bottom: 1px dashed #eef2f7; font-size: 13.5px;
}
.vrow:last-child { border-bottom: none; }
.vrow span { color: var(--muted); }
.vrow b { color: var(--text); text-align: right; }

/* Printimi */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    body { background: #fff; }
    .main, .content { padding: 0 !important; }
    .fatura-wrap { box-shadow: none; border: none; }
}

.empty-state { text-align: center; padding: 56px 20px !important; }
.empty-ico { font-size: 46px; opacity: .55; }
.empty-title { font-size: 17px; font-weight: 700; margin-top: 10px; color: var(--text); }
.empty-text { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- FATURA ---------- */
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none;
    padding: 11px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none; display: inline-block;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(37, 99, 235, .36); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(37, 99, 235, .3); }
.btn-secondary {
    background: #fff; color: var(--accent); border: 1px solid #c7d7fb;
    padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
    box-shadow: var(--shadow-sm); transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-secondary:hover { background: #eff6ff; border-color: var(--accent); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); }
.alert-success {
    background: linear-gradient(135deg, #dcfce7, #d1fae5); color: #166534;
    padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px;
    border: 1px solid #a7f3d0;
}

.fatura-wrap {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow-md);
}
.fatura-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--accent), #93c5fd) 1;
    padding-bottom: 16px; margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.fatura-title h2 {
    font-size: 24px; font-weight: 800; letter-spacing: .5px;
    background: linear-gradient(135deg, var(--accent), #1e3a8a);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.fatura-logo { max-height: 64px; max-width: 200px; display: block; margin-bottom: 8px; object-fit: contain; }

/* ---------- TË DHËNAT E KOMPANISË ---------- */
.company-grid { display: grid; grid-template-columns: 1fr 280px; gap: 26px; align-items: start; }
.company-fields { display: grid; gap: 12px; }
.company-fields label { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.company-fields input {
    padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.company-fields input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.company-logo-box { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #f8fafc; text-align: center; }
.logo-label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.logo-preview {
    width: 100%; height: 150px; border: 2px dashed #cbd5e1; border-radius: 10px; background: #fff;
    display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 12px;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-empty { color: #94a3b8; font-size: 14px; }
.logo-hint { display: block; color: var(--muted); font-size: 12px; margin-top: 8px; }
.company-actions { margin-top: 22px; display: flex; justify-content: flex-end; }

/* Cilësitë */
.settings-group { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border); }
.opt-toggle { display: flex; align-items: flex-start; gap: 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; color: var(--text); cursor: pointer; }
/* Vetëm checkbox/radio i toggle-it 18×18 — JO fushat text/date/number brenda rreshtave opt-toggle
   (ato duhet ta ruajnë gjerësinë e vet; ndryshe fushat e datës ngjisheshin te «Afati i përdorimit»). */
.opt-toggle input[type="checkbox"], .opt-toggle input[type="radio"] { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex-shrink: 0; }
.settings-group:first-child { margin-top: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.settings-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: #fbfcfe; }
.settings-card-head { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.settings-ico { font-size: 22px; }
.settings-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.settings-field input { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.settings-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.settings-number { display: flex; align-items: flex-end; gap: 6px; }
.settings-number .seg { display: flex; flex-direction: column; gap: 4px; }
.settings-number .seg span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.settings-number .seg input { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 7px; font-size: 14px; text-align: center; outline: none; }
.settings-number .seg input:focus { border-color: var(--accent); }
.settings-number .seg input:disabled { background: #f1f5f9; color: #94a3b8; }
.settings-number .seg-seq, .settings-number .seg-year { max-width: 64px; }
.seg-dash { padding-bottom: 9px; color: var(--muted); font-weight: 700; }
.settings-preview { margin-top: 12px; font-size: 14px; color: var(--muted); }
.settings-preview .prev { color: var(--accent); font-family: monospace; font-size: 15px; }
.settings-note { margin-top: 6px; font-size: 12px; color: #047857; }

@media (max-width: 768px) {
    .company-grid { grid-template-columns: 1fr; }
    .company-fields label { grid-template-columns: 1fr; gap: 4px; }
}
.payment-badge {
    display: inline-block; margin-top: 8px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: var(--accent);
    padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
    border: 1px solid #c7d2fe;
}
.fatura-meta { text-align: right; font-size: 14px; line-height: 1.9; }
.fatura-meta span { color: var(--muted); }
.fatura-meta em { color: var(--muted); font-size: 12px; }
#invNo { color: var(--accent); font-size: 16px; }
.date-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.date-input {
    border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px;
    font-size: 14px; font-weight: 600; color: var(--text);
    font-family: inherit; width: 110px; text-align: center;
}
.date-input:focus { border-color: var(--accent); outline: none; }
.date-input.invalid { border-color: #dc2626; background: #fef2f2; }
.date-btn {
    border: 1px solid var(--border); background: #fff; border-radius: 6px;
    padding: 4px 7px; font-size: 15px; cursor: pointer; line-height: 1;
}
.date-btn:hover { background: #f1f5f9; }
/* Inputi vendas i kalendarit — i fshehur, shërben vetëm për të hapur kalendarin */
.date-native { position: absolute; right: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.party {
    border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 10px;
    background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
    display: flex; flex-wrap: wrap; gap: 5px 12px; align-content: start;
}
.party legend {
    font-weight: 700; color: var(--accent); padding: 1px 10px; font-size: 12px;
    background: #fff; border: 1px solid var(--border); border-radius: 20px;
    text-transform: uppercase; letter-spacing: .5px; width: auto;
}
.party .subject-tools, .party .buyer-msg { flex: 0 0 100%; margin: 0; }
.party label {
    flex: 0 0 calc(50% - 6px); display: grid; grid-template-columns: 84px 1fr;
    align-items: center; gap: 6px; margin: 0; font-size: 11px; color: var(--muted);
}
/* Emri / Subjekti zë gjithë gjerësinë (vlerat e gjata) */
.party label:nth-of-type(1) { flex: 0 0 100%; grid-template-columns: 84px 1fr; }
.party input {
    padding: 3px 7px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 12px; outline: none; color: var(--text); background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease; min-width: 0;
}
.party input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
/* Fusha e kërkimit të subjektit më e ngushtë + ikonë dropdown */
#buyer_name { max-width: 360px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%2394a3b8'/></svg>"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 22px; }

/* ---------- SMART SEARCH (autocomplete i Blerësit) ---------- */
.ac-box {
    position: absolute; z-index: 200; background: #fff;
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
    max-height: 320px; overflow-y: auto; padding: 6px;
}
.ac-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: 10px; cursor: pointer;
    transition: background .12s ease;
}
.ac-item:hover, .ac-item.active { background: #eff6ff; }
.ac-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .5px;
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
}
.ac-info { min-width: 0; }
.ac-name { display: block; font-weight: 700; font-size: 14px; color: var(--text); }
.ac-sub  { display: block; font-size: 12px; color: var(--muted); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.items-scroll { overflow-x: auto; margin-bottom: 10px; }
.items-table { width: 100%; border-collapse: collapse; margin-bottom: 0; }
/* Kompakt kur ka kolonat e zbritjes (shumë kolona) */
.items-table.has-discount { min-width: 980px; }
.items-table.has-discount th { padding: 7px 4px; font-size: 10.5px; letter-spacing: 0; }
.items-table.has-discount input.cell,
.items-table.has-discount select.cell,
.items-table.has-discount input.calc { padding: 5px 5px; font-size: 12px; }
.items-table.has-discount tfoot td { padding: 8px 5px; font-size: 12px; }
.items-table.has-discount .nr-cell { padding: 5px; }
.items-table th {
    background: linear-gradient(180deg, #eef2fb, #e2e8f4); color: #334155;
    font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
    padding: 11px 8px; border: 1px solid #dbe2ee; text-align: center;
}
.items-table td { border: 1px solid var(--border); padding: 0; }
.items-table tbody tr { transition: background .12s ease; }
.items-table tbody tr:hover { background: #f6f9ff; }
.items-table .nr-cell { text-align: center; font-weight: 700; color: var(--muted); padding: 8px; background: #f8fafc; }
.items-table input.cell {
    width: 100%; border: none; padding: 9px 8px; font-size: 14px; outline: none; background: transparent;
}
.items-table input.cell.num { text-align: right; }
.items-table input.cell:focus { background: #eff6ff; box-shadow: inset 0 0 0 2px var(--accent); }
.items-table select.cell {
    width: 100%; border: none; padding: 8px 6px; font-size: 14px; outline: none;
    background: transparent; cursor: pointer; text-align: center;
}
.items-table select.cell:focus { background: #eff6ff; box-shadow: inset 0 0 0 2px var(--accent); }
/* Fushat e llogaritura automatikisht (vetëm-lexim) */
.items-table input.calc {
    width: 100%; border: none; padding: 9px 8px; font-size: 14px; text-align: right;
    background: #f9fafb; color: var(--text); outline: none; cursor: default;
}
.items-table tfoot td {
    background: linear-gradient(180deg, #eef4ff, #e6eefc); font-weight: 700;
    padding: 12px 8px; text-align: right; border-color: #dbe2ee;
}
.items-table tfoot .tfoot-label { text-align: right; color: #334155; letter-spacing: .5px; }
.items-table output { font-weight: 800; color: var(--accent); font-size: 15px; }

.fatura-actions { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.vat-note { color: var(--muted); font-size: 13px; margin-right: auto; }

/* Fundi i faturës: veprimet majtas, përmbledhja + Ruaj djathtas */
.fatura-bottom {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 24px; margin-top: 18px; flex-wrap: wrap;
}
.fatura-bottom-left { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; max-width: 680px; }
/* Kutitë e komentit s'e zgjerojnë dot faqen/kolonat — kapen brenda kolonës së tyre. */
.fatura-bottom-left .fatura-koment { max-width: 100%; }
.fatura-bottom-left .fatura-koment textarea { max-width: 100% !important; }
.fatura-bottom-left .vat-note { margin: 0; }
.fatura-bottom-mid { flex: 1; display: flex; justify-content: flex-end; align-items: flex-start; padding-right: 8px; }
.fatura-bottom-mid .pay-box { max-width: 300px; }
.fatura-bottom-right { display: flex; flex-direction: column; gap: 12px; min-width: 320px; }

.fatura-summary {
    border: 1px solid #dbe2ee; border-radius: 12px; overflow: hidden;
    background: linear-gradient(180deg, #f7faff, #eef4fc);
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.fatura-summary .sum-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 18px; padding: 9px 16px; border-bottom: 1px solid #e6edf7;
    font-size: 14px; color: #334155;
}
.fatura-summary .sum-row:last-child { border-bottom: 0; }
.fatura-summary .sum-row span { font-weight: 600; }
.fatura-summary .sum-row output { font-weight: 800; color: var(--accent); font-size: 15px; }
.fatura-summary .sum-row.grand {
    background: linear-gradient(180deg, #e6eefc, #dbe7fb);
    border-top: 2px solid #cdd9ef;
}
.fatura-summary .sum-row.grand span { font-weight: 800; color: #1e293b; }
.fatura-summary .sum-row.grand output { font-size: 18px; }

.btn-save-big { width: 100%; padding: 13px; font-size: 15px; font-weight: 700; }

/* Numri i dokumentit si hiperlink -> hap faturën */
.doc-link {
    color: var(--accent); font-weight: 800; text-decoration: none;
    border-bottom: 1px dashed rgba(37,99,235,.5); padding-bottom: 1px;
    transition: color .15s, border-color .15s;
    display: inline-block; white-space: nowrap;   /* numri i faturës në një rresht, i plotë */
}
.doc-link:hover { color: #1d4ed8; border-bottom-color: #1d4ed8; }

/* ===== Pagesat / Inkasimi ===== */
.pay-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 18px; }
.pay-stat {
    flex: 1; min-width: 180px; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 14px 16px; background: linear-gradient(180deg,#f8fafc,#eef2f8);
    display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.pay-stat .ps-lbl { font-size: 12.5px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.pay-stat .ps-val { font-size: 22px; font-weight: 800; color: #1e293b; }
.pay-stat.ok  { border-color: #bbf7d0; background: linear-gradient(180deg,#f0fdf4,#dcfce7); }
.pay-stat.ok .ps-val { color: #15803d; }
.pay-stat.due { border-color: #fecaca; background: linear-gradient(180deg,#fef2f2,#fee2e2); }
.pay-stat.due .ps-val { color: #b91c1c; }

.pay-h3 { font-size: 15px; font-weight: 700; color: #334155; margin: 8px 0 10px; }

.pill { display: inline-block; padding: 3px 11px; border-radius: 14px; font-size: 12px; font-weight: 700; }
.pill-ok   { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.pill-part { background: #fef9c3; color: #a16207; border: 1px solid #fde68a; }
.pill-due  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.pill-free { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }

/* Etiketat e lëvizjeve te kartela (shitje/blerje/pagesa) */
.mv-tag {
    display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 800;
    letter-spacing: .3px; margin-right: 8px; vertical-align: middle;
}
.mv-tag.mv-shitje { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }   /* shitje = blu */
.mv-tag.mv-blerje { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }   /* blerje = portokalli */
.mv-tag.mv-payin  { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }   /* arkëtim = jeshile */
.mv-tag.mv-payout { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }   /* pagesë dalëse = kuqe */
.mv-tag.mv-open   { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }   /* fillestar = gri */
/* Theks i lehtë në rresht sipas llojit */
.mv-row.mv-shitje td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }
.mv-row.mv-blerje td:first-child { box-shadow: inset 3px 0 0 #f97316; }
.mv-row.mv-payin  td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
.mv-row.mv-payout td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.mv-row.mv-open   td:first-child { box-shadow: inset 3px 0 0 #94a3b8; }
.free-note { background: #f5f3ff; border: 1px solid #ddd6fe; color: #5b21b6; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin: 2px 0 12px; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.muted-sm { color: #94a3b8; }

.alert.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.modal-grid .full { grid-column: 1 / -1; }

/* Modali i paralajmërimit ligjor (kufiri i parave të gatshme) */
.modal-warn { max-width: 460px; }
.modal-warn .modal-head h3 { color: #b91c1c; }
.cash-warn-body {
    padding: 18px 20px; font-size: 15px; line-height: 1.55; color: #7f1d1d;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; margin: 4px 0 6px;
}

/* Kutia e mënyrës së pagesës (poshtë majtas) */
.pay-box {
    display: flex; flex-direction: column; gap: 6px;
    border: 1px solid #dbe2ee; border-radius: 12px;
    background: linear-gradient(180deg, #f7faff, #eef4fc);
    padding: 12px 14px; min-width: 260px;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.pay-box-label { font-size: 12.5px; font-weight: 700; color: #475569; letter-spacing: .2px; }
.pay-select {
    appearance: none; -webkit-appearance: none;
    width: 100%; padding: 9px 34px 9px 12px;
    border: 1px solid #cbd5e1; border-radius: 9px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center;
    font-size: 14px; font-weight: 600; color: #1e293b; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.pay-select:hover { border-color: #94a3b8; }
.pay-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

/* Pagesë e plotë / e pjesshme te regjistrimi i faturës */
.pay-amt-box { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed #cbd5e1; }
.pay-full-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #475569; cursor: pointer; }
.pay-full-row input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.pay-partial-row { display: flex; flex-direction: column; gap: 4px; }
.pay-amt-label { font-size: 11.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .3px; }
.pay-amt-input { width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 14px; font-weight: 700; color: #1e293b; text-align: right; box-sizing: border-box; }
.pay-amt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.pay-amt-hint { font-size: 11.5px; font-weight: 600; color: #64748b; min-height: 14px; }

.nav-help {
    margin-top: 16px; font-size: 13px; color: var(--muted);
    background: #f9fafb; border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px;
}
.nav-help kbd {
    background: #fff; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: 5px;
    padding: 1px 6px; font-size: 12px; font-family: monospace; color: var(--text);
}

@media (max-width: 768px) {
    .parties { grid-template-columns: 1fr; }
    .party label { flex: 0 0 100%; grid-template-columns: 90px 1fr; gap: 6px; }
}

/* ---------- MJETET E SUBJEKTIT ---------- */
.subject-tools {
    display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap;
    margin: 4px 0 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--border);
}
.btn-atk {
    background: #0e7490; color: #fff; border: none; padding: 9px 14px;
    border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-atk:hover { background: #155e75; }
.buyer-msg { font-size: 13px; margin: 0 0 8px; min-height: 16px; }
.buyer-msg.ok  { color: #166534; }
.buyer-msg.err { color: #b91c1c; }
.subject-search { position: relative; flex: 1; min-width: 180px; }
.subject-search input {
    width: 100%; padding: 9px 10px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 13px; outline: none;
}
.subject-search input:focus { border-color: var(--accent); }
.subject-results {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
    background: #fff; border: 1px solid var(--border); border-radius: 8px; margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto;
}
.subject-results.open { display: block; }
.sr-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.sr-item:hover { background: #eff6ff; }
.sr-name { display: block; font-weight: 600; font-size: 14px; }
.sr-sub { display: block; font-size: 12px; color: var(--muted); }
.sr-empty { padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* ---------- MODALI ---------- */
.modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 100;
    background: rgba(15,23,42,.55); align-items: flex-start; justify-content: center; padding: 40px 16px;
    overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: #fff; border-radius: 14px; width: 100%; max-width: 640px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35); padding: 22px 24px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-head h3 { font-size: 18px; }
.modal-close {
    background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal-hint { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.modal-hint a { color: var(--accent); font-weight: 600; }
.bookmarklet-box {
    background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 10px;
    padding: 12px 14px 14px; margin-bottom: 14px; font-size: 13px; color: var(--text);
}
.bookmarklet-box ol { margin: 8px 0 0 18px; line-height: 1.9; }
.bookmarklet-link {
    display: inline-block; background: #0e7490; color: #fff !important; text-decoration: none;
    padding: 5px 12px; border-radius: 7px; font-weight: 700; cursor: grab; margin-left: 4px;
}
.bookmarklet-link:hover { background: #155e75; }

.paste-box {
    background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 16px;
}
.paste-box label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.paste-box textarea {
    width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
    font-size: 13px; font-family: inherit; resize: vertical; outline: none;
}
.paste-box textarea:focus { border-color: var(--accent); }
.paste-box button { margin-top: 8px; }

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.modal-grid input, .modal-grid select {
    padding: 9px 10px; border: 1px solid var(--border); border-radius: 7px; font-size: 14px;
    outline: none; color: var(--text); background-color: #fff; font-family: inherit;
    width: 100%; box-sizing: border-box; height: 38px;
}
.modal-grid input:focus, .modal-grid select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
/* Fusha "Roli" (select) — të njëjtën pamje si fushat e tjera + shigjetë e vetën. */
.modal-grid select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer; padding-right: 30px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path fill='%2364748b' d='M6 8 0 0h12z'/></svg>");
    background-repeat: no-repeat; background-position: right 11px center;
}
.modal-grid label.chk input { height: auto; }
.modal-msg { margin-top: 14px; font-size: 14px; min-height: 18px; }
.modal-msg.ok  { color: #166534; }
.modal-msg.err { color: #b91c1c; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

@media (max-width: 620px) { .modal-grid { grid-template-columns: 1fr; } }

.overlay { display: none; }

/* ---------- MODET E MENUSË ANËSORE: i plotë / vetëm ikona / i fshehur ---------- */
.sidebar { transition: margin-left .25s ease, width .2s ease; }

/* I fshehur plotësisht (rrëshqet jashtë ekranit); body.sidebar-collapsed mbahet për pajtueshmëri */
html.sb-hidden .sidebar,
body.sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w, 250px)); }

/* Vetëm ikona (mini) — ngushtohet, fshihet teksti, mbeten ikonat */
html.sb-mini { --sidebar-w: 68px !important; }
html.sb-mini .sidebar-brand-name,
html.sb-mini .sidebar-brand-uniq,
html.sb-mini .nav-group,
html.sb-mini .nav-caret,
html.sb-mini .sidebar-footer,
html.sb-mini .sidebar-resizer { display: none; }
html.sb-mini .sidebar-brand { padding: 14px 4px; }
html.sb-mini .nav-item { justify-content: center; gap: 0; padding: 13px 0; font-size: 0; }
html.sb-mini .nav-item .nav-ico { font-size: 17px; width: auto; }
html.sb-mini .nav-sub { padding-left: 0; }
html.sb-mini .nav-group-toggle { justify-content: center; margin: 8px 8px 6px; padding: 11px 0; }
html.sb-mini .nav-group-toggle .ng-label { gap: 0; font-size: 0; }
html.sb-mini .nav-group-toggle .ng-label .nav-ico { font-size: 17px; width: auto; }
/* Butonat e kontekstit (Kontabiliteti / POS) — vetëm ikona në mini-mode (fshih tekstin, mbaj emoji-n) */
html.sb-mini .sb-ctx { flex-direction: column; gap: 6px; padding: 6px 8px; }
html.sb-mini .sb-ctx-btn { justify-content: center; gap: 0; font-size: 0; padding: 10px 0; }
html.sb-mini .sb-ctx-btn .nav-ico { font-size: 18px; width: auto; }

/* ===== Ngjyrat (skin) e sidebar-it — zgjedhet te Cilësitë (sidebar_color) ===== */
/* Variantet e errëta: vetëm gradienti ndryshon, teksti mbetet i bardhë */
html.sb-skin-blue     { --sidebar:#1e3a8a; --sidebar-2:#0f2557; }
html.sb-skin-navy     { --sidebar:#0b1f3a; --sidebar-2:#060f1f; }
html.sb-skin-green    { --sidebar:#14532d; --sidebar-2:#052e16; }
html.sb-skin-graphite { --sidebar:#3a4250; --sidebar-2:#1f2632; }

/* SILVER — sfond metalik i çelët me tekst të errët (lexueshmëri e plotë) */
html.sb-skin-silver { --sidebar:#eef1f5; --sidebar-2:#c6cdd8; }
html.sb-skin-silver .sidebar { color:#1f2937; }
html.sb-skin-silver .sidebar-brand { color:#0f172a; border-bottom-color:rgba(0,0,0,.12); }
html.sb-skin-silver .sidebar-brand-uniq { color:rgba(15,23,42,.6); }
html.sb-skin-silver .nav-item { color:#334155; }
html.sb-skin-silver .nav-item:hover { background:rgba(15,23,42,.08); color:#0f172a; }
html.sb-skin-silver .nav-item.active { background:rgba(37,99,235,.16); color:#1d4ed8; }
html.sb-skin-silver .nav-group { color:#5b6675; }
html.sb-skin-silver .nav-group-toggle { background:linear-gradient(180deg,rgba(15,23,42,.07),rgba(15,23,42,.03)); border-color:rgba(15,23,42,.14); color:#1f2937; box-shadow:0 1px 2px rgba(0,0,0,.08); }
html.sb-skin-silver .nav-group-toggle:hover { background:linear-gradient(180deg,rgba(37,99,235,.18),rgba(37,99,235,.10)); border-color:rgba(37,99,235,.45); color:#1d4ed8; }
html.sb-skin-silver .nav-caret { color:#2563eb; }
html.sb-skin-silver .sidebar-footer { border-top-color:rgba(0,0,0,.10); }
html.sb-skin-silver .sf-user { background:rgba(15,23,42,.05); border-color:rgba(15,23,42,.10); }
html.sb-skin-silver .sf-name { color:#0f172a; }
html.sb-skin-silver .sf-role { color:#64748b; }
html.sb-skin-silver .sf-cr { color:#64748b; border-top-color:rgba(0,0,0,.10); }
html.sb-skin-silver .sf-logout { color:#dc2626; }
html.sb-skin-silver .sidebar-nav { scrollbar-color:rgba(15,23,42,.35) transparent; }
html.sb-skin-silver .sidebar-nav::-webkit-scrollbar-thumb { background:rgba(15,23,42,.25); background-clip:padding-box; }

/* Tooltip me emrin e ikonës kur sidebar-i është "vetëm ikona" (shfaqet vetëm gjatë hover-it) */
.sb-tip {
    position: fixed; z-index: 1000; pointer-events: none;
    background: #0f172a; color: #fff; padding: 6px 11px; border-radius: 7px;
    font-size: 12.5px; font-weight: 600; white-space: nowrap;
    box-shadow: 0 6px 18px -4px rgba(0,0,0,.45);
    transform: translateY(-50%); opacity: 0; transition: opacity .12s ease;
}
.sb-tip.show { opacity: 1; }
.sb-tip::before {
    content: ''; position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
    border: 6px solid transparent; border-right-color: #0f172a;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 30;
        margin-left: -250px;
    }
    body.sidebar-open .sidebar { margin-left: 0; }
    body.sidebar-open .overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 20;
    }
    .topbar-title { font-size: 16px; }
    .user-badge { display: none; }
}

/* ---------- NGARKO FATURAT E BLERJEVE (folderat e blerjes me drag&drop) ---------- */
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.nb-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 3px rgba(15,23,42,.05); }
.nb-card-head { display: flex; align-items: center; gap: 9px; }
.nb-ico { font-size: 22px; }
.nb-title { font-weight: 800; color: #0f172a; font-size: 15px; }
.nb-desc { font-size: 12px; color: #64748b; margin-top: -4px; }
.nb-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    text-align: center; padding: 22px 12px; border: 2px dashed #cbd5e1; border-radius: 10px;
    background: #f8fafc; color: #475569; cursor: pointer; transition: border-color .15s, background .15s; }
.nb-drop:hover { border-color: #94a3b8; background: #f1f5f9; }
.nb-drop.drag { border-color: var(--accent, #2563eb); background: #eff6ff; color: #1d4ed8; }
.nb-drop-ico { font-size: 26px; }
.nb-drop-txt { font-size: 13px; line-height: 1.4; }
.nb-drop-txt small { color: #94a3b8; font-size: 11px; }
.nb-note { padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; font-size: 12.5px; }
.nb-uploads { display: flex; flex-direction: column; gap: 5px; }
.nb-up-row { display: flex; align-items: center; gap: 7px; font-size: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 7px; padding: 5px 8px; }
.nb-up-name { font-weight: 600; color: #0f172a; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-up-msg { color: #64748b; margin-left: auto; }
.nb-up-ok { background: #f0fdf4; border-color: #bbf7d0; }
.nb-up-err { background: #fef2f2; border-color: #fecaca; }
.nb-up-err .nb-up-msg { color: #b91c1c; }
.nb-status { border-top: 1px dashed #e2e8f0; padding-top: 8px; }
.nb-status-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; margin-bottom: 6px; }
.nb-refresh { border: 1px solid #e2e8f0; background: #fff; border-radius: 6px; cursor: pointer; padding: 1px 7px; color: #475569; }
.nb-refresh:hover { background: #f1f5f9; }
.nb-status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.nb-status-list li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.nb-empty { color: #cbd5e1; font-style: italic; }
.nb-st-badge { flex: 0 0 auto; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.nb-st-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; }
.nb-st-no { flex: 0 0 auto; color: #1d4ed8; font-weight: 700; font-size: 10.5px; }
.nb-pending { background: #fef9c3; color: #854d0e; }
.nb-done    { background: #dcfce7; color: #166534; }
.nb-error   { background: #fee2e2; color: #991b1b; }
.nb-read    { background: #e0e7ff; color: #3730a3; }
.nb-await   { background: #fef3c7; color: #92400e; }
