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

:root, [data-theme="temna"] {
    --bg:       #0a0f1c;
    --surface:  #1a2438;
    --surface2: #243356;
    --border:   #3c4f74;
    --text:     #f8fafc;
    --text-sec: #aebbd0;
    --text-dim: #7288ab;
    --primary:  #0ea5e9;
    --primary-h:#38bdf8;
    --shadow:       0 10px 28px rgba(0,0,0,.5);
    --shadow-sm:    0 3px 10px rgba(0,0,0,.4);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);
    --danger:   #ef4444;
    --success:  #22c55e;
    --warning:  #f59e0b;
    --yellow:   #f59e0b;
    --green:    #22c55e;
    --red:      #ef4444;
    --sidebar-w: 280px;
    --header-h:  56px;
    --banner-h:  34px;
    --copy-h:    26px;
    --bg-pattern: rgba(255,255,255,.045);
}
[data-theme="belo-modra"] {
    --bg:       #e7ecf3;
    --surface:  #ffffff;
    --surface2: #dde4ee;
    --border:   #b9c4d4;
    --text:     #0f172a;
    --text-sec: #3d4a61;
    --text-dim: #64748b;
    --primary:  #0284c7;
    --primary-h:#0369a1;
    --shadow:       0 10px 25px rgba(30,41,59,.14);
    --shadow-sm:    0 2px 8px rgba(30,41,59,.09);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
    --danger:   #dc2626;
    --success:  #16a34a;
    --warning:  #d97706;
    --yellow:   #d97706;
    --green:    #16a34a;
    --red:      #dc2626;
    --bg-pattern: rgba(15,23,42,.05);
}
[data-theme="zelena"] {
    --bg:       #050e08;
    --surface:  #12331f;
    --surface2: #1a472d;
    --border:   #2f6b45;
    --text:     #ecfdf5;
    --text-sec: #8fe6ac;
    --text-dim: #57c980;
    --primary:  #22c55e;
    --primary-h:#4ade80;
    --shadow:       0 10px 28px rgba(0,0,0,.55);
    --shadow-sm:    0 3px 10px rgba(0,0,0,.4);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);
    --danger:   #ef4444;
    --success:  #4ade80;
    --warning:  #fbbf24;
    --yellow:   #fbbf24;
    --green:    #4ade80;
    --red:      #ef4444;
    --bg-pattern: rgba(255,255,255,.045);
}
[data-theme="modra"] {
    --bg:       #0a1524;
    --surface:  #16304d;
    --surface2: #1f4363;
    --border:   #3a6690;
    --text:     #eaf3fc;
    --text-sec: #b8d4ef;
    --text-dim: #8fb8dd;
    --primary:  #6cb6e8;
    --primary-h:#8fcaf0;
    --shadow:       0 10px 28px rgba(0,0,0,.55);
    --shadow-sm:    0 3px 10px rgba(0,0,0,.4);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);
    --danger:   #ef4444;
    --success:  #22c55e;
    --warning:  #f59e0b;
    --yellow:   #f59e0b;
    --green:    #22c55e;
    --red:      #ef4444;
    --bg-pattern: rgba(255,255,255,.045);
}
[data-theme="oranzna"] {
    --bg:       #1f0f04;
    --surface:  #3a1c08;
    --surface2: #4d2610;
    --border:   #7a4518;
    --text:     #fff3e8;
    --text-sec: #ffc79a;
    --text-dim: #f0975a;
    --primary:  #f2884a;
    --primary-h:#ffa06b;
    --shadow:       0 10px 28px rgba(0,0,0,.55);
    --shadow-sm:    0 3px 10px rgba(0,0,0,.4);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);
    --danger:   #ef4444;
    --success:  #22c55e;
    --warning:  #fbbf24;
    --yellow:   #fbbf24;
    --green:    #22c55e;
    --red:      #ef4444;
    --bg-pattern: rgba(255,255,255,.045);
}
[data-theme="antracitna"] {
    --bg:       #101010;
    --surface:  #212121;
    --surface2: #2f2f2f;
    --border:   #4a4a4a;
    --text:     #f7f7f7;
    --text-sec: #b5b5b5;
    --text-dim: #8a8a8a;
    --primary:  #a78bfa;
    --primary-h:#c4b5fd;
    --shadow:       0 10px 28px rgba(0,0,0,.55);
    --shadow-sm:    0 3px 10px rgba(0,0,0,.4);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);
    --danger:   #ef4444;
    --success:  #22c55e;
    --warning:  #f59e0b;
    --yellow:   #f59e0b;
    --green:    #22c55e;
    --red:      #ef4444;
    --bg-pattern: rgba(255,255,255,.045);
}
[data-theme="rjava-rumena"] {
    --bg:       #2a1810;
    --surface:  #3d2717;
    --surface2: #4f3420;
    --border:   #6b4c33;
    --text:     #f7f0e0;
    --text-sec: #d3bb98;
    --text-dim: #a68a68;
    --primary:  #d9b354;
    --primary-h:#e8c876;
    --shadow:       0 10px 28px rgba(0,0,0,.55);
    --shadow-sm:    0 3px 10px rgba(0,0,0,.4);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);
    --danger:   #ef4444;
    --success:  #22c55e;
    --warning:  #f59e0b;
    --yellow:   #f59e0b;
    --green:    #22c55e;
    --red:      #ef4444;
    --bg-pattern: rgba(255,255,255,.045);
}
[data-theme="zelena-bela"] {
    --bg:       #1c3226;
    --surface:  #28402f;
    --surface2: #35503c;
    --border:   #4c6b53;
    --text:     #f2ece0;
    --text-sec: #cdd9ce;
    --text-dim: #93a894;
    --primary:  #c9b98a;
    --primary-h:#dbcba0;
    --shadow:       0 10px 28px rgba(0,0,0,.55);
    --shadow-sm:    0 3px 10px rgba(0,0,0,.4);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);
    --danger:   #ef4444;
    --success:  #22c55e;
    --warning:  #f59e0b;
    --yellow:   #f59e0b;
    --green:    #22c55e;
    --red:      #ef4444;
    --bg-pattern: rgba(255,255,255,.045);
}
[data-theme="bela-zelena"] {
    --bg:       #f0ece0;
    --surface:  #faf7f0;
    --surface2: #e7e0cf;
    --border:   #cfc3a8;
    --text:     #1c2e22;
    --text-sec: #4a5c4e;
    --text-dim: #7c8c7e;
    --primary:  #1f7a45;
    --primary-h:#2f9457;
    --shadow:       0 10px 25px rgba(30,41,59,.14);
    --shadow-sm:    0 2px 8px rgba(30,41,59,.09);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
    --danger:   #dc2626;
    --success:  #16a34a;
    --warning:  #d97706;
    --yellow:   #d97706;
    --green:    #16a34a;
    --red:      #dc2626;
    --bg-pattern: rgba(15,23,42,.05);
}
[data-theme="bez-crna"] {
    --bg:       #ede7d9;
    --surface:  #faf8f2;
    --surface2: #e3dcc9;
    --border:   #cbc0a2;
    --text:     #1a1712;
    --text-sec: #58503e;
    --text-dim: #857f68;
    --primary:  #221e17;
    --primary-h:#332d22;
    --shadow:       0 10px 25px rgba(30,41,59,.14);
    --shadow-sm:    0 2px 8px rgba(30,41,59,.09);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
    --danger:   #dc2626;
    --success:  #16a34a;
    --warning:  #d97706;
    --yellow:   #d97706;
    --green:    #16a34a;
    --red:      #dc2626;
    --bg-pattern: rgba(15,23,42,.05);
}
[data-theme="bez-bordo"] {
    --bg:       #e8ddc4;
    --surface:  #f5f0e2;
    --surface2: #ddd0ae;
    --border:   #c3b48c;
    --text:     #2a1216;
    --text-sec: #6b5842;
    --text-dim: #9c8b6a;
    --primary:  #5b2530;
    --primary-h:#6f303d;
    --shadow:       0 10px 25px rgba(30,41,59,.14);
    --shadow-sm:    0 2px 8px rgba(30,41,59,.09);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
    --danger:   #dc2626;
    --success:  #16a34a;
    --warning:  #d97706;
    --yellow:   #d97706;
    --green:    #16a34a;
    --red:      #dc2626;
    --bg-pattern: rgba(15,23,42,.05);
}
[data-theme="bela-opecna"] {
    --bg:       #efe6d8;
    --surface:  #faf6ee;
    --surface2: #e3d5bf;
    --border:   #cbb897;
    --text:     #2a1710;
    --text-sec: #7a5c46;
    --text-dim: #a4886c;
    --primary:  #a8492e;
    --primary-h:#bd5b3d;
    --shadow:       0 10px 25px rgba(30,41,59,.14);
    --shadow-sm:    0 2px 8px rgba(30,41,59,.09);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
    --danger:   #dc2626;
    --success:  #16a34a;
    --warning:  #d97706;
    --yellow:   #d97706;
    --green:    #16a34a;
    --red:      #dc2626;
    --bg-pattern: rgba(15,23,42,.05);
}
[data-theme="sinja-mornarska"] {
    --bg:       #d9ebf7;
    --surface:  #f0f8fc;
    --surface2: #c3ddef;
    --border:   #9dc3dd;
    --text:     #101b2e;
    --text-sec: #3d6b8a;
    --text-dim: #7096ae;
    --primary:  #1a2540;
    --primary-h:#2a3a5c;
    --shadow:       0 10px 25px rgba(30,41,59,.14);
    --shadow-sm:    0 2px 8px rgba(30,41,59,.09);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
    --danger:   #dc2626;
    --success:  #16a34a;
    --warning:  #d97706;
    --yellow:   #d97706;
    --green:    #16a34a;
    --red:      #dc2626;
    --bg-pattern: rgba(15,23,42,.05);
}
[data-theme="bela-mornarska"] {
    --bg:       #eee7d8;
    --surface:  #faf7ef;
    --surface2: #e0d6bf;
    --border:   #c7b99a;
    --text:     #14162a;
    --text-sec: #6f6552;
    --text-dim: #9c9179;
    --primary:  #1a2540;
    --primary-h:#2a3a5c;
    --shadow:       0 10px 25px rgba(30,41,59,.14);
    --shadow-sm:    0 2px 8px rgba(30,41,59,.09);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
    --danger:   #dc2626;
    --success:  #16a34a;
    --warning:  #d97706;
    --yellow:   #d97706;
    --green:    #16a34a;
    --red:      #dc2626;
    --bg-pattern: rgba(15,23,42,.05);
}
[data-theme="roza-siva"] {
    --bg:       #f3e2da;
    --surface:  #faf3ee;
    --surface2: #e8d3c8;
    --border:   #d3b8a8;
    --text:     #221f1f;
    --text-sec: #8a6a5e;
    --text-dim: #b09186;
    --primary:  #4c4548;
    --primary-h:#5f585c;
    --shadow:       0 10px 25px rgba(30,41,59,.14);
    --shadow-sm:    0 2px 8px rgba(30,41,59,.09);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
    --danger:   #dc2626;
    --success:  #16a34a;
    --warning:  #d97706;
    --yellow:   #d97706;
    --green:    #16a34a;
    --red:      #dc2626;
    --bg-pattern: rgba(15,23,42,.05);
}
[data-theme="rjava-modra"] {
    --bg:       #271b12;
    --surface:  #3a291b;
    --surface2: #4c3624;
    --border:   #684c34;
    --text:     #eef2f6;
    --text-sec: #c7b79f;
    --text-dim: #9c8567;
    --primary:  #6f93b3;
    --primary-h:#86a8c4;
    --shadow:       0 10px 28px rgba(0,0,0,.55);
    --shadow-sm:    0 3px 10px rgba(0,0,0,.4);
    --shadow-inset: inset 0 1px 0 rgba(255,255,255,.04);
    --danger:   #ef4444;
    --success:  #22c55e;
    --warning:  #f59e0b;
    --yellow:   #f59e0b;
    --green:    #22c55e;
    --red:      #ef4444;
    --bg-pattern: rgba(255,255,255,.045);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
    transition: background-color .25s ease, color .25s ease;
}

/* Mehek prehod ob menjavi teme — velja za glavne vidne elemente, ne le body */
header, main, .card, .btn, .tab-btn, .tenant-tab, .sms-subtab, .badge,
input, select, textarea, table, th, td, .modal-box, .login-box, .dropdown-menu {
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* Ozadje: tanke satovje (hexagon) linije v barvi teme — subtilno vidne nad var(--bg) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: var(--bg-pattern);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cpath d='M28 0L28 34' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cpath d='M0 50L0 16' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cpath d='M56 50L56 16' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cpath d='M28 0L28 34' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cpath d='M0 50L0 16' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Cpath d='M56 50L56 16' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E");
    -webkit-mask-repeat: repeat;
    mask-repeat: repeat;
    -webkit-mask-size: 56px 100px;
    mask-size: 56px 100px;
}
/* Vsebina mora biti nad ozadjem */
header, main, .login-wrap, #app, #toast, .modal-overlay { position: relative; z-index: 1; }

/* ── Prijavna stran ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow), var(--shadow-inset);
}
.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}
.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    text-shadow: 0 0 16px color-mix(in srgb, var(--primary) 45%, transparent);
}
.login-logo p {
    color: var(--text-sec);
    font-size: .85rem;
    margin-top: .25rem;
}

/* ── Obrazci ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: .82rem;
    color: var(--text-sec);
    margin-bottom: .35rem;
    font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: .55rem .75rem;
    font-size: .9rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s, background-color .25s ease, color .25s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ── Gumbi ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    transition: background .15s, opacity .15s, color .25s ease, border-color .25s ease;
}
.btn-primary  { background: var(--primary); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 45%, transparent); }
.btn-primary:hover { background: var(--primary-h); box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 60%, transparent); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-sec); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-sec); }
.btn-full     { width: 100%; justify-content: center; }
.btn-sm       { padding: .35rem .75rem; font-size: .8rem; }

/* ── Alert ── */
.alert {
    padding: .65rem .9rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .875rem;
}
.alert-error   { background: #450a0a; border: 1px solid var(--danger); color: #fca5a5; }
.alert-success { background: #052e16; border: 1px solid var(--success); color: #86efac; }

/* ── Glavni layout (najemodajalec) ── */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
#app-header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
    flex-shrink: 0;
    z-index: 10;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-shadow: var(--shadow-sm);
}
#app-header::-webkit-scrollbar { display: none; }
#app-header .logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    letter-spacing: -.5px;
    text-shadow: 0 0 16px color-mix(in srgb, var(--primary) 45%, transparent);
}
#app-header .user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--text-sec);
    font-size: .85rem;
}

/* Body: sidebar + main */
#app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease;
    flex-shrink: 0;
    overflow: hidden;
}
#sidebar-header {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#sidebar-header span {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-sec);
    letter-spacing: .08em;
    text-transform: uppercase;
}
#sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
}

/* Objekt v sidebaru */
.sidebar-property {
    margin-bottom: .25rem;
}
.sidebar-property-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 .5rem;
    transition: background .12s;
    font-weight: 600;
    font-size: .875rem;
}
.sidebar-property-header:hover { background: var(--surface2); }
.sidebar-property-header.active { background: var(--primary); color: #fff; }
.sidebar-property-header .arrow {
    margin-left: auto;
    font-size: .75rem;
    transition: transform .2s;
}
.sidebar-property-header.open .arrow { transform: rotate(90deg); }

/* Gospodinjstvo */
.sidebar-household {
    margin: .15rem .5rem .15rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.sidebar-household-header {
    padding: .4rem .65rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-sec);
    background: var(--surface2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: background .12s;
}
.sidebar-household-header:hover { background: var(--border); }
.sidebar-household-header.active { color: var(--primary); }

/* Najemnik v sidebaru */
.sidebar-tenant {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .65rem;
    font-size: .82rem;
    cursor: pointer;
    transition: background .12s;
    border-top: 1px solid var(--border);
}
.sidebar-tenant:hover { background: var(--surface2); }
.sidebar-tenant.active { background: var(--primary); color: #fff; }
.sidebar-tenant .avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-tenant.active .avatar { background: rgba(255,255,255,.3); }

/* Glavni panel */
#main-panel {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + var(--banner-h) + var(--copy-h));
    background: var(--bg);
}

/* Zavihki */
.tabs {
    display: flex;
    gap: .25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.tab-btn {
    padding: .55rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-sec);
    cursor: pointer;
    font-size: .875rem;
    font-weight: 500;
    font-family: inherit;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); text-shadow: 0 0 14px color-mix(in srgb, var(--primary) 50%, transparent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Kartice */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm), var(--shadow-inset),
        0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent),
        0 0 16px -6px color-mix(in srgb, var(--primary) 45%, transparent);
    transition: box-shadow .2s, transform .2s, background-color .25s ease, border-color .25s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow),
        0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent),
        0 0 26px -4px color-mix(in srgb, var(--primary) 65%, transparent),
        var(--shadow-inset);
}
.card-title {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-sec);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.card-title, .card > h3 {
    text-shadow: 0 0 14px color-mix(in srgb, var(--primary) 35%, transparent);
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: .75rem;
}
@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; }
    .dropdown-menu {
        position: fixed;
        left: .75rem;
        right: .75rem;
        top: 4rem;
        min-width: auto;
        max-width: none;
        z-index: 300;
    }
}
.field-label {
    font-size: .78rem;
    color: var(--text-sec);
    margin-bottom: .2rem;
}
.field-value {
    font-size: .9rem;
    color: var(--text);
}

/* Badge */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
}
.badge-green  { background: #052e16; color: #86efac; border: 1px solid var(--success); }
.badge-red    { background: #450a0a; color: #fca5a5; border: 1px solid var(--danger); }
.badge-yellow { background: #431407; color: #fde68a; border: 1px solid var(--warning); }

/* Tabela */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; padding: .6rem .75rem; color: var(--text-sec); font-size: .78rem; font-weight: 600; border-bottom: 1px solid var(--border); }
td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* Prazno stanje */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-sec);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: .75rem; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,.4), var(--shadow-inset);
}
.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}
.modal-actions {
    display: flex;
    gap: .65rem;
    margin-top: 1.25rem;
    justify-content: flex-end;
}

/* Toast */
#toast {
    position: fixed;
    bottom: 1.5rem; left: 50%;
    transform: translateX(-50%);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .65rem 1.25rem;
    border-radius: 99px;
    font-size: .875rem;
    z-index: 200;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow);
}
#toast.show { opacity: 1; }

/* Tenant panel (mobilni) */
.tenant-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}
.tenant-tabs {
    display: flex;
    overflow-x: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.tenant-tab {
    padding: .75rem 1.1rem;
    white-space: nowrap;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-sec);
    cursor: pointer;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: -1px;
}
.tenant-tab.active { color: var(--primary); border-bottom-color: var(--primary); text-shadow: 0 0 14px color-mix(in srgb, var(--primary) 50%, transparent); }
.tenant-content { padding: 1rem; padding-bottom: calc(1rem + var(--banner-h) + var(--copy-h)); max-width: 640px; margin: 0 auto; }

/* ── Mobilni sidebar ── */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        z-index: 50;
        box-shadow: 4px 0 20px rgba(0,0,0,.5);
    }
    #sidebar.sidebar-hidden {
        transform: translateX(calc(-1 * var(--sidebar-w) - 10px));
    }
    #sidebar-overlay {
        display: none;
        position: fixed;
        inset: var(--header-h) 0 0 0;
        background: rgba(0,0,0,.4);
        z-index: 49;
    }
    #sidebar-overlay.active { display: block; }
    #main-panel { width: 100%; }
    .logo { cursor: pointer; user-select: none; }
}
@media (min-width: 769px) {
    #sidebar-overlay { display: none !important; }
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + .4rem);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; min-width: 210px; z-index: 200;
    padding: .35rem 0; box-shadow: 0 8px 24px rgba(0,0,0,.45);
    display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
    display: block; width: 100%; padding: .55rem 1rem;
    background: none; border: none; text-align: left;
    color: var(--text); font-size: .875rem; font-family: inherit;
    cursor: pointer; transition: background .12s;
}
.dropdown-item:hover { background: var(--surface2); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Promo banner ── */
#promo-banner {
    position: fixed; bottom: calc(var(--copy-h) + 4px); left: 0; right: 0; z-index: 99;
    height: var(--banner-h);
    background: var(--surface2); border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
}
#promo-link {
    font-size: .72rem; font-weight: 600; color: var(--text-sec);
    text-decoration: none; display: flex; align-items: center; gap: .35rem;
    padding: 0 1rem; width: 100%; justify-content: center;
    transition: opacity .5s, color .15s;
}
#promo-link:active { opacity: .7; }
#promo-link:hover  { color: var(--text); }

/* ── SMS podzavihki ── */
.sms-subtabs {
    display: flex; gap: .35rem; margin-bottom: 1rem;
    border-bottom: 1px solid var(--border); padding-bottom: .5rem;
}
.sms-subtab {
    background: none; border: none; cursor: pointer;
    color: var(--text-sec); font-size: .875rem; font-family: inherit;
    padding: .35rem .75rem; border-radius: 6px; transition: background .15s, color .15s;
}
.sms-subtab:hover { background: var(--surface2); color: var(--text); }
.sms-subtab.active {
    background: var(--surface2); color: var(--primary); font-weight: 600;
}

/* ── Incident prikaz ── */
.inc-mobile { display: none; }
.inc-card {
    border-bottom: 1px solid var(--border);
    padding: .75rem 1rem;
}
.inc-card:last-child { border-bottom: none; }
.inc-card-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: .35rem;
}
.inc-card-datum {
    font-size: .8rem; font-weight: 600; color: var(--primary);
}
.inc-card-opis {
    font-size: .875rem; line-height: 1.45; margin-bottom: .3rem;
}
.inc-card-ukrep {
    font-size: .8rem; color: var(--text-sec);
}
.inc-card-label {
    font-weight: 600;
}
@media (max-width: 600px) {
    .inc-desktop { display: none; }
    .inc-mobile  { display: block; }
}

/* ── Spoštuj uporabnikovo nastavitev "manj gibanja" (OS/brskalnik) ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Copyright footer ── */
#copyright-footer {
    position: fixed; bottom: 4px; left: 0; right: 0; z-index: 99;
    height: var(--copy-h);
    background: var(--surface2); border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    font-size: .63rem; color: var(--text-sec); opacity: .7;
    user-select: none; pointer-events: none;
}
