/* ============================================================
   PRISTAR PORTAL — Izterjava terjatev
   Design: "digitalni ledger" — petrolejni ink + medenina,
   zneski v mono (IBM Plex Mono), Schibsted Grotesk / Manrope
   ============================================================ */

:root {
    /* barve — imena ostajajo zaradi obstojecih inline var() sklicev */
    --pp-ink: #0C2730;
    --pp-dark: #0C2730;
    --pp-dark-alt: #0A1F27;
    --pp-primary: #156578;
    --pp-primary-dark: #0E4552;
    --pp-primary-light: #2A8296;
    --pp-brass: #C89B3C;
    --pp-brass-soft: rgba(200,155,60,0.15);
    --pp-red: #BE3B43;
    --pp-orange: #D97E2B;
    --pp-yellow: #E5B93C;
    --pp-green: #2F8F5B;
    --pp-blue: #2B6CB0;
    --pp-purple: #6B5CA5;
    --pp-teal: #2A8296;
    --pp-gray: #6B7A80;
    --pp-light: #F1F5F4;
    --pp-border: #E3EAE8;
    --pp-shadow: 0 1px 2px rgba(12,39,48,0.05), 0 4px 16px rgba(12,39,48,0.06);
    --pp-shadow-lg: 0 2px 6px rgba(12,39,48,0.08), 0 14px 34px rgba(12,39,48,0.13);
    --pp-radius: 10px;
    --pp-radius-lg: 16px;
    --sidebar-width: 250px;
    /* tematske spremenljivke (privzeto = tema Ledger, svetla) */
    --bg-body: #EEF2F1;
    --bg-glow: radial-gradient(1100px 500px at 85% -10%, rgba(21,101,120,0.06), transparent 60%);
    --surface: #ffffff;
    --surface-2: #FAFCFB;
    --text: #23343B;
    --heading: #0C2730;
    --muted: #7A8B91;
    --line-2: #EEF3F1;
    --line-strong: #DCE5E2;
    --input-bg: #ffffff;
    --input-border: #D7E0DD;
    --hover-row: #F5FAF8;
    --card-border: rgba(12,39,48,0.05);
    --chip-active-bg: var(--pp-ink);
    --chip-count-bg: rgba(12,39,48,0.07);
    --toast-bg: var(--pp-ink);
    --toast-text: #E8EEEC;
    --rem-overdue-bg: #FDF7F7;
    --rem-today-bg: #FDFAF3;
    --sidebar-g1: #0E2E39;
    --sidebar-g2: #0A1F27;
    --f-display: 'Schibsted Grotesk', 'Segoe UI', sans-serif;
    --f-ui: 'Manrope', 'Segoe UI', sans-serif;
    --f-mono: 'IBM Plex Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    font-family: var(--f-ui);
    background: var(--bg-glow), var(--bg-body);
    color: var(--text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--pp-primary); text-decoration: none; }
a:hover { color: var(--pp-primary-dark); }
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--pp-brass);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: rgba(200,155,60,0.3); }

/* ============ LOGIN — diskretna, nevtralna stran ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(800px 500px at 30% -10%, rgba(42,130,150,0.18), transparent 60%),
        linear-gradient(165deg, #0E2E39 0%, var(--pp-dark-alt) 75%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--pp-radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
    padding: 38px 36px;
}
.login-card .logo-area { margin-bottom: 28px; }
.login-card .logo-icon {
    width: 50px; height: 50px;
    background: var(--pp-ink);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pp-brass);
    font-size: 20px;
    margin-bottom: 16px;
}
.login-card h2 {
    font-family: var(--f-display);
    font-size: 23px;
    font-weight: 700;
    color: var(--pp-ink);
    margin: 0 0 6px;
    position: relative;
    padding-bottom: 12px;
}
.login-card h2::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 44px; height: 3px;
    background: var(--pp-brass);
    border-radius: 2px;
}
.login-card .logo-area p { color: var(--pp-gray); font-size: 13px; margin: 10px 0 0; }
.login-error {
    background: #FBEDEE;
    color: #96343B;
    border: 1px solid #EFC6C9;
    border-radius: var(--pp-radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-g1) 0%, var(--sidebar-g2) 100%);
    color: #B7C6CB;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    color: inherit;
    transition: background 0.15s;
}
a.brand:hover { background: rgba(255,255,255,0.05); color: inherit; }
a.brand:hover .brand-icon { border-color: var(--pp-brass); }
.sidebar .brand .brand-icon {
    width: 40px; height: 40px;
    border: 1.5px solid rgba(200,155,60,0.5);
    background: rgba(200,155,60,0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pp-brass);
    font-size: 17px;
    flex-shrink: 0;
}
.sidebar .brand .brand-name {
    font-family: var(--f-display);
    font-weight: 700;
    color: #fff;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0.3px;
}
.sidebar .brand .brand-sub { font-size: 11px; color: #7C939A; letter-spacing: 0.3px; }

.sidebar nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #B7C6CB;
    border-radius: 9px;
    border-left: 3px solid transparent;
    margin-bottom: 3px;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar nav a i { width: 18px; text-align: center; font-size: 14px; opacity: 0.85; }
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active {
    background: rgba(255,255,255,0.08);
    border-left-color: var(--pp-brass);
    color: #fff;
    font-weight: 700;
}
.sidebar nav a.active i { color: var(--pp-brass); opacity: 1; }
.sidebar .nav-section {
    font-family: var(--f-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: #5E767E;
    padding: 16px 14px 6px;
}
.sidebar .user-box {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar .user-box .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--pp-brass);
    color: var(--pp-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12.5px;
    flex-shrink: 0;
}
.sidebar .user-box .user-name { font-size: 13px; color: #fff; font-weight: 700; line-height: 1.2; }
.sidebar .user-box .user-role { font-size: 11px; color: #7C939A; }
.sidebar .user-box a.logout { margin-left: auto; color: #7C939A; font-size: 15px; }
.sidebar .user-box a.logout:hover { color: #E58F96; }

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px 34px;
    min-width: 0;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 14px;
    flex-wrap: wrap;
}
.page-head h1 {
    font-family: var(--f-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--heading);
    margin: 0;
    position: relative;
    padding-bottom: 12px;
}
.page-head h1::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 44px; height: 3px;
    background: var(--pp-brass);
    border-radius: 2px;
}
.page-head h1 i { color: var(--pp-primary); margin-right: 12px; font-size: 20px; }
.page-head .sub { color: var(--pp-gray); font-size: 13px; margin-top: 6px; }

/* ============ KARTICE ============ */
.card {
    background: var(--surface);
    border-radius: var(--pp-radius-lg);
    box-shadow: var(--pp-shadow);
    border: 1px solid var(--card-border);
    margin-bottom: 22px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.card .card-head {
    padding: 16px 22px;
    border-bottom: 1px solid var(--pp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.card .card-head h2 {
    font-family: var(--f-display);
    font-size: 14.5px;
    font-weight: 700;
    margin: 0;
    color: var(--heading);
    letter-spacing: 0.2px;
}
.card .card-head h2 i { color: var(--pp-primary); margin-right: 9px; font-size: 13px; }
.card .card-body { padding: 22px; }
.card .card-body.p0 { padding: 0; }

/* ============ TABELE — ledger ============ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
    text-align: left;
    padding: 11px 16px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    border-bottom: 2px solid var(--line-strong);
    white-space: nowrap;
}
table.tbl td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}
table.tbl tr:hover td { background: var(--hover-row); }
table.tbl tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--pp-brass); }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl td.num {
    font-family: var(--f-mono);
    font-size: 12.5px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.tbl .row-link { font-weight: 700; color: var(--heading); }
.tbl .row-link:hover { color: var(--pp-primary); }

/* sortiranje */
table.tbl th.sortable { cursor: pointer; transition: color 0.15s; user-select: none; }
table.tbl th.sortable:hover { color: var(--pp-primary); }
table.tbl th.sortable .sort-ind { opacity: 0.35; margin-left: 5px; font-size: 10px; }
table.tbl th.sortable.sorted { color: var(--heading); }
table.tbl th.sortable.sorted .sort-ind { opacity: 1; color: var(--pp-brass); }

/* ============ GUMBI ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--pp-radius);
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    font-family: var(--f-ui);
    text-decoration: none;
    line-height: 1.3;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--pp-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(21,101,120,0.28);
}
.btn-primary:hover { background: var(--pp-primary-dark); color: #fff; }
.btn-light {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--input-border);
}
.btn-light:hover { background: var(--pp-light); }
.btn-danger { background: var(--pp-red); color: #fff; }
.btn-danger:hover { background: #A62F36; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* ============ FORME ============ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.form-group label .req { color: var(--pp-red); }
.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--input-border);
    border-radius: var(--pp-radius);
    font-size: 14px;
    font-family: var(--f-ui);
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--input-bg);
    color: var(--text);
}
.form-control:focus {
    outline: none;
    border-color: var(--pp-primary);
    box-shadow: 0 0 0 3px rgba(21,101,120,0.13);
}
textarea.form-control { resize: vertical; min-height: 70px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; font-weight: 500; }
.form-check input { width: 16px; height: 16px; accent-color: var(--pp-primary); }

/* ============ ZNACKE ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
}
.badge-teal   { background: rgba(42,130,150,0.12);  color: #1D6375; }
.badge-blue   { background: rgba(43,108,176,0.11);  color: #26588C; }
.badge-purple { background: rgba(107,92,165,0.12);  color: #56498C; }
.badge-green  { background: rgba(47,143,91,0.12);   color: #256E47; }
.badge-red    { background: rgba(190,59,67,0.11);   color: #9E3238; }
.badge-orange { background: rgba(217,126,43,0.13);  color: #A85F1B; }
.badge-yellow { background: rgba(229,185,60,0.18);  color: #8A6D14; }
.badge-gray   { background: rgba(107,122,128,0.12); color: #52646B; }

/* ============ STAT KARTICE ============ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
    background: var(--surface);
    border-radius: var(--pp-radius-lg);
    box-shadow: var(--pp-shadow);
    border: 1px solid var(--card-border);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.18s, box-shadow 0.18s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--pp-shadow-lg); }
.stat .stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.stat .stat-val {
    font-family: var(--f-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.stat .stat-lbl { font-size: 11.5px; color: var(--pp-gray); font-weight: 600; margin-top: 2px; }
.bg-primary { background: rgba(21,101,120,0.11);  color: var(--pp-primary); }
.bg-red     { background: rgba(190,59,67,0.11);   color: var(--pp-red); }
.bg-green   { background: rgba(47,143,91,0.12);   color: var(--pp-green); }
.bg-orange  { background: rgba(217,126,43,0.13);  color: var(--pp-orange); }
.bg-purple  { background: rgba(107,92,165,0.12);  color: var(--pp-purple); }

/* ============ OPOMNIKI ============ */
.reminder-strip { display: flex; flex-direction: column; gap: 8px; }
.reminder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    border: 1px solid var(--pp-border);
    border-left: 3px solid var(--pp-primary);
    border-radius: var(--pp-radius);
    background: var(--surface);
    transition: box-shadow 0.15s;
}
.reminder-item:hover { box-shadow: var(--pp-shadow); }
.reminder-item.overdue { border-left-color: var(--pp-red); background: var(--rem-overdue-bg); }
.reminder-item.today { border-left-color: var(--pp-orange); background: var(--rem-today-bg); }
.reminder-item .r-date {
    font-family: var(--f-mono);
    font-weight: 600;
    font-size: 11.5px;
    white-space: nowrap;
    width: 84px;
    color: #52646B;
}
.reminder-item.overdue .r-date { color: var(--pp-red); }
.reminder-item.today .r-date { color: var(--pp-orange); }
.reminder-item .r-text { flex: 1; font-size: 13.5px; }
.reminder-item .r-text .r-partner { font-weight: 700; color: var(--heading); }
.reminder-item .r-text .r-partner:hover { color: var(--pp-primary); }

/* ============ TIMELINE ============ */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 10px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--line-strong), var(--line-2));
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .tl-dot {
    position: absolute;
    left: -30px; top: 2px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--pp-primary);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 1.5px var(--line-strong);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}
.tl-item .tl-dot.dot-email { background: var(--pp-blue); }
.tl-item .tl-dot.dot-sms { background: var(--pp-purple); }
.tl-item .tl-dot.dot-import { background: #8A9BA1; }
.tl-item .tl-head { font-size: 13.5px; margin-bottom: 4px; }
.tl-item .tl-head strong { color: var(--heading); }
.tl-item .tl-meta {
    font-family: var(--f-mono);
    font-size: 11px;
    color: #7A8B91;
}
.tl-item .tl-body {
    margin-top: 8px;
    background: var(--surface-2);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    padding: 11px 15px;
    font-size: 13px;
    white-space: pre-wrap;
    line-height: 1.55;
}
.tl-month {
    font-family: var(--f-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    display: inline-block;
    padding: 4px 14px;
    margin: 4px 0 16px -30px;
    position: relative;
    z-index: 1;
}

/* ============ SPARKLINE ============ */
.sparkline-wrap { padding: 8px 22px 14px; }
.sparkline-wrap svg { width: 100%; height: 70px; display: block; }
.sparkline-wrap .text-muted { font-family: var(--f-mono); }

/* ============ MODALI ============ */
.modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,26,32,0.55);
    backdrop-filter: blur(3px);
    z-index: 500;
    align-items: flex-start;
    justify-content: center;
    padding: 44px 16px;
    overflow-y: auto;
}
.modal-bg.open { display: flex; }
.modal {
    background: var(--surface);
    border-radius: var(--pp-radius-lg);
    box-shadow: var(--pp-shadow-lg);
    width: 100%;
    max-width: 720px;
    animation: modalIn 0.2s ease-out;
}
.modal.modal-sm { max-width: 480px; }
@keyframes modalIn {
    from { transform: translateY(-12px) scale(0.99); opacity: 0; }
    to { transform: none; opacity: 1; }
}
.modal .modal-head {
    padding: 17px 24px;
    border-bottom: 1px solid var(--pp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal .modal-head h3 {
    font-family: var(--f-display);
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--heading);
}
.modal .modal-head h3 i { color: var(--pp-primary); margin-right: 9px; font-size: 14px; }
.modal .modal-close {
    background: none;
    border: none;
    font-size: 17px;
    color: #8A9BA1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}
.modal .modal-close:hover { background: var(--pp-light); color: var(--heading); }
.modal .modal-body { padding: 22px 24px; }
.modal .modal-foot {
    padding: 15px 24px;
    border-top: 1px solid var(--pp-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--surface-2);
    border-radius: 0 0 var(--pp-radius-lg) var(--pp-radius-lg);
}

/* ============ OPOZORILA ============ */
.alert {
    padding: 12px 16px;
    border-radius: var(--pp-radius);
    margin-bottom: 16px;
    font-size: 13.5px;
    border: 1px solid transparent;
    line-height: 1.55;
}
.alert-success { background: #EDF7F1; color: #256E47; border-color: #C9E7D6; }
.alert-error { background: #FBEDEE; color: #96343B; border-color: #EFC6C9; }
.alert-info { background: #EDF4F6; color: #14505F; border-color: #C8DDE3; }
.alert-warn { background: #FBF5E4; color: #8A6D14; border-color: #EEDFA9; }

/* ============ POMOZNI ============ */
.text-muted { color: var(--pp-gray); }
.text-red { color: var(--pp-red); }
.text-green { color: var(--pp-green); }
.fw-b { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.empty-state { text-align: center; padding: 42px 20px; color: #8A9BA1; font-size: 13.5px; }
.empty-state i { font-size: 32px; margin-bottom: 12px; opacity: 0.35; display: block; }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar .form-control { width: auto; }
.search-input { min-width: 230px; }

.demo-tag {
    background: var(--pp-brass);
    color: #fff;
    font-family: var(--f-mono);
    font-size: 9.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
    letter-spacing: 1.2px;
}

/* ============ FILTER CHIPS ============ */
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 9px;
    border: 1.5px solid var(--input-border);
    background: var(--surface);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    font-family: var(--f-ui);
}
.chip:hover { border-color: var(--pp-primary); color: var(--pp-primary); }
.chip.active {
    background: var(--chip-active-bg);
    border-color: var(--chip-active-bg);
    color: #fff;
    box-shadow: 0 3px 10px rgba(12,39,48,0.25);
}
.chip .chip-count {
    font-family: var(--f-mono);
    background: var(--chip-count-bg);
    border-radius: 6px;
    padding: 1px 7px;
    font-size: 10.5px;
    font-weight: 600;
}
.chip.active .chip-count { background: rgba(255,255,255,0.18); color: var(--pp-brass); }

/* ============ POGLED: PREKLOP ============ */
.view-toggle {
    display: inline-flex;
    border: 1.5px solid var(--input-border);
    border-radius: var(--pp-radius);
    overflow: hidden;
    background: var(--surface);
}
.view-toggle button {
    border: none;
    background: none;
    padding: 8px 13px;
    cursor: pointer;
    color: #8A9BA1;
    font-size: 13px;
    transition: all 0.15s;
}
.view-toggle button.active { background: var(--chip-active-bg); color: var(--pp-brass); }

/* ============ KARTICNI POGLED ============ */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 16px;
}
.pcard {
    background: var(--surface);
    border-radius: var(--pp-radius-lg);
    box-shadow: var(--pp-shadow);
    border: 1px solid var(--card-border);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.18s, box-shadow 0.18s;
    position: relative;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--pp-shadow-lg); }
.pcard .pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pcard .pcard-name { font-weight: 700; font-size: 14.5px; color: var(--heading); line-height: 1.35; }
.pcard .pcard-name a { color: inherit; }
.pcard .pcard-name a:hover { color: var(--pp-primary); }
.pcard .pcard-vat { font-family: var(--f-mono); font-size: 11px; color: #7A8B91; margin-top: 3px; }
.pcard .pcard-saldo {
    font-family: var(--f-mono);
    font-size: 17px;
    font-weight: 600;
    color: var(--pp-red);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.pcard .pcard-meta { font-size: 12.5px; color: #667B82; display: flex; flex-direction: column; gap: 5px; line-height: 1.5; }
.pcard .pcard-meta i { width: 15px; text-align: center; opacity: 0.6; }
.pcard .pcard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line-2);
}
.pcard .rank-badge {
    position: absolute;
    top: -9px; left: -9px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--pp-ink);
    color: #fff;
    font-family: var(--f-mono);
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(12,39,48,0.35);
    border: 2px solid var(--surface);
}
.pcard .rank-badge.gold { background: var(--pp-brass); color: var(--pp-ink); }

/* ============ SALDO BAR ============ */
.saldo-cell { min-width: 160px; }
.saldo-bar-wrap { height: 4px; background: var(--line-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.saldo-bar {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--pp-brass), var(--pp-red));
    transition: width 0.4s;
}

/* ============ TOASTI ============ */
#toastWrap {
    position: fixed;
    right: 20px; bottom: 20px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}
.toast {
    background: var(--toast-bg);
    color: var(--toast-text);
    border-radius: 12px;
    box-shadow: var(--pp-shadow-lg);
    border-left: 3px solid var(--pp-green);
    padding: 13px 16px;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: toastIn 0.25s ease-out;
    white-space: pre-line;
    line-height: 1.5;
}
.toast.toast-error { border-left-color: #E58F96; }
.toast.toast-info { border-left-color: var(--pp-brass); }
.toast i { margin-top: 2px; }
.toast.toast-ok i { color: #6FC79A; }
.toast.toast-error i { color: #E58F96; }
.toast.toast-info i { color: var(--pp-brass); }
.toast.hide { animation: toastOut 0.3s ease-in forwards; }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateX(40px); opacity: 0; } }

/* ============ MINI STAT ============ */
.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.mini-stat {
    flex: 1;
    min-width: 100px;
    background: var(--surface-2);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    padding: 10px 12px;
    text-align: center;
}
.mini-stat .ms-val { font-family: var(--f-display); font-size: 18px; font-weight: 700; color: var(--heading); }
.mini-stat .ms-lbl { font-size: 10.5px; color: var(--pp-gray); text-transform: uppercase; letter-spacing: 0.6px; }

/* ============ VSTOPNA ANIMACIJA ============ */
@media (prefers-reduced-motion: no-preference) {
    .main > * { animation: rise 0.4s ease both; }
    .main > *:nth-child(2) { animation-delay: 0.04s; }
    .main > *:nth-child(3) { animation-delay: 0.08s; }
    .main > *:nth-child(4) { animation-delay: 0.12s; }
    .main > *:nth-child(5) { animation-delay: 0.16s; }
    @keyframes rise {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: none; }
    }
}

/* ============ MOBILNI TOPBAR + DRAWER ============ */
.topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--pp-ink);
    color: #fff;
    padding: 12px 16px;
    align-items: center;
    gap: 14px;
}
.topbar .tb-burger {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
}
.topbar .tb-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
a.tb-title:hover { color: var(--pp-brass); }
.topbar .tb-title i { color: var(--pp-brass); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,26,32,0.55);
    z-index: 99;
}

@media (max-width: 900px) {
    .topbar { display: flex; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        display: flex;
        width: 272px;
        box-shadow: 5px 0 30px rgba(0,0,0,0.4);
    }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .sidebar-backdrop { display: block; }
    .main { margin-left: 0; padding: 16px 14px; }
    .page-head h1 { font-size: 20px; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat { padding: 13px 14px; gap: 10px; }
    .stat .stat-icon { width: 38px; height: 38px; font-size: 14px; border-radius: 10px; }
    .stat .stat-val { font-size: 16px; }
    .filter-bar { width: 100%; }
    .search-input { min-width: 0; flex: 1; }
    .modal-bg { padding: 12px 8px; }
    .modal .modal-body { padding: 16px; }
    .btn { padding: 9px 13px; }
    .partner-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr !important; }
    #toastWrap { left: 12px; right: 12px; max-width: none; }
    .reminder-item { flex-wrap: wrap; }
    .login-card { padding: 28px 22px; }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr !important; }
}

/* ============================================================
   TEME — privzeta je "ledger" (svetla, petrolej + medenina).
   Temni temi dobita se body.dark-mode s strukturnimi barvami.
   ============================================================ */

/* --- skupno za temni temi --- */
body.dark-mode {
    --bg-body: #0D181D;
    --bg-glow: radial-gradient(1100px 500px at 85% -10%, rgba(42,130,150,0.10), transparent 60%);
    --surface: #142731;
    --surface-2: #102028;
    --pp-light: #1B303A;
    --text: #C6D4D8;
    --heading: #EFF6F6;
    --muted: #8CA2AA;
    --pp-gray: #8CA2AA;
    --pp-border: rgba(255,255,255,0.09);
    --line-2: rgba(255,255,255,0.06);
    --line-strong: rgba(255,255,255,0.15);
    --input-bg: #102028;
    --input-border: #2C434E;
    --hover-row: rgba(42,130,150,0.10);
    --card-border: rgba(255,255,255,0.05);
    --chip-active-bg: var(--pp-primary);
    --chip-count-bg: rgba(255,255,255,0.10);
    --toast-bg: #1D3641;
    --rem-overdue-bg: rgba(190,59,67,0.12);
    --rem-today-bg: rgba(217,126,43,0.12);
    --pp-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.35);
    --pp-shadow-lg: 0 2px 6px rgba(0,0,0,0.4), 0 14px 34px rgba(0,0,0,0.5);
}
body.dark-mode .badge-teal   { color: #7FC8D8; }
body.dark-mode .badge-blue   { color: #8FB6E8; }
body.dark-mode .badge-purple { color: #B4A7E3; }
body.dark-mode .badge-green  { color: #7FCBA2; }
body.dark-mode .badge-red    { color: #EC9BA0; }
body.dark-mode .badge-orange { color: #EDB077; }
body.dark-mode .badge-yellow { color: #E8CE7E; }
body.dark-mode .badge-gray   { color: #AEBEC4; }
body.dark-mode .alert-success { background: rgba(47,143,91,0.14);  color: #8AD3AC; border-color: rgba(47,143,91,0.35); }
body.dark-mode .alert-error   { background: rgba(190,59,67,0.14);  color: #EFA6AB; border-color: rgba(190,59,67,0.35); }
body.dark-mode .alert-info    { background: rgba(42,130,150,0.14); color: #93C9D6; border-color: rgba(42,130,150,0.35); }
body.dark-mode .alert-warn    { background: rgba(229,185,60,0.12); color: #E8CE7E; border-color: rgba(229,185,60,0.3); }
body.dark-mode .nav-doc h4 { color: var(--heading); }
body.dark-mode .nav-doc p, body.dark-mode .nav-doc li { color: var(--text); }
body.dark-mode .text-red { color: #EC9BA0; }
body.dark-mode .text-green { color: #7FCBA2; }
body.dark-mode .pcard .pcard-saldo { color: #EC9BA0; }
body.dark-mode .fw-b.text-red { color: #EC9BA0; }

/* --- 2: Smaragd (svetla, zelena + peščeno zlata) --- */
body[data-theme="smaragd"] {
    --pp-primary: #1E7A52;
    --pp-primary-dark: #145A3B;
    --pp-primary-light: #2FA06C;
    --pp-teal: #2FA06C;
    --pp-brass: #B08D3E;
    --pp-ink: #0D2B20;
    --heading: #0D2B20;
    --sidebar-g1: #0F3527;
    --sidebar-g2: #09231A;
    --bg-glow: radial-gradient(1100px 500px at 85% -10%, rgba(30,122,82,0.07), transparent 60%);
    --chip-active-bg: #0D2B20;
    --toast-bg: #0D2B20;
}

/* --- 3: Kraljevska modra (svetla, modra + baker) --- */
body[data-theme="kraljevska"] {
    --pp-primary: #2B5DA8;
    --pp-primary-dark: #1E4379;
    --pp-primary-light: #4B7BC4;
    --pp-teal: #4B7BC4;
    --pp-brass: #C07A35;
    --pp-ink: #14263F;
    --heading: #14263F;
    --sidebar-g1: #162945;
    --sidebar-g2: #0C1930;
    --bg-glow: radial-gradient(1100px 500px at 85% -10%, rgba(43,93,168,0.07), transparent 60%);
    --chip-active-bg: #14263F;
    --toast-bg: #14263F;
}

/* --- 4: Temna (oglje + medenina) --- */
body[data-theme="temna"] {
    --pp-primary: #2F8296;
    --pp-primary-dark: #226274;
    --pp-primary-light: #4BA2B6;
    --pp-brass: #CDA24D;
    --sidebar-g1: #131A1E;
    --sidebar-g2: #0B1013;
    --bg-body: #101518;
    --surface: #191F24;
    --surface-2: #14191D;
    --pp-light: #212930;
    --input-bg: #14191D;
    --input-border: #333E46;
    --bg-glow: radial-gradient(1100px 500px at 85% -10%, rgba(205,162,77,0.05), transparent 60%);
}

/* --- 5: Polnoč (temno modra + cian) --- */
body[data-theme="polnoc"] {
    --pp-primary: #3D9BB5;
    --pp-primary-dark: #2C7A90;
    --pp-primary-light: #5FB8CF;
    --pp-brass: #D6AC55;
    --sidebar-g1: #0B1D2E;
    --sidebar-g2: #060F1A;
    --bg-body: #0A141D;
    --surface: #10222F;
    --surface-2: #0C1B26;
    --pp-light: #16293A;
    --input-bg: #0C1B26;
    --input-border: #27404F;
    --bg-glow: radial-gradient(1100px 500px at 85% -10%, rgba(61,155,181,0.10), transparent 60%);
}

/* ============ IZBIRNIK TEME (nastavitve) ============ */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-swatch {
    border: 2px solid var(--pp-border);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    background: var(--surface);
    transition: border-color 0.15s, transform 0.12s;
    text-align: left;
    font-family: inherit;
}
.theme-swatch:hover { transform: translateY(-2px); border-color: var(--pp-primary); }
.theme-swatch.active { border-color: var(--pp-brass); box-shadow: 0 0 0 3px var(--pp-brass-soft); }
.theme-swatch .ts-preview {
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    margin-bottom: 8px;
    border: 1px solid rgba(0,0,0,0.08);
}
.theme-swatch .ts-side { width: 26%; }
.theme-swatch .ts-body { flex: 1; position: relative; }
.theme-swatch .ts-body::after {
    content: '';
    position: absolute;
    left: 10px; top: 12px;
    width: 55%; height: 6px;
    border-radius: 3px;
    background: var(--ts-accent, #C89B3C);
}
.theme-swatch .ts-body::before {
    content: '';
    position: absolute;
    left: 10px; top: 26px;
    width: 75%; height: 14px;
    border-radius: 4px;
    background: var(--ts-card, #fff);
    border: 1px solid rgba(0,0,0,0.07);
}
.theme-swatch .ts-name { font-size: 12.5px; font-weight: 700; color: var(--heading); }
.theme-swatch .ts-desc { font-size: 11px; color: var(--muted); }
