/* ==========================================================================
   URO – urudžbeni zapisnik · dizajn sustav
   Jedan stylesheet za cijelu aplikaciju (bez Bootstrapa i custom.css)
   ========================================================================== */

:root {
    --bg: #f3f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e3e8ef;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #8492a6;
    --primary: #2f5bea;
    --primary-hover: #2448c4;
    --primary-soft: #eaf0ff;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #15803d;
    --success-soft: #ecfdf3;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --sidebar: #101a2e;
    --sidebar-2: #1a2742;
    --sidebar-text: #aab6cd;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
    --sidebar-w: 248px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

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

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; }

/* --------------------------------------------------------------------------
   Kostur: bočna navigacija + sadržaj
   -------------------------------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--sidebar);
    color: var(--sidebar-text);
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
    color: #fff;
}
.brand:hover { color: #fff; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .06em;
}
.brand-name { font-weight: 650; font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--sidebar-text); }

.side-section { padding: 6px 12px; }
.side-label {
    padding: 12px 10px 6px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #6b7a96;
}

.side-nav { list-style: none; margin: 0; padding: 0; }
.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-weight: 500;
}
.side-nav a i { width: 18px; text-align: center; font-size: 14px; opacity: .85; }
.side-nav a:hover { background: var(--sidebar-2); color: #fff; }
.side-nav a.active { background: var(--primary); color: #fff; }
.side-nav a.active i { opacity: 1; }

.dept-switch select {
    width: 100%;
    padding: 9px 32px 9px 12px;
    border: 1px solid #2b3a59;
    border-radius: 8px;
    background: var(--sidebar-2) 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='%23aab6cd' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: #fff;
    font: inherit;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.dept-switch select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.side-foot {
    margin-top: auto;
    padding: 14px 12px 16px;
    border-top: 1px solid #1f2d4a;
}
.user-card { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 8px; }
.user-card .avatar { margin-right: 4px; }
.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2b3a59;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.user-meta { flex: 1; min-width: 0; }
.user-name, .user-role { display: block; }
.user-name { color: #fff; font-weight: 550; font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11.5px; }
.logout-btn {
    margin-left: auto;
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
}
.logout-btn:hover { background: var(--sidebar-2); color: #fff; }
.credit { display: block; padding: 10px 8px 0; font-size: 11px; color: #5d6c89; }
.credit:hover { color: var(--sidebar-text); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); }
.content { max-width: 1280px; margin: 0 auto; padding: 28px 32px 56px; }
.content.narrow { max-width: 860px; }

.topbar { display: none; }

/* --------------------------------------------------------------------------
   Zaglavlje stranice
   -------------------------------------------------------------------------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-title { font-size: 24px; font-weight: 680; letter-spacing: -.015em; line-height: 1.2; }
.page-sub { margin-top: 4px; color: var(--text-2); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.crumb:hover { color: var(--primary); }

/* --------------------------------------------------------------------------
   Gumbi
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 550;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.btn i { font-size: 12.5px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); border-color: #94a3b8; color: var(--text); }
.btn-danger { background: var(--surface); border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #b91c1c; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #126c34; color: #fff; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #e9edf3; color: var(--text); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 18px; font-size: 15px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-3);
    cursor: pointer;
}
.icon-btn:hover { background: #e9edf3; color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.primary:hover { background: var(--primary-soft); color: var(--primary); }
.inline-form { display: inline; margin: 0; }

/* --------------------------------------------------------------------------
   Kartice
   -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.stats .card + .card, .choice-grid .card + .card { margin-top: 0; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    flex-wrap: wrap;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
}
.card-title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 650; white-space: nowrap; }
.card-title i { color: var(--text-3); font-size: 14px; }
.card-body { padding: 22px; }
.card-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--radius) var(--radius);
}
.card-foot .spacer { margin-right: auto; }
.count-pill {
    padding: 1px 9px;
    border-radius: 999px;
    background: #eef1f6;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Forme
   -------------------------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { min-width: 0; }
.field > label, .field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.req { color: var(--danger); margin-left: 2px; }
.optional { margin-left: 6px; font-weight: 400; color: var(--text-3); font-size: 12px; }
.hint { margin-top: 5px; font-size: 12.5px; color: var(--text-3); }

.input, .select, .textarea,
input[type="text"].input, input[type="email"].input, input[type="password"].input,
input[type="date"].input, input[type="search"].input, input[type="tel"].input, input[type="number"].input {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 110px; resize: vertical; }
.select {
    padding-right: 34px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface) 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='%23475569' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    cursor: pointer;
}
.input::placeholder, .textarea::placeholder { color: #a3aec0; }
.input:focus, .select:focus, .textarea:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 91, 234, .16);
}
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--text-2); }

.field.has-error .input, .field.has-error .select, .field.has-error .textarea,
.field.has-error ul.token-input-list-uro { border-color: var(--danger); }
.field-error { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; font-weight: 500; color: var(--danger); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.static-field {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-2);
}

/* Filter traka */
.filters { padding: 16px 18px; }
.filters-row { display: grid; gap: 12px; }
.filters-row.top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 12px; }
.filters-row.bottom { grid-template-columns: 150px 150px minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
.filter-label { display: block; margin-bottom: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.search-box { position: relative; }
.search-box > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; pointer-events: none; }
.search-box input.input, .search-box input[type="search"].input { padding-left: 36px; }

/* --------------------------------------------------------------------------
   Tablice
   -------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}
.table th:first-child { border-radius: var(--radius) 0 0 0; }
.table th:last-child { border-radius: 0 var(--radius) 0 0; }
.card-head + .table-wrap .table th { border-radius: 0; }
.table td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.row-link { cursor: pointer; }
.table tbody tr:hover { background: #f6f8fc; }
.table .num { text-align: right; }
.table .center { text-align: center; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .nowrap { white-space: nowrap; }
.cell-strong { font-weight: 600; color: var(--text); }
.cell-muted { color: var(--text-2); }
.cell-sub { display: block; font-size: 12.5px; color: var(--text-3); }

.uro-no {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--primary-soft);
    color: #1e3fae;
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.uro-no.lg { padding: 4px 12px; font-size: 15px; border-radius: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eef1f6;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge.blue { background: var(--primary-soft); color: #1e3fae; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.red { background: var(--danger-soft); color: var(--danger); }

.attach-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-weight: 600; font-size: 13px; }
.attach-none { color: #c4ccd8; }

.table-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13px;
}

/* Paginacija */
.pager { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.pager a, .pager span {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 550;
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .active span { border-color: var(--primary); background: var(--primary); color: #fff; }
.pager .disabled span { color: #c4ccd8; background: var(--surface-2); }

/* Prazno stanje */
.empty { padding: 56px 24px; text-align: center; color: var(--text-2); }
.empty > i { display: block; margin-bottom: 14px; font-size: 34px; color: #c4ccd8; }
.empty h3 { margin-bottom: 4px; font-size: 16px; color: var(--text); }

/* --------------------------------------------------------------------------
   Detalji (opisna lista)
   -------------------------------------------------------------------------- */

.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin: 0; }
.dl.single { grid-template-columns: minmax(0, 1fr); }
.dl > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.dl > div.full { grid-column: 1 / -1; }
.dl dt { color: var(--text-2); font-size: 13px; font-weight: 500; }
.dl dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.dl dd.empty-val { color: #b6c0cf; font-weight: 400; }
.dl dd.pre { white-space: pre-line; font-weight: 450; }

.meta-line { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-3); font-size: 12.5px; }
.meta-line i { margin-right: 5px; }

/* Privici */
.file-list { list-style: none; margin: 0; padding: 0; }
.file-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.file-item:first-child { padding-top: 0; }
.file-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 16px;
}
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 12.5px; color: var(--text-3); }
.file-actions { display: flex; gap: 2px; flex: none; }

.dropzone {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 18px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.dropzone-text { flex: 1; min-width: 220px; }
.dropzone-text strong { display: block; }
.dropzone input[type="file"] { font: inherit; font-size: 13px; color: var(--text-2); max-width: 100%; }
.dropzone input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 550;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Obavijesti
   -------------------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.alert i { margin-top: 3px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { border-color: #bbf7d0; background: var(--success-soft); color: #14532d; }
.alert-danger { border-color: #fecaca; background: var(--danger-soft); color: #991b1b; }
.alert-info { border-color: #c7d7fe; background: var(--primary-soft); color: #1e3a8a; }
.alert-warning { border-color: #fde68a; background: var(--warning-soft); color: #92400e; }

/* Kartice statistike */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 16px 18px; }
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.stat-value { margin-top: 4px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }

/* Izbor tipa (kartice za odabir) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* --------------------------------------------------------------------------
   TokenInput – tema "uro"
   -------------------------------------------------------------------------- */

ul.token-input-list-uro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100% !important;
    min-height: 40px;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    list-style: none;
    cursor: text;
    overflow: hidden;
}
ul.token-input-list-uro:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 91, 234, .16); }
ul.token-input-list-uro li { list-style: none; }
ul.token-input-list-uro li input {
    width: 100% !important;
    min-width: 160px;
    margin: 0;
    padding: 5px 4px;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    outline: 0;
    box-shadow: none;
}
ul.token-input-list-uro li input::placeholder { color: #a3aec0; }
li.token-input-input-token-uro { flex: 1; min-width: 160px; }
li.token-input-token-uro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 4px 6px 4px 11px;
    border-radius: 6px;
    background: var(--primary-soft);
    color: #1e3fae;
    font-weight: 600;
    font-size: 13.5px;
    cursor: default;
}
li.token-input-token-uro p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li.token-input-token-uro span {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #1e3fae;
    font-weight: 700;
    cursor: pointer;
}
li.token-input-token-uro span:hover { background: #cfdcff; }
li.token-input-selected-token-uro { background: var(--primary); color: #fff; }
li.token-input-selected-token-uro span { color: #fff; }

div.token-input-dropdown-uro {
    position: absolute;
    z-index: 1000;
    margin-top: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    font-family: var(--font);
    font-size: 14px;
}
div.token-input-dropdown-uro p { margin: 0; padding: 10px 14px; color: var(--text-3); font-size: 13px; }
div.token-input-dropdown-uro ul { margin: 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto; }
div.token-input-dropdown-uro ul li { padding: 8px 10px; border-radius: 6px; color: var(--text); cursor: pointer; list-style: none; }
div.token-input-dropdown-uro ul li em { font-style: normal; font-weight: 700; color: var(--primary); }
div.token-input-dropdown-uro ul li.token-input-selected-dropdown-item-uro { background: var(--primary-soft); }

/* --------------------------------------------------------------------------
   Prijava / registracija (gost)
   -------------------------------------------------------------------------- */

.auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    min-height: 100vh;
}
.auth-aside {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px;
    background: linear-gradient(160deg, #101a2e 0%, #1b2d57 60%, #2f5bea 140%);
    color: #fff;
}
.auth-aside .brand { padding: 0; }
.auth-pitch h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.auth-pitch p { margin-top: 14px; max-width: 420px; color: #c3cee6; font-size: 15.5px; }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; color: #dbe3f5; }
.auth-points li { display: flex; align-items: center; gap: 11px; padding: 6px 0; }
.auth-points i { color: #8fb0ff; width: 16px; text-align: center; }
.auth-aside .credit { padding: 0; color: #8d9cbb; }

.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 24px; font-weight: 680; letter-spacing: -.015em; }
.auth-box .lead { margin: 6px 0 26px; color: var(--text-2); }
.auth-box .field { margin-bottom: 16px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; font-size: 13.5px; }
.auth-captcha { margin: 4px 0 18px; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.auth-brand-mobile { display: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .filters-row.bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters-row.bottom .reset-cell { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 30; }
    .main { margin-left: 0; }
    .topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        background: var(--sidebar);
        color: #fff;
    }
    .topbar .brand { padding: 0; }
    .topbar .brand-mark { width: 32px; height: 32px; font-size: 11px; }
    .nav-toggle { margin-left: auto; width: 38px; height: 38px; border: 0; border-radius: 8px; background: var(--sidebar-2); color: #fff; font-size: 16px; cursor: pointer; }
    .content { padding: 20px 16px 40px; }
    .form-grid, .dl, .filters-row.top { grid-template-columns: minmax(0, 1fr); }
    .dl > div { grid-template-columns: 130px minmax(0, 1fr); }
    .auth-page { grid-template-columns: minmax(0, 1fr); }
    .auth-aside { display: none; }
    .auth-brand-mobile { display: flex; margin-bottom: 28px; color: var(--text); }
    .auth-brand-mobile .brand-sub { color: var(--text-3); }
    .hide-sm { display: none; }
}

@media (max-width: 560px) {
    .filters-row.bottom { grid-template-columns: minmax(0, 1fr); }
    .page-title { font-size: 21px; }
    .dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media print {
    .sidebar, .topbar, .page-actions, .filters, .actions, .dropzone, .table-foot { display: none !important; }
    .main { margin: 0; }
    body { background: #fff; }
    .card { box-shadow: none; }
}

/* --------------------------------------------------------------------------
   Storno, povijest izmjena, sklopive kartice
   -------------------------------------------------------------------------- */

.row-cancelled .cancellable, .row-cancelled .cell-strong { text-decoration: line-through; color: var(--text-3); }
.row-cancelled .uro-no { background: #eef1f6; color: var(--text-3); text-decoration: line-through; }

details.collapsible { margin-top: 20px; }
details.collapsible > summary { cursor: pointer; list-style: none; border-bottom: 0; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::after { content: "\f078"; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 12px; color: var(--text-3); transition: transform .15s; }
details.collapsible[open] > summary { border-bottom: 1px solid var(--border); }
details.collapsible[open] > summary::after { transform: rotate(180deg); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline > li { position: relative; padding: 0 0 18px 16px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.timeline-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.timeline-head .cell-muted { font-size: 12.5px; }

.change-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.change-list li { padding: 2px 0; overflow-wrap: anywhere; }
.change-field { color: var(--text-2); font-weight: 600; margin-right: 4px; }
.change-old { color: var(--text-3); text-decoration: line-through; }
.change-new { color: var(--text); font-weight: 550; }
.change-list i { margin: 0 6px; color: var(--text-3); font-size: 11px; }

.badge-x { margin: 0 -3px 0 2px; padding: 0 3px; border: 0; border-radius: 50%; background: transparent; color: inherit; font: inherit; font-size: 14px; line-height: 1; cursor: pointer; opacity: .7; }
.badge-x:hover { opacity: 1; background: rgba(30, 63, 174, .15); }

/* --------------------------------------------------------------------------
   Početna stranica, statusi, dijalog
   -------------------------------------------------------------------------- */

.stat { display: block; color: inherit; }
a.stat:hover { border-color: var(--primary); color: inherit; }
.stat-value.danger { color: var(--danger); }
.stat-value.warn { color: var(--warning); }
.stat-hint { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; margin-bottom: 20px; }
.dash-grid .card + .card { margin-top: 0; }

.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 190px; }
.bar-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; color: inherit; }
.bar-col:hover .bar { background: var(--primary-hover); }
.bar-value { font-size: 12px; font-weight: 650; color: var(--text-2); }
.bar { width: 100%; max-width: 38px; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--primary); transition: background .12s; }
.bar.zero { background: var(--border-strong); }
.bar-label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }

.hbar-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); color: inherit; }
.hbar-row:last-child { border-bottom: 0; }
.hbar-row:hover .hbar-name { color: var(--primary); }
.hbar-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-count { text-align: right; font-weight: 700; }
.hbar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 3px; background: var(--primary); }

.list-rows { list-style: none; margin: 0; padding: 0; }
.list-rows li { border-bottom: 1px solid var(--border); }
.list-rows li:last-child { border-bottom: 0; }
.list-rows a { display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: inherit; }
.list-rows a:hover { background: #f6f8fc; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-form { display: inline-flex; gap: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.status-form button { padding: 8px 13px; border: 0; border-right: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer; }
.status-form button:last-child { border-right: 0; }
.status-form button:hover { background: var(--surface-2); color: var(--text); }
.status-form button.current { background: var(--primary); color: #fff; cursor: default; }

.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.due.late { color: var(--danger); }
.due.soon { color: var(--warning); }

dialog.modal { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 12px; box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; font-weight: 650; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg label { margin: 0; padding: 8px 14px; font-size: 13.5px; font-weight: 550; color: var(--text-2); cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label { background: var(--primary); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: -2px; }

@media (max-width: 1000px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .bars { gap: 3px; } .bar-value { font-size: 10.5px; } .bar-label { font-size: 9.5px; } }
