/* =====================================================================
   M9 Radnici — dizajn sistem
   ===================================================================== */

/* ------------------------------------------------------------ tokeni */
:root {
    --bg:            #f4f6fb;
    --bg-elev:       #ffffff;
    --bg-soft:       #f8fafc;
    --bg-hover:      #f1f5f9;
    --sidebar:       #10162a;
    --sidebar-soft:  #1a2340;
    --sidebar-text:  #93a1c0;
    --sidebar-active:#ffffff;

    --text:          #101828;
    --text-soft:     #475467;
    --text-mut:      #8a94a6;
    --border:        #e3e8ef;
    --border-strong: #cdd5df;

    --primary:       #3b5bfd;
    --primary-dark:  #2c46d8;
    --primary-soft:  #eef2ff;
    --primary-text:  #ffffff;

    --ok:      #0e9f6e;  --ok-soft:   #e7f7f0;
    --warn:    #d97706;  --warn-soft: #fdf3e3;
    --bad:     #e0374a;  --bad-soft:  #fdeced;
    --info:    #0a7ea4;  --info-soft: #e6f4f9;
    --mut:     #667085;  --mut-soft:  #f1f3f7;

    --radius:    10px;
    --radius-sm: 7px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
    --shadow:    0 2px 6px rgba(16,24,40,.07), 0 1px 2px rgba(16,24,40,.04);
    --shadow-lg: 0 12px 32px rgba(16,24,40,.14), 0 3px 8px rgba(16,24,40,.06);

    --sidebar-w: 250px;
    --topbar-h:  62px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
    --bg:            #0c111d;
    --bg-elev:       #151b28;
    --bg-soft:       #1a2131;
    --bg-hover:      #212a3b;
    --sidebar:       #080c16;
    --sidebar-soft:  #161e30;
    --sidebar-text:  #8593b0;

    --text:          #e8edf7;
    --text-soft:     #a8b3c7;
    --text-mut:      #71809a;
    --border:        #252d3d;
    --border-strong: #37415a;

    --primary:       #5a76ff;
    --primary-dark:  #4763f0;
    --primary-soft:  #1c2547;

    --ok-soft:   #0e2a20;
    --warn-soft: #2e2211;
    --bad-soft:  #33161b;
    --info-soft: #0d2733;
    --mut-soft:  #1e2532;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow:    0 2px 8px rgba(0,0,0,.45);
    --shadow-lg: 0 16px 40px rgba(0,0,0,.6);
}

/* ------------------------------------------------------------ osnova */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p  { margin: 0 0 10px; }

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

hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }

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

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    transition: transform .22s ease;
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 11px;
    padding: 0 18px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex: none;
}
.sidebar-brand:hover { text-decoration: none; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px; flex: none;
    background: linear-gradient(135deg, var(--primary), #7c4dff);
    display: grid; place-items: center;
    font-weight: 800; font-size: 13px; color: #fff; letter-spacing: -.02em;
}
.brand-name { font-weight: 680; font-size: 15px; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub  { font-size: 11px; color: var(--sidebar-text); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.nav-group { margin: 16px 0 5px; padding: 0 12px; font-size: 10.5px; font-weight: 700;
             letter-spacing: .09em; text-transform: uppercase; color: #58658a; }
.nav-group:first-child { margin-top: 2px; }

.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 8.5px 12px; margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13.5px; font-weight: 500;
    transition: background .13s, color .13s;
}
.nav-item:hover { background: var(--sidebar-soft); color: #dce3f5; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: var(--shadow-sm); }
.nav-item .ic { opacity: .9; }
.nav-badge {
    margin-left: auto; background: var(--bad); color: #fff;
    font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; min-width: 18px;
    text-align: center;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); }

.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11.5px; color: #56618a; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
    padding: 0 22px;
}
.topbar-title { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.topbar-spacer { flex: 1; }

.burger { display: none; background: none; border: 0; color: var(--text-soft); padding: 6px; cursor: pointer; }

.page { padding: 22px; max-width: 1600px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--text-mut); font-size: 13px; margin-top: 3px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------- globalna pretraga */
.gsearch { position: relative; width: 300px; max-width: 38vw; }
.gsearch input {
    width: 100%; height: 36px; padding: 0 12px 0 34px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-soft); color: var(--text); font-size: 13.5px; font-family: inherit;
}
.gsearch input:focus { outline: none; border-color: var(--primary); background: var(--bg-elev);
                       box-shadow: 0 0 0 3px var(--primary-soft); }
.gsearch .ic { position: absolute; left: 10px; top: 9px; color: var(--text-mut); width: 16px; height: 16px; }

/* ============================================================ dugmad */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg-elev); color: var(--text);
    font: inherit; font-size: 13.5px; font-weight: 550;
    cursor: pointer; white-space: nowrap;
    transition: background .13s, border-color .13s, box-shadow .13s, transform .06s;
    box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn .ic { width: 16px; height: 16px; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(.93); }

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child  { border-radius: 0 8px 8px 0; }

/* ============================================================= kartice */
.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    overflow: hidden;
}
.card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
}
.card-head h2 { font-size: 14.5px; font-weight: 650; }
.card-head .sub { font-size: 12.5px; color: var(--text-mut); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg-soft);
             display: flex; gap: 8px; align-items: center; }

/* mreže */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-sidebar { grid-template-columns: minmax(0,2fr) minmax(280px,1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
                             .grid-sidebar, .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 700px)  { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- stat */
.stat {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    display: flex; gap: 14px; align-items: flex-start;
}
.stat:hover { text-decoration: none; }
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.stat-ic {
    width: 40px; height: 40px; border-radius: 11px; flex: none;
    display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary);
}
.stat-ic.ok   { background: var(--ok-soft);   color: var(--ok); }
.stat-ic.warn { background: var(--warn-soft); color: var(--warn); }
.stat-ic.bad  { background: var(--bad-soft);  color: var(--bad); }
.stat-ic.info { background: var(--info-soft); color: var(--info); }
.stat-label { font-size: 12.5px; color: var(--text-mut); font-weight: 500; }
.stat-value { font-size: 25px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; color: var(--text); }
.stat-hint  { font-size: 12px; color: var(--text-mut); margin-top: 2px; }

/* ============================================================= tabele */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
    text-align: left; font-weight: 600; font-size: 11.5px;
    letter-spacing: .04em; text-transform: uppercase;
    color: var(--text-mut);
    padding: 10px 14px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--bg-hover); }
table.tbl tr.row-link { cursor: pointer; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl td.mid, table.tbl th.mid { text-align: center; }
table.tbl td.actions { text-align: right; white-space: nowrap; width: 1%; }
table.tbl tfoot td { padding: 11px 14px; font-weight: 700; background: var(--bg-soft);
                     border-top: 2px solid var(--border-strong); font-variant-numeric: tabular-nums; }
table.tbl.compact td, table.tbl.compact th { padding: 7px 10px; }
.th-sort { color: inherit; }
.th-sort:hover { color: var(--primary); text-decoration: none; }

.cell-main { font-weight: 600; color: var(--text); }
.cell-sub  { font-size: 12px; color: var(--text-mut); }

/* avatar */
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary);
    font-size: 12px; font-weight: 700; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 68px; height: 68px; font-size: 22px; }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.u-row { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------ bedževi */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    border: 1px solid transparent;
}
.badge-ok   { background: var(--ok-soft);   color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad  { background: var(--bad-soft);  color: var(--bad); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-mut  { background: var(--mut-soft);  color: var(--mut); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-dot::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 8px;
    background: var(--bg-soft); border: 1px solid var(--border);
    font-size: 12.5px; color: var(--text-soft);
}

/* ============================================================== forme */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 800px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
                            .form-grid .span-2, .form-grid .span-all { grid-column: auto; } }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field .hint { font-size: 11.5px; color: var(--text-mut); }
.req::after { content: ' *'; color: var(--bad); }

.inp, input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=search], select, textarea {
    width: 100%; height: 38px; padding: 0 11px;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: var(--bg-elev); color: var(--text);
    font: inherit; font-size: 13.5px;
    transition: border-color .13s, box-shadow .13s;
}
textarea { height: auto; min-height: 80px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
    padding-right: 30px;
}
.inp:focus, input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
input:disabled, select:disabled, textarea:disabled, .inp:disabled {
    background: var(--bg-soft); color: var(--text-mut); cursor: not-allowed;
}
input.err, select.err, textarea.err { border-color: var(--bad); }
.field-err { font-size: 11.5px; color: var(--bad); }

.inp-money { text-align: right; font-variant-numeric: tabular-nums; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input[type=checkbox], .check input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }

.switch { display:inline-flex; align-items:center; gap:9px; cursor:pointer; }
.switch input { position:absolute; opacity:0; width:0; height:0; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong);
                 position: relative; transition: background .15s; flex: none; }
.switch .track::after { content:''; position:absolute; top:2px; left:2px; width:18px; height:18px;
                        border-radius:50%; background:#fff; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }

.form-actions { display: flex; gap: 9px; align-items: center; padding-top: 4px; }
.form-actions .spacer { flex: 1; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
fieldset > legend {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-mut); padding: 0 0 10px; width: 100%;
    border-bottom: 1px solid var(--border); margin-bottom: 16px;
}

/* filter traka */
.filters {
    display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
    padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--bg-soft);
}
.filters .inp, .filters input, .filters select { height: 34px; font-size: 13px; width: auto; min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }
.filters .spacer { flex: 1; }

/* ============================================================ poruke */
.alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 11px 14px; border-radius: var(--radius);
    border: 1px solid transparent; margin-bottom: 14px; font-size: 13.5px;
}
.alert .ic { margin-top: 1px; }
.alert-success { background: var(--ok-soft);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert-error   { background: var(--bad-soft);  color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert-info    { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast {
    background: var(--bg-elev); border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 11px 14px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start;
    animation: toast-in .22s ease;
}
.toast.success { border-left-color: var(--ok); }
.toast.error   { border-left-color: var(--bad); }
.toast.warning { border-left-color: var(--warn); }
.toast .x { margin-left: auto; cursor: pointer; color: var(--text-mut); background: none; border: 0; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }

/* prazno stanje */
.empty { text-align: center; padding: 46px 20px; color: var(--text-mut); }
.empty .ic { width: 40px; height: 40px; stroke-width: 1.3; margin-bottom: 12px; color: var(--border-strong); }
.empty h3 { font-size: 15px; color: var(--text-soft); margin-bottom: 5px; }
.empty p { font-size: 13px; margin-bottom: 14px; }

/* ============================================================= tabovi */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
    padding: 9px 14px; font-size: 13.5px; font-weight: 550; color: var(--text-mut);
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { font-size: 11px; background: var(--mut-soft); padding: 1px 6px; border-radius: 999px; margin-left: 5px; }

/* ------------------------------------------------------ opis / detalji */
.dl { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 0; font-size: 13.5px; }
.dl dt { padding: 8px 0; color: var(--text-mut); font-size: 12.5px; border-bottom: 1px solid var(--border); }
.dl dd { padding: 8px 0; margin: 0; border-bottom: 1px solid var(--border); font-weight: 500; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

/* ------------------------------------------------------------ modal */
.modal-bg {
    position: fixed; inset: 0; background: rgba(16,24,40,.5); backdrop-filter: blur(2px);
    display: grid; place-items: center; z-index: 150; padding: 20px;
}
.modal {
    background: var(--bg-elev); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 460px; max-height: 90vh; overflow: auto;
    animation: modal-in .16s ease;
}
.modal.wide { max-width: 800px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }

/* ------------------------------------------------------- korisnički meni */
.usermenu { position: relative; }
.usermenu-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0;
                padding: 4px 6px; border-radius: 8px; cursor: pointer; color: var(--text); font: inherit; }
.usermenu-btn:hover { background: var(--bg-hover); }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; z-index: 100;
}
.dropdown[hidden] { display: none; }
.dropdown a, .dropdown button {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 8px 10px; border-radius: var(--radius-sm);
    font-size: 13.5px; color: var(--text); background: none; border: 0; font: inherit;
    cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg-hover); text-decoration: none; }
.dropdown .sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown .head { padding: 8px 10px 6px; font-size: 12px; color: var(--text-mut); }

/* ------------------------------------------------------------ ostalo */
.muted { color: var(--text-mut); }
.soft  { color: var(--text-soft); }
.small { font-size: 12.5px; }
.strong{ font-weight: 650; }
.nums  { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center{ text-align: center; }
.nowrap{ white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.pagination { display: flex; gap: 5px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); }
.pagination a, .pagination span {
    min-width: 32px; height: 32px; padding: 0 9px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--text-soft); border: 1px solid transparent;
}
.pagination a:hover { background: var(--bg-hover); text-decoration: none; }
.pagination .cur { background: var(--primary); color: #fff; font-weight: 600; }
.pagination .info { margin-left: auto; color: var(--text-mut); font-size: 12.5px; }

.progress { height: 6px; background: var(--mut-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.progress.warn > span { background: var(--warn); }
.progress.bad  > span { background: var(--bad); }

/* ==================================================== prijava (login) */
.login-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
      radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent),
      radial-gradient(800px 500px at 100% 110%, rgba(124,77,255,.16), transparent),
      var(--bg);
}
.login-card {
    width: 100%; max-width: 400px; background: var(--bg-elev);
    border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
    padding: 32px 30px;
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; }

/* ================================================== obračun (grid unos) */
/* tabela se ne rasteže — kolone ostaju uske, višak se skroluje vodoravno */
.payroll-grid { font-size: 13px; width: auto; min-width: 100%; }
.payroll-grid th { position: sticky; top: 0; padding-left: 8px; padding-right: 8px; }
.payroll-grid td { padding: 4px 5px; }
.payroll-grid input {
    height: 30px; padding: 0 7px; font-size: 13px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-elev); text-align: right;
    font-variant-numeric: tabular-nums; width: 86px;
}
.payroll-grid input:hover { border-color: var(--border-strong); }
.payroll-grid input[readonly] { background: var(--bg-soft); color: var(--text-mut); border-color: transparent; }
.payroll-grid input:focus { border-color: var(--primary); background: var(--bg-elev);
                            box-shadow: 0 0 0 3px var(--primary-soft); }
.payroll-grid input.changed { background: var(--warn-soft); }
.payroll-grid td.calc { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600;
                        background: var(--bg-soft); }
.payroll-grid td.name { white-space: nowrap; font-weight: 600; position: sticky; left: 0;
                        background: var(--bg-elev); z-index: 1; }
.payroll-grid tbody tr:hover td.name { background: var(--bg-hover); }
.payroll-grid .grp { border-left: 2px solid var(--border); }

.savebar {
    position: sticky; bottom: 0; z-index: 30;
    background: var(--bg-elev); border-top: 1px solid var(--border);
    padding: 11px 18px; display: flex; gap: 10px; align-items: center;
    box-shadow: 0 -3px 12px rgba(16,24,40,.06);
}

/* ------------------------------------------------------------- mobilno */
.sidebar-scrim { display: none; }
@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .sidebar-scrim.show { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 55; }
    .main { margin-left: 0; }
    .burger { display: inline-flex; }
    .gsearch { display: none; }
    .page { padding: 16px 14px; }
    .topbar { padding: 0 14px; }
}

/* --------------------------------------------------------------- štampa */
@media print {
    .sidebar, .topbar, .page-actions, .filters, .savebar, .pagination, .no-print { display: none !important; }
    .main { margin-left: 0; }
    .page { padding: 0; }
    .card { border: 0; box-shadow: none; }
    body { background: #fff; }
}
