/* easyfakt UI theme on top of Bootstrap 3 */
:root {
    --navy: #2f2d5c;
    --navy-2: #26244d;
    --navy-3: #3b3970;
    --teal: #3a9cc4;
    --teal-2: #2f86a9;
    --teal-soft: #e6f4fa;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --border: #e3e7ef;
    --border-2: #d3d9e4;
    --text: #1d2433;
    --muted: #6b7385;
    --success: #1f9d6b;
    --success-soft: #e3f6ee;
    --danger: #d64545;
    --danger-soft: #fdecec;
    --warning: #c58a12;
    --warning-soft: #fdf3dd;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 1px 3px rgba(20, 24, 40, .06);
    --sidebar-w: 248px;
}

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-2); }
a:hover, a:focus { color: var(--navy); text-decoration: none; }
h1, h2, h3, h4, h5 { font-family: inherit; color: var(--text); font-weight: 600; letter-spacing: -.01em; }
.text-muted { color: var(--muted); }
.ti { font-size: 1.15em; }
hr { border-color: var(--border); }

/* ---------- Sidebar layout ---------- */
.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1030;
    width: var(--sidebar-w);
    background: var(--navy);
    color: #c9cbe3;
    display: flex; flex-direction: column;
}
.sidebar-brand { display: block; padding: 22px 22px 18px; }
.sidebar-brand img { height: 30px; }
/* back button of the home-screen app on the iPad (shown by web/js/app.js), right of the logo; the phone has it in the top bar */
.sidebar-back { position: absolute; right: 14px; top: 22px; width: 34px; height: 34px; border: 0; border-radius: 9px;
    display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; font-size: 20px; }
.sidebar-back:hover, .sidebar-back:active { background: rgba(255, 255, 255, .2); }
.sidebar-back[hidden] { display: none; }
.sidebar-collapse { position: absolute; right: 14px; top: 22px; }
.sidebar-reopen { top: 14px; }
@media (max-width: 991px) { .sidebar-back { display: none !important; } }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-section {
    margin: 18px 10px 6px;
    font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: #8c8fb8;
}
.sidebar .nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; margin: 1px 0;
    border-radius: var(--radius-sm);
    color: #d6d8ee; font-weight: 500;
    transition: background .12s, color .12s;
}
.sidebar .nav-link .ti { font-size: 19px; color: #9fa2cc; }
.sidebar .nav-link:hover { background: var(--navy-3); color: #fff; }
.sidebar .nav-link.active { background: rgba(127, 208, 240, .14); color: #fff; }
.sidebar .nav-link.active .ti { color: #7fd0f0; }
.sidebar-user { border-top: 1px solid rgba(255, 255, 255, .08); padding: 12px; }
.user-toggle {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: var(--radius-sm); color: #fff;
}
.user-toggle:hover, .user-toggle:focus { background: var(--navy-3); color: #fff; }
.user-toggle > .ti { margin-left: auto; color: #8c8fb8; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: #7fd0f0; color: var(--navy);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px; flex: none;
}
img.avatar { object-fit: cover; background: #fff; }
/* row whose cards are as tall as the tallest one (footer at the bottom) */
@media (min-width: 992px) {
    .row-eq { display: flex; flex-wrap: wrap; }
    .row-eq > [class*="col-"] { display: flex; flex-direction: column; }
    .row-eq > [class*="col-"] > .card { flex: 1; display: flex; flex-direction: column; }
    .row-eq > [class*="col-"] > .card > .card-foot { margin-top: auto; }
}
/* Prijem → Izvori */
.uputstvo details { border-top: 1px solid var(--border); }
.uputstvo details:first-of-type { border-top: 0; }
.uputstvo summary { display: flex; align-items: center; gap: 10px; padding: 13px 0; cursor: pointer; font-weight: 600; list-style: none; }
.uputstvo summary::-webkit-details-marker { display: none; }
.uputstvo summary .ti { font-size: 19px; color: var(--teal); }
.uputstvo summary:after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.uputstvo details[open] summary:after { transform: rotate(-135deg); }
.uputstvo-tijelo { padding: 0 0 16px 29px; }
.uputstvo-tijelo ol { padding-left: 20px; margin-bottom: 12px; }
.uputstvo-tijelo li { margin-bottom: 8px; line-height: 1.55; }
.uputstvo-napomena { display: flex; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm); background: #f4f6fa; color: var(--muted); font-size: 13px; line-height: 1.5; }
.uputstvo-napomena .ti { flex: none; margin-top: 2px; color: var(--teal); }
.uputstvo-tabela { margin: 8px 0; border-collapse: collapse; font-size: 13px; }
.uputstvo-tabela th, .uputstvo-tabela td { padding: 6px 14px 6px 0; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.uputstvo-tabela th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.uputstvo-kod { margin: 8px 0 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: #1d2433; color: #e6e9f2; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.uputstvo-kopiraj { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.uputstvo-kopiraj code { padding: 6px 10px; word-break: break-all; }
@media (max-width: 767px) { .uputstvo-tijelo { padding-left: 0; } }
.izvor-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.izvor-card.is-off { opacity: .6; }
.izvor-ikona { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px;
    background: var(--teal-soft); color: var(--teal-2); }
.izvor-ikona.v-m365 { background: #ecebf7; color: var(--navy-3); }
.izvor-tijelo { flex: 1; min-width: 0; }
.izvor-naslov { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 2px; }
.izvor-naslov strong { font-size: 15px; }
.izvor-status { margin-top: 6px; }
.izvor-ok { color: var(--success); }
.izvor-akcije { flex: none; display: flex; gap: 6px; }
.izvor-akcije .danger { color: var(--danger); }
@media (max-width: 767px) { .izvor-card { flex-wrap: wrap; } .izvor-akcije { width: 100%; justify-content: flex-end; } }
.artikal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; }
.artikal-meta code { padding: 2px 8px; border-radius: 6px; background: #eef1f6; color: var(--text); font-size: 12.5px; }
.artikal-komitent { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.tabular { font-variant-numeric: tabular-nums; }
.vrsta-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px;
    white-space: nowrap; background: #eef1f6; color: #4a5367; box-shadow: inset 0 0 0 1px rgba(20, 24, 40, .06); }
.vrsta-pill.v-pretplata { background: #ecebf7; color: var(--navy-3); box-shadow: inset 0 0 0 1px rgba(59, 57, 112, .14); }
.vrsta-pill.v-potrosnja { background: var(--teal-soft); color: var(--teal-2); box-shadow: inset 0 0 0 1px rgba(47, 134, 169, .16); }
.user-cell { display: flex; align-items: center; gap: 12px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar-edit { display: flex; align-items: flex-start; gap: 18px; }
.avatar-edit-pic { flex: none; padding-top: 4px; }
.avatar-edit-fields { flex: 1; min-width: 0; }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12px; color: #9fa2cc; }
.sidebar-user .dropdown-menu { left: 12px; right: 12px; bottom: 100%; margin-bottom: 6px; }
.dropdown-btn { display: block; width: 100%; text-align: left; padding: 6px 16px; color: #333; border: 0; }
.dropdown-btn:hover { background: #f5f5f5; text-decoration: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.content { padding: 28px 32px 48px; }
.topbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1029; background: rgba(20, 24, 40, .4); }
    .main { margin-left: 0; }
    .topbar {
        display: flex; align-items: center; gap: 12px;
        position: sticky; top: 0; z-index: 1020;
        height: 56px; padding: 0 16px;
        background: var(--surface); border-bottom: 1px solid var(--border);
    }
    .topbar-toggle { border: 0; background: none; font-size: 22px; padding: 4px; color: var(--navy); }
    .topbar-back { font-size: 26px; margin: 0 -6px 0 -8px; }
    .topbar-back[hidden] { display: none; }
    .content { padding: 20px 16px 40px; }
}

/* ---------- Page header ---------- */
.page-head {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
    margin-bottom: 22px;
}
.page-head h1 { font-size: 24px; margin: 0; line-height: 1.25; }
/* status pill (NOVA, NEPLAĆENA…) and payment next to the title: centred on the title line */
.page-head h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.page-head h1 > span { margin: 0; vertical-align: middle; }
.page-head .page-sub { margin: 4px 0 0; color: var(--muted); }
.page-head .back {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: var(--muted); margin-bottom: 6px;
}
.page-head .back:hover { color: var(--navy); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { font-size: 15px; margin: 0; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }
.card > .table-responsive, .card > .table { margin: 0; border: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-weight: 500; font-size: 14px;
    border-radius: var(--radius-sm);
    padding: 8px 14px; line-height: 20px;
    border: 1px solid transparent;
    box-shadow: none !important;
    transition: background .12s, border-color .12s, color .12s;
}
.btn .ti { font-size: 17px; }
.btn-lg { padding: 11px 18px; font-size: 15px; }
.btn-sm, .btn-xs { padding: 5px 10px; font-size: 13px; }
.btn-block { display: flex; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }
.btn-success { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-success:hover, .btn-success:focus, .btn-success:active { background: var(--teal-2); border-color: var(--teal-2); color: #fff; }
.btn-default { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn-default:hover, .btn-default:focus, .btn-default:active { background: #f3f5f9; border-color: var(--border-2); color: var(--text); }
.btn-danger { background: var(--surface); border-color: #f0c5c5; color: var(--danger); }
.btn-danger:hover, .btn-danger:focus, .btn-danger:active { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-link { color: var(--teal-2); }
.btn:focus, .btn:active:focus { outline: 2px solid rgba(58, 156, 196, .35); outline-offset: 1px; }

/* ---------- Forms ---------- */
label, .control-label { font-weight: 500; font-size: 13px; color: #3c4456; margin-bottom: 6px; }
.form-control {
    height: 40px; padding: 9px 12px;
    font-size: 14px; color: var(--text);
    border: 1px solid var(--border-2); border-radius: var(--radius-sm);
    box-shadow: none;
    transition: border-color .12s, box-shadow .12s;
}
textarea.form-control { height: auto; }
.form-control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(58, 156, 196, .18); }
.form-control[disabled], .form-control[readonly] { background: #f6f7fa; }
.form-group { margin-bottom: 18px; }
.help-block, .hint-block { display: block; clear: both; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.has-error .form-control { border-color: var(--danger); }
.has-error .form-control:focus { box-shadow: 0 0 0 3px rgba(214, 69, 69, .15); }
.has-error .help-block, .has-error .control-label { color: var(--danger); }
.has-success .form-control { border-color: var(--border-2); }
.has-success .control-label { color: #3c4456; }
.checkbox label, .radio label { font-weight: 400; color: var(--text); font-size: 14px; }
input[type=checkbox], input[type=radio] { accent-color: var(--navy); }
.btn-predznak { height: 40px; min-width: 46px; font-size: 18px; line-height: 1; border-color: var(--border-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }
.input-group-addon { background: #f6f7fa; border-color: var(--border-2); color: var(--muted); }
.input-group .form-control:first-child, .input-group-addon:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .form-control:last-child, .input-group-addon:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.form-section-sep { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 8px; }
.form-section-title.form-section-sep { margin-top: 8px; }
/* note beside a row of fields: as tall as an input and level with it (label 19.5 px + 6 px above) */
.form-note { display: flex; align-items: center; gap: 8px; min-height: 40px; margin: 25.5px 0 15px; padding: 6px 12px;
    border-radius: var(--radius-sm); background: #f4f6fa; color: var(--muted); font-size: 13px; line-height: 1.4; }
.form-note .ti { flex: none; color: var(--teal); }
@media (max-width: 991px) { .form-note { margin-top: 0; } }
.form-section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 14px; }

/* Select2 (krajee-bs3 theme): same size and look as .form-control */
.select2-container--krajee-bs3 .select2-selection { border-color: var(--border-2); border-radius: var(--radius-sm); box-shadow: none; font-size: 14px; background: #fff; }
.select2-container--krajee-bs3 .select2-selection--single { height: 40px; line-height: 20px; padding: 9px 52px 9px 12px; }
.select2-container--krajee-bs3 .select2-selection--single .select2-selection__rendered { padding: 0; line-height: 20px; color: var(--text); }
.select2-container--krajee-bs3 .select2-selection--single .select2-selection__placeholder { color: #9aa1b0; }
.select2-container--krajee-bs3 .select2-selection--single .select2-selection__arrow { height: 38px; width: 28px; top: 0; right: 0; border-left: 0; background: none; }
.select2-container--krajee-bs3 .select2-selection__clear { color: var(--muted); font-size: 16px; line-height: 20px; margin-right: 4px; }
.select2-container--krajee-bs3 .select2-selection--single .select2-selection__clear { position: absolute; right: 30px; top: 9px; margin: 0; }
.select2-container--krajee-bs3 .select2-selection--multiple { min-height: 40px; padding: 3px 34px 3px 6px; }
.select2-container--krajee-bs3 .select2-selection--multiple .select2-selection__choice { display: inline-flex; align-items: center; gap: 4px; height: 28px; margin: 3px 4px 3px 0; padding: 0 4px 0 10px;
    border-radius: 999px; border-color: var(--border); background: #eef1f6; color: var(--text); font-size: 13px; line-height: 1; }
/* chips: name first, then a round × centred on the same line */
.select2-container--krajee-bs3 .select2-selection--multiple .select2-selection__choice__display { order: 1; }
.select2-container--krajee-bs3 .select2-selection--multiple .select2-selection__choice__remove { order: 2; float: none; display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 15px; line-height: 1; }
.select2-container--krajee-bs3 .select2-selection--multiple .select2-selection__choice__remove:hover { background: rgba(20, 24, 40, .08); color: var(--text); }
/* category chips (web/js/app.js katChip): like .cat-badge */
.select2-container--krajee-bs3 .select2-selection--multiple .select2-selection__choice.kat-chip { gap: 6px; padding-left: 10px; border: 0; font-weight: 600; font-size: 12.5px;
    color: color-mix(in srgb, var(--c) 82%, black); background: color-mix(in srgb, var(--c) 11%, white);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent); }
.select2-selection__choice.kat-chip:before, .kat-opt:before { content: ""; order: 0; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.select2-container--krajee-bs3 .select2-selection--multiple .select2-selection__choice.kat-chip .select2-selection__choice__remove { color: inherit; opacity: .55; }
.select2-container--krajee-bs3 .select2-selection--multiple .select2-selection__choice.kat-chip .select2-selection__choice__remove:hover { opacity: 1; background: color-mix(in srgb, var(--c) 18%, transparent); color: inherit; }
.kat-opt { display: inline-flex; align-items: center; gap: 9px; }
.select2-container--krajee-bs3 .select2-selection--multiple .select2-selection__clear { position: absolute; top: 10px; right: 10px; height: 20px; margin: 0; padding: 0; line-height: 20px; }
.select2-container--krajee-bs3 .select2-selection--multiple .select2-search--inline .select2-search__field { height: 30px; margin-top: 2px; font-size: 14px; }
.select2-container--krajee-bs3.select2-container--focus .select2-selection,
.select2-container--krajee-bs3.select2-container--open .select2-selection { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(58, 156, 196, .18); }
.select2-container--krajee-bs3 .select2-dropdown { border-color: var(--border-2); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(20, 24, 40, .12); overflow: hidden; font-size: 14px; }
.select2-container--krajee-bs3 .select2-results__option { padding: 7px 12px; }
.select2-container--krajee-bs3 .select2-results__group { padding: 8px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.select2-container--krajee-bs3 .select2-results__option--highlighted[aria-selected] { background: var(--teal-soft); color: var(--navy); }
.select2-container--krajee-bs3 .select2-results__option[aria-selected=true] { background: #f1f3f8; color: var(--text); }
.select2-container--krajee-bs3 .select2-search--dropdown .select2-search__field { border-radius: var(--radius-sm); border-color: var(--border-2); height: 34px; }
.has-error .select2-container--krajee-bs3 .select2-selection { border-color: var(--danger); }
.input-sm + .select2-container--krajee-bs3 .select2-selection--single, .pair-form .select2-container--krajee-bs3 .select2-selection--single { height: 32px; padding-top: 5px; padding-bottom: 5px; }

/* TinyMCE */
.tox-tinymce { border-color: var(--border-2) !important; border-radius: var(--radius-sm) !important; }

/* ---------- Tables ---------- */
.table { margin-bottom: 0; }
.table > thead > tr > th {
    background: #f8f9fc;
    border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted);
    padding: 11px 14px; white-space: nowrap;
}
.table > thead > tr > th a { color: var(--muted); }
.table > thead > tr > th a:hover, .table > thead > tr > th a.asc, .table > thead > tr > th a.desc { color: var(--navy); }
.table > thead > tr > th a.asc:after, .table > thead > tr > th a.desc:after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px;
    background-color: currentColor; -webkit-mask: var(--ti) no-repeat center / contain; mask: var(--ti) no-repeat center / contain; }
.table > thead > tr > th a.asc:after { --ti: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15l6-6l6 6'/%3E%3C/svg%3E"); }
.table > thead > tr > th a.desc:after { --ti: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6-6'/%3E%3C/svg%3E"); }
.table > tbody > tr > td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.table > thead > tr.filters > td { padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--border); }
.table > thead > tr.filters .form-control { height: 34px; padding: 6px 10px; font-size: 13px; }
.table > thead > tr.filters .date-input .form-control { padding-left: 32px; padding-right: 28px; }
.table > thead > tr.filters .date-input > .ti-calendar { left: 10px; font-size: 15px; }
.table > thead > tr.filters .date-input .date-clear { right: 4px; padding: 2px 5px; }
.table-hover > tbody > tr:hover { background: #f7f9fc; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { padding: 10px 14px; border-top: 1px solid var(--border); }
.grid-view { overflow: hidden; }
.grid-view .table-responsive { margin: 0; border: 0; }
.grid-foot {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    padding: 12px 16px; border-top: 1px solid var(--border);
}
.grid-foot .summary { color: var(--muted); font-size: 13px; }
.grid-view .empty { display: block; padding: 32px; text-align: center; color: var(--muted); }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
td.col-actions a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 7px;
    color: var(--muted); font-size: 17px;
}
td.col-actions a:hover { background: #eef1f6; color: var(--navy); }
td.col-actions a[title="Delete"]:hover, td.col-actions a.danger:hover { background: var(--danger-soft); color: var(--danger); }
/* text buttons in the actions column (e.g. Deaktiviraj) keep their own size instead of the 30 px icon square */
td.col-actions a.btn { width: auto; height: 32px; padding: 0 12px; font-size: 13px; color: var(--text); border-radius: var(--radius-sm); }
td.col-actions a.btn:hover { background: #f4f6fa; color: var(--navy); }
tr[data-href] { cursor: pointer; }

/* Pagination */
.pagination { margin: 0; display: flex; gap: 4px; }
.pagination > li > a, .pagination > li > span {
    border: 1px solid transparent; border-radius: 7px !important;
    color: var(--text); padding: 5px 10px; min-width: 32px; text-align: center; font-size: 13px;
}
.pagination > li > a:hover { background: #eef1f6; border-color: transparent; color: var(--navy); }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > span { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination > .disabled > span, .pagination > .disabled > a { color: #b4bac7; background: none; border-color: transparent; }

/* Detail view */
.detail-view { margin: 0; }
.detail-view > tbody > tr > th { width: 32%; font-weight: 500; color: var(--muted); border-top: 1px solid var(--border); padding: 12px 20px; }
.detail-view > tbody > tr > td { border-top: 1px solid var(--border); padding: 12px 20px; }
.detail-view > tbody > tr:first-child > th, .detail-view > tbody > tr:first-child > td { border-top: 0; }

/* ---------- Badges, alerts ---------- */
.badge-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 11px 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 18px; letter-spacing: .01em; white-space: nowrap;
    background: #eef1f6; color: #4a5367;
    box-shadow: inset 0 0 0 1px rgba(20, 24, 40, .06);
}
.badge-status:before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.badge-status .ti { font-size: 14px; margin-left: -1px; }
.badge-status:has(.ti):before { display: none; }
.badge-status.s-nova { background: var(--teal-soft); color: var(--teal-2); box-shadow: inset 0 0 0 1px rgba(47, 134, 169, .16); }
.badge-status.s-poslana { background: var(--warning-soft); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(197, 138, 18, .18); }
.badge-status.s-placena { background: var(--success-soft); color: var(--success); box-shadow: inset 0 0 0 1px rgba(31, 157, 107, .16); }
.badge-status.s-admin { background: #ecebf7; color: var(--navy-3); box-shadow: inset 0 0 0 1px rgba(59, 57, 112, .16); }
.badge-status.s-off { background: #f1f3f7; color: #8a91a1; }
.badge-muted { background: #eef1f6; color: var(--muted); }
.alert { border-radius: var(--radius); border: 1px solid transparent; padding: 12px 16px; }
.alert-success { background: var(--success-soft); border-color: #bfe7d6; color: #146b49; }
.alert-danger, .alert-error { background: var(--danger-soft); border-color: #f4caca; color: #a12f2f; }
.alert-info { background: var(--teal-soft); border-color: #c4e5f2; color: #1f6b8a; }
.alert-warning { background: var(--warning-soft); border-color: #f2dfb2; color: #8a5f08; }

/* ---------- Invoice page ---------- */
.invoice-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1199px) { .invoice-grid { grid-template-columns: 1fr; } }
.add-line { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: #fafbfd; }
@media (max-width: 600px) { .add-line { grid-template-columns: 1fr 1fr; } .add-line > :first-child { grid-column: 1 / -1; } }
.add-line .form-group { margin: 0; }
.totals { width: 100%; max-width: 360px; margin-left: auto; }
.totals td { padding: 6px 0; }
.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.totals tr.grand td { padding-top: 12px; border-top: 1px solid var(--border); font-size: 17px; font-weight: 600; color: var(--navy); }
.stat { font-size: 13px; color: var(--muted); }
.stat strong { display: block; font-size: 22px; color: var(--navy); font-weight: 600; letter-spacing: -.01em; }
.collapse-toggle { cursor: pointer; user-select: none; }
.collapse-toggle .ti-chevron-down { transition: transform .15s; }
.collapse-toggle.collapsed .ti-chevron-down { transform: rotate(-90deg); }

/* ---------- Empty / error state ---------- */
.empty-state { max-width: 460px; margin: 60px auto; text-align: center; }
.empty-state > .ti { font-size: 44px; color: var(--teal); }
.empty-state h1 { font-size: 22px; margin: 14px 0 8px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Auth (login) ---------- */
body.auth { background: var(--surface); }
.auth-wrap { display: grid; grid-template-columns: minmax(360px, 44%) 1fr; min-height: 100vh; }
.auth-brand {
    position: relative; overflow: hidden;
    background: var(--navy); color: #c9cbe3;
    padding: 48px 56px; display: flex; flex-direction: column;
}
.auth-brand:after {
    content: ""; position: absolute; right: -120px; bottom: -120px;
    width: 420px; height: 420px; border-radius: 96px; transform: rotate(18deg);
    background: rgba(127, 208, 240, .08);
}
.auth-logo { height: 34px; align-self: flex-start; }
.auth-claim { margin-top: auto; margin-bottom: auto; max-width: 380px; position: relative; z-index: 1; }
.auth-claim h2 { color: #fff; font-size: 34px; line-height: 1.15; margin: 0 0 14px; }
.auth-claim p { font-size: 16px; color: #b9bce0; }
.auth-foot { font-size: 13px; color: #8c8fb8; position: relative; z-index: 1; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 26px; margin: 0 0 6px; }
.auth-card > p { margin-bottom: 26px; }
.auth-card-logo { display: none; height: 30px; margin-bottom: 28px; }
@media (max-width: 767px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-card-logo { display: block; }
}

/* Colour fields (memorandum): swatch + hex without "#" as stored in the database */
.color-field { display: flex; gap: 8px; align-items: center; }
.color-swatch { width: 40px; height: 40px; padding: 3px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: #fff; cursor: pointer; flex: none; }
.color-field .form-control { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.add-line .select2-container, .form-group .select2-container { width: 100% !important; }

/* ---------- Balance ---------- */
.saldo-dug { color: var(--danger); font-weight: 600; }
.saldo-preplata { color: var(--success); font-weight: 600; }
.saldo-nula { color: var(--muted); }
.saldo-dug small, .saldo-preplata small { font-weight: 500; opacity: .8; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 991px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-grid .card { margin: 0; }
.stat-card { padding: 16px 18px; }
.stat-card span { display: block; font-size: 13px; color: var(--muted); }
.stat-card strong { display: block; margin-top: 4px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-main { border-width: 1px; }
.stat-main.is-dug { background: var(--danger-soft); border-color: #f4caca; }
.stat-main.is-dug strong { color: var(--danger); }
.stat-main.is-preplata { background: var(--success-soft); border-color: #bfe7d6; }
.stat-main.is-preplata strong { color: var(--success); }
.filter-bar .card-body { padding-bottom: 4px; }
.filter-bar .row > div { margin-bottom: 14px; }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; padding-top: 25px; }
@media (max-width: 991px) { .filter-actions { padding-top: 0; } }
.filter-actions .btn { height: 40px; }
/* wide screens: date fields get a fixed width that fits dd.mm.gggg with the calendar icon and ×, the buttons take what they
   need, the first field (search / client) takes the rest */
@media (min-width: 992px) {
    .filter-bar .row { display: flex; align-items: flex-end; }
    .filter-bar .filter-actions { padding-top: 0; }
    .filter-bar .row > div { float: none; width: auto; flex: 0 0 190px; }
    .filter-bar .row > div:first-child { flex: 1 1 auto; min-width: 0; }
    .filter-bar .row > .filter-actions { flex: 0 0 auto; }
}

/* Settings switches */
.setting-row { display: flex; gap: 16px; align-items: flex-start; }
.setting-row + .setting-row { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.setting-row p { margin: 4px 0 0; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; margin: 0; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; cursor: pointer; background: var(--border-2); border-radius: 999px; transition: background .15s; }
.switch .slider:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--teal); }
.switch input:checked + .slider:before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid rgba(58, 156, 196, .45); outline-offset: 2px; }

/* Invoice workflow */
.badge-status.s-neplacena { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(214, 69, 69, .16); }
.badge-pay { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.workflow { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px 16px; }
.workflow > * { flex-shrink: 0; }
.workflow .paid-info { color: var(--muted); flex: 1 1 180px; min-width: 0; }
.workflow .paid-info strong { color: var(--text); }

/* Date input (flatpickr) */
.date-input { position: relative; }
.date-input > .ti-calendar { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 2; font-size: 17px; }
.date-input .form-control { padding-left: 38px; background: #fff; cursor: pointer; }
.date-input .date-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.date-input .date-clear:hover { background: #eef1f6; color: var(--text); }
/* room for the × so text and placeholder never run under it; the × only shows once a date is set */
.date-input-clearable .form-control { padding-right: 34px; text-overflow: ellipsis; }
.date-input .form-control:placeholder-shown ~ .date-clear { display: none; }
.flatpickr-calendar { font-family: inherit; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(20, 24, 40, .16); border: 1px solid var(--border); }
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after { display: none; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; }
.flatpickr-current-month { font-size: 14px; }
span.flatpickr-weekday { color: var(--muted); font-weight: 600; font-size: 12px; }
.flatpickr-day { border-radius: 8px; }
.flatpickr-day.today { border-color: var(--teal); }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus { background: var(--navy); border-color: var(--navy); }
.flatpickr-day:hover { background: var(--teal-soft); border-color: var(--teal-soft); }

/* ---------- DMS ---------- */
.cat-tabs { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.cat-tabs a { flex-shrink: 0; white-space: nowrap; }
.cat-tabs, .dok-kat { scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar, .dok-kat::-webkit-scrollbar { display: none; }
.cat-tabs a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 500; }
.cat-tabs a:hover { border-color: var(--border-2); background: #f7f9fc; }
.cat-tabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 9px; margin: 2px 0; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 18px; letter-spacing: .01em; white-space: nowrap; vertical-align: middle;
    color: color-mix(in srgb, var(--c) 82%, black); background: color-mix(in srgb, var(--c) 11%, white);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent); }
.cat-badge:before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.cat-badge:has(.cat-x) { padding-right: 3px; }
.cat-badge .cat-x { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 1px; border-radius: 50%;
    color: inherit; opacity: .55; font-size: 12px; transition: opacity .12s, background .12s; }
.cat-badge .cat-x:hover, .cat-badge .cat-x:focus { opacity: 1; color: inherit; background: color-mix(in srgb, var(--c) 18%, transparent); }
.cat-badge .cat-auto { font-size: 13px; opacity: .6; margin-right: -2px; }
.doc-name { display: flex; align-items: flex-start; gap: 10px; }
.doc-name > .ti { font-size: 22px; color: var(--teal); margin-top: 1px; }
.doc-name a { font-weight: 600; color: var(--text); }
.doc-name a:hover { color: var(--teal-2); }
.doc-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.zip-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.add-cat { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.add-cat .grow { flex: 1 1 260px; }
.add-cat .form-group { margin-bottom: 0; }
/* labels on their own line, so the button under the empty label lines up with the inputs */
.add-cat .control-label { display: block; }
.add-cat .btn { height: 40px; }
.add-cat select.form-control { min-width: 200px; }
input[type=file].form-control, .field-dokument-file input[type=file] { height: auto; padding: 18px; border: 2px dashed var(--border-2); border-radius: var(--radius); background: #fafbfd; width: 100%; cursor: pointer; }

/* ---------- Integrations / sync ---------- */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: auto;
    border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; }
.btn .nav-badge { margin-left: 4px; }
.token-box { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.token-box code { padding: 6px 10px; background: #fff; border: 1px solid var(--border-2); border-radius: 6px; font-size: 13px; word-break: break-all; color: var(--text); }
.perm-list label { display: block; font-weight: 400; margin: 0 0 2px; font-size: 13px; }
.inline-form { display: inline-block; margin: 0; }
.sync-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.sync-table td:first-child { width: 38%; }
.pair-form .form-control { height: 32px; padding: 4px 8px; font-size: 13px; min-width: 200px; }
.diff-table td:first-child { width: 160px; }
.diff-table td { vertical-align: top; }
.card-head.collapse-toggle h2 { display: flex; align-items: center; gap: 6px; }

/* Žiralno: choice of the invoice number */
.ziralno-choice { position: relative; display: inline-block; }
.broj-izbor { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 440px; max-width: calc(100vw - 32px); box-shadow: 0 12px 32px rgba(20, 24, 40, .16); margin: 0; text-align: left; }
.radio-line { display: flex; align-items: baseline; gap: 8px; font-weight: 400; font-size: 14px; color: var(--text); margin: 0 0 10px; cursor: pointer; }
.radio-line input { margin: 0; }
.radio-line strong { white-space: nowrap; }

/* Invoice import from CDR Billing */
.uvoz-filter { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.uvoz-filter label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; margin: 0; }
.uvoz-klijent .card-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.uvoz-klijent .card-head h2 { display: flex; align-items: center; gap: 8px; }
.uvoz-check { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.uvoz-cilj { display: flex; gap: 8px; flex-wrap: wrap; }
.uvoz-cilj select { width: auto; min-width: 220px; }
.uvoz-table td { vertical-align: top !important; }
.uvoz-table select { min-width: 200px; }
.uvoz-table tr.iskljuceno td, .uvoz-klijent.iskljuceno .table { opacity: .45; }
.uvoz-table tr.uvezeno { background: #fff8e6; }
.uvoz-table .nowrap { white-space: nowrap; }
.uvoz-table select[data-artikal] { min-width: 220px; max-width: 300px; }
.uvoz-table input[data-naziv] { min-width: 200px; }
.uvoz-table input[data-jm] { width: 70px; }
.uvoz-table input[data-kolicina] { width: 115px; }
.uvoz-table input[data-cijena] { width: 100px; }
.uvoz-uskladi { padding: 0; color: var(--warning, #b7791f); }
.uvoz-table input[data-cijena] { display: inline-block; }
.uvoz-table .badge { font-size: 10px; }
.uvoz-novi { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; padding: 8px; border: 1px dashed var(--border); border-radius: 6px; max-width: 300px; }
.uvoz-novi > div { flex-basis: 100%; }
.uvoz-novi input[name$="[novi_sifra]"] { flex: 1; min-width: 150px; }
.uvoz-novi label { display: flex; align-items: center; gap: 4px; margin: 0; font-weight: 500; }
.uvoz-novi label input { width: 60px; }
.uvoz-table details summary { cursor: pointer; }

/* Copy lines from another invoice */
.add-line { grid-template-columns: minmax(0, 1fr) 130px auto auto; }
.kopiraj-lista { margin-top: 12px; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.kopiraj-faktura { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); color: inherit; }
.kopiraj-faktura:last-child { border-bottom: 0; }
.kopiraj-faktura:hover, .kopiraj-faktura:focus { background: #f4f6fb; text-decoration: none; color: inherit; }
.kopiraj-faktura.isti { background: #fafcff; }
.kopiraj-meta { float: right; color: var(--muted); font-size: 12px; }
.kopiraj-stavke input[name^="kolicina"] { width: 110px; display: inline-block; }
@media (max-width: 600px) { .add-line { grid-template-columns: 1fr 1fr; } }

/* Pregled */
.stat-card small { display: block; margin-top: 4px; font-size: 12px; }
.pregled-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; padding: 18px 20px 8px; height: 190px; border-bottom: 1px solid var(--border); }
.pregled-chart .col { display: flex; flex-direction: column; align-items: stretch; color: var(--muted); text-decoration: none; border-radius: 6px; padding: 4px; }
.pregled-chart .col:hover, .pregled-chart .col.active { background: #f1f3f9; }
.pregled-chart .bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.pregled-chart .bars i { display: block; width: 40%; max-width: 18px; min-height: 2px; border-radius: 3px 3px 0 0; }
.pregled-chart .lbl { text-align: center; font-size: 12px; margin-top: 6px; }
.bar-f { background: var(--navy, #2f2d5c); }
.bar-u { background: #3aa3c5; }
.pregled-legenda { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pregled-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.pregled-table td.num, .pregled-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pregled-table tr.active td { background: #f1f3f9; }
.pregled-table tfoot th { border-top: 2px solid var(--border); }
.pregled-fakture a { display: inline-block; margin-right: 6px; font-size: 13px; }
.cat-tabs .ti { margin-right: 4px; }
/* payment method always on its own line under the status pill */
td .badge-pay { display: flex; width: max-content; margin-top: 4px; }

/* Memorandum */
.memo-radio label { display: block; font-weight: 400; margin: 4px 0; }
.memo-radio input { margin-right: 6px; }
.memo-logo { margin: -6px 0 12px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; display: inline-block; max-width: 100%; }
.memo-logo img { max-height: 48px; max-width: 100%; display: block; }
.memo-boja { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-left: 10px; }
.memo-izgled .btn { margin: 0 6px 6px 0; }

/* ---------- home-screen app (iPad / iPhone): the page runs under the status bar and iOS draws a fade of the page background
   over its top edge, about 25 px below the clock. In that mode the page is a navy frame (sidebar on the left, a strip on top
   tall enough to hold the fade, white clock) and the content is a light panel; on the phone the top bar is navy with the
   light logo, below the fade. */
.topbar .logo-light { display: none; }
@media (display-mode: standalone) {
    html, body.app, body.auth { background: var(--navy); }
    .sidebar-brand { padding-top: calc(env(safe-area-inset-top, 0px) + 38px); }
    .sidebar-back { top: calc(env(safe-area-inset-top, 0px) + 36px); }
    .sidebar-collapse { top: calc(env(safe-area-inset-top, 0px) + 36px); }
    .sidebar-reopen { top: calc(env(safe-area-inset-top, 0px) + 36px); }
    body.auth { padding-top: calc(env(safe-area-inset-top, 0px) + 26px); }
    body.auth .auth-wrap { min-height: calc(100vh - env(safe-area-inset-top, 0px) - 26px); }
    body.auth .auth-main { background: var(--surface); border-radius: 18px 18px 0 0; }
}
@media (display-mode: standalone) and (min-width: 768px) {
    body.auth .auth-main { border-radius: 18px 0 0 0; }
}
/* Login on the phone: the iOS fade reaches further down than on the iPad, so the navy part is a header with the light logo,
   tall enough to hold it, and the form panel starts below. */
@media (display-mode: standalone) and (max-width: 767px) {
    body.auth { padding-top: 0; }
    body.auth .auth-wrap { grid-template-rows: auto 1fr; min-height: 100vh; }
    /* stays at the top when the keyboard pushes the page up, so the fade always lies on navy */
    body.auth .auth-brand { display: flex; position: sticky; top: 0; z-index: 5; padding: calc(env(safe-area-inset-top, 0px) + 26px) 24px 34px; }
    body.auth .auth-main { align-items: flex-start; padding-top: 40px; }
    body.auth .auth-brand:after, body.auth .auth-claim, body.auth .auth-foot { display: none; }
    body.auth .auth-card-logo { display: none; }
}
@media (display-mode: standalone) and (min-width: 992px) {
    .main { padding-top: calc(env(safe-area-inset-top, 0px) + 26px); }
    .content { background: var(--bg); min-height: calc(100vh - env(safe-area-inset-top, 0px) - 26px); border-top-left-radius: 18px; }
}
@media (display-mode: standalone) and (max-width: 991px) {
    .main { background: var(--bg); }
    .sidebar-brand { padding-top: calc(env(safe-area-inset-top, 0px) + 26px); }
    .topbar { height: auto; padding: calc(env(safe-area-inset-top, 0px) + 26px) 16px 12px; background: var(--navy); border-bottom: 0; }
    .topbar-toggle { color: #fff; }
    .topbar .logo-dark { display: none; }
    .topbar .logo-light { display: inline; }
}

/* In-app document viewer of the home-screen app (web/js/app.js): navy bar with close, name and share, its content below the
   iOS top fade (same 26 px as the rest of the app) */
body.doc-viewer-open { overflow: hidden; }
.doc-viewer { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: #525866; }
.doc-viewer-bar { display: flex; align-items: center; gap: 8px; flex: none; background: var(--navy); color: #fff;
    padding: calc(env(safe-area-inset-top, 0px) + 26px) max(10px, env(safe-area-inset-right, 0px)) 6px max(10px, env(safe-area-inset-left, 0px)); }
.dv-title { flex: 1; min-width: 0; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 22px; background: none; color: #fff; font-size: 24px;
    display: flex; align-items: center; justify-content: center; padding: 0; }
.dv-btn:active { background: var(--navy-3); }
.dv-btn[hidden] { display: flex; visibility: hidden; }
.doc-viewer-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 12px 12px calc(env(safe-area-inset-bottom, 0px) + 12px); }
.dv-page { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.dv-msg { margin: auto; max-width: 420px; padding: 24px; color: #fff; text-align: center; }

/* Prijem dokumenata (inbox) */
.prijem-zadnja { margin: -6px 0 16px; font-size: 13px; }
.prijem-table td { vertical-align: top !important; }
.prijem-preview { overflow: hidden; }
.prijem-preview iframe { display: block; width: 100%; height: calc(100vh - 210px); min-height: 480px; border: 0; background: #f5f6f8; }
.prijem-meta { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0; }
.prijem-meta dt { color: var(--muted); font-weight: 500; }
.prijem-meta dd { margin: 0; word-break: break-word; }
.prijem-meta + .alert { margin: 14px 0 0; }
.prijem-odbaci { margin-top: 8px; text-align: right; }
.prijem-historija { margin: -4px 0 14px; font-size: 13px; }
@media (max-width: 991px) { .prijem-preview iframe { height: 60vh; min-height: 0; } }
/* editing a document: preview and form fill the screen height, equally tall (taller form → both grow) */
@media (min-width: 992px) {
    .doc-edit { display: flex; }
    .doc-edit > [class*="col-"] { float: none; display: flex; flex-direction: column; }
    .doc-edit .card { flex: 1; }
    .doc-edit .prijem-preview { position: relative; min-height: max(480px, calc(100vh - 174px)); }
    .doc-edit .prijem-preview iframe { position: absolute; inset: 0; height: 100%; min-height: 0; }
}

/* ---------- Dodaj dokumente: upload into the intake inbox (parts of 8 MB, progress per file) ---------- */
.upload-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; margin: 0;
    border: 2px dashed var(--border-2); border-radius: var(--radius); text-align: center; cursor: pointer; font-weight: 400; }
.upload-drop:hover, .upload-drop.over { border-color: var(--navy); background: #f7f8fc; }
.upload-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-drop > .ti { font-size: 34px; color: var(--teal); }
.upload-drop strong { font-size: 16px; color: var(--navy); }
/* the same zone as a form field (app\widgets\FileDrop): smaller, with the current / chosen image as a preview */
.upload-drop-sm { padding: 16px 12px; gap: 4px; min-height: 178px; justify-content: center; }
.upload-drop-sm strong { font-size: 14px; }
.upload-drop-sm .text-muted { font-size: 12.5px; word-break: break-word; }
.upload-drop-sm.chosen { border-color: var(--teal); border-style: solid; background: var(--teal-soft); }
/* preview area of a fixed height, so zones with and without an image are equally tall */
.upload-preview { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; height: 76px; padding: 8px 12px; margin-bottom: 6px;
    border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.upload-preview img { max-height: 58px; max-width: 100%; display: block; }
.upload-drop-sm > .ti { height: 76px; font-size: 34px; margin-bottom: 6px; display: grid; place-items: center; }
.upload-kat { margin-top: 6px; }
.upload-list { list-style: none; margin: 16px 0 0; padding: 0; }
.upload-list li { padding: 10px 0; border-top: 1px solid var(--border); }
.upload-row { display: flex; justify-content: space-between; gap: 12px; }
.upload-name { word-break: break-word; }
.upload-state { white-space: nowrap; font-size: 13px; }
.upload-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: #eef1f6; overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--teal); transition: width .2s; }
.upload-ok .upload-state { color: var(--success); }
.upload-err .upload-state { color: var(--danger); }
.upload-err .upload-bar span { background: var(--danger); }

/* Tables with .table-stack: on the phone every row is a small card, each value with its column name (data-label, set
   from the header by web/js/app.js), so wide tables do not run out of the card. */
@media (max-width: 767px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack > tbody > tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
    .table-stack > tbody > tr:last-child { border-bottom: 0; }
    .table-stack > tbody > tr > td { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 4px 0; border: 0; text-align: right; word-break: break-word; }
    .table-stack > tbody > tr > td[data-label]::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; text-align: left; }
    .table-stack > tbody > tr > td:first-child { text-align: left; font-size: 15px; }
    .table-stack > tbody > tr > td:first-child::before { content: none; }
    /* icon actions top right, level with the name; text buttons (Deaktiviraj) stay a full-width row at the bottom */
    .table-stack > tbody > tr { position: relative; }
    .table-stack > tbody > tr > td.col-actions { justify-content: flex-end; padding-top: 8px; }
    .table-stack > tbody > tr > td.col-actions:not(:has(.btn)) { position: absolute; top: 8px; right: 10px; width: auto; padding: 0; }
    .table-stack > tbody > tr:has(> td.col-actions:not(:has(.btn)) > a) > td:first-child { padding-right: 90px; min-height: 34px; align-items: center; }
    .table-stack > tbody > tr > td.col-actions a.btn { flex: 1; height: 40px; }
    .table-stack > tbody > tr > td[colspan] { justify-content: center; }
    .table-stack > tbody > tr > td[colspan]::before { content: none; }
    .card-head { flex-wrap: wrap; }
    /* any other wide table scrolls sideways inside its card (wrapper added by web/js/app.js) instead of pushing the page */
    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-scroll > .table { margin: 0; }
    /* inline add forms (Kategorije, Pravila, API ključevi): each field and the button on its own full-width row */
    .add-cat > * { flex: 1 1 100%; }
    .add-cat select.form-control { min-width: 0; }
    .add-cat > .form-group:last-child > .control-label { display: none; } /* the empty label above the button */
    .add-cat .btn { width: 100%; height: 44px; }
    /* page buttons (Nova faktura, Usklađivanje, …) one under the other, full width */
    .page-actions { width: 100%; flex-direction: column; }
    .page-actions > .btn, .page-actions > form, .page-actions > form > .btn { width: 100%; }
    .page-actions .btn { height: 44px; }
    /* form buttons (Odustani / Snimi …) full width, the main one (last in the markup) on top */
    .form-actions { flex-direction: column-reverse; }
    .form-actions > .btn, .form-actions > form, .form-actions > form > .btn { width: 100%; }
    .form-actions .btn { height: 44px; }
}

/* Manager permissions (Korisnici): on the phone the three level columns fit next to the module name */
@media (max-width: 767px) {
    .perm-table { table-layout: fixed; width: 100%; }
    .perm-table th:first-child, .perm-table td:first-child { width: 40%; }
    .perm-table th, .perm-table td { padding-left: 6px !important; padding-right: 6px !important; }
    .perm-table th:first-child, .perm-table td:first-child { padding-left: 14px !important; }
    .table.perm-table > thead > tr > th { font-size: 10px; letter-spacing: 0; width: auto !important; }
}

/* Kategorije dokumenata: one compact row per category on the phone too (badge, number, icons) */
@media (max-width: 767px) {
    .kat-table > thead { display: none; }
    .kat-table > tbody > tr > td { padding: 10px 6px; vertical-align: middle; }
    .kat-table > tbody > tr > td:first-child { padding-left: 16px; }
    .kat-table > tbody > tr > td.num a::after { content: " dok."; }
    /* Pravila: "Izlazne fakture → Knjigovodstvo · 1 dok. · trash" on one line, wrapping only for long names */
    .pravila-table > thead { display: none; }
    .pravila-table, .pravila-table > tbody { display: block; }
    .pravila-table > tbody > tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); }
    .pravila-table > tbody > tr:last-child { border-bottom: 0; }
    .pravila-table > tbody > tr > td { display: block; padding: 0; border: 0; width: auto; }
    .pravila-table > tbody > tr > td.num { margin-left: auto; color: var(--muted); font-size: 13px; }
    .pravila-table > tbody > tr > td[colspan] { width: 100%; }
}

/* ---------- Memorandum: live preview next to the form (views/memorandumi/_pregled.php) ---------- */
.memo-edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.memo-edit > .card { margin: 0; }
.memo-pregled .card { margin: 0; }
.memo-pregled .card-head { gap: 8px; }
.memo-pregled .card-head h2 { margin-right: auto; }
.memo-page { padding: 14px; background: #e9ecf3; }
.memo-page > canvas:first-child { display: block; width: 100%; aspect-ratio: 210 / 297; background: #fff; box-shadow: 0 2px 12px rgba(20, 24, 40, .18); transition: opacity .2s; }
.memo-pregled.loading .memo-page > canvas:first-child { opacity: .55; }
.memo-page { position: relative; }
.memo-page > canvas:first-child { cursor: zoom-in; touch-action: none; }
.memo-lupa { display: none; position: absolute; width: 180px; height: 180px; border-radius: 50%; pointer-events: none;
    border: 3px solid #fff; box-shadow: 0 6px 24px rgba(20, 24, 40, .35), 0 0 0 1px rgba(20, 24, 40, .15); background: #fff; z-index: 5; }
.memo-pregled-close { display: none; border: 0; background: none; font-size: 20px; color: var(--muted); padding: 2px; }
.memo-pregled-btn { display: none; }
@media (min-width: 992px) {
    .memo-edit { grid-template-columns: minmax(0, 1fr) 340px; }
    .memo-pregled { position: sticky; top: 16px; }
    /* the form is narrower next to the preview: two fields per row instead of three or four */
    .memo-edit .memorandumi-form .col-md-3, .memo-edit .memorandumi-form .col-md-4 { width: 50%; }
}
@media (min-width: 992px) and (max-width: 1399px) {
    /* colours side by side in one row, the two logos side by side below (no logo alone in a row) */
    .memo-edit .memorandumi-form .memo-boje-col { width: 100%; display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }
    .memo-edit .memorandumi-form .memo-logo-col { width: 50%; }
}
@media (min-width: 1400px) {
    .memo-edit { grid-template-columns: minmax(0, 1fr) 440px; }
    .memo-edit .memorandumi-form .col-md-3 { width: 25%; }
    .memo-edit .memorandumi-form .col-md-4 { width: 33.333%; }
}
@media (display-mode: standalone) and (min-width: 992px) { .memo-pregled { top: calc(env(safe-area-inset-top, 0px) + 30px); } }
@media (max-width: 991px) {
    /* phone / narrow: the preview slides in from the right */
    .memo-pregled { position: fixed; top: 0; right: 0; bottom: 0; z-index: 1040; width: min(440px, 92vw); overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 12px;
        background: var(--bg); box-shadow: -12px 0 40px rgba(20, 24, 40, .25); transform: translateX(105%); transition: transform .2s ease; }
    body.memo-pregled-open .memo-pregled { transform: none; }
    .memo-pregled-close { display: inline-flex; }
    .memo-pregled-btn { display: inline-flex; position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); z-index: 1035;
        height: 48px; padding: 0 20px; border-radius: 999px; box-shadow: 0 8px 24px rgba(20, 24, 40, .3); }
    body.memo-pregled-open .memo-pregled-btn { display: none; }
    /* dimmed page behind the panel; a tap on it closes the panel */
    .memo-pregled-backdrop { display: none; position: fixed; inset: 0; z-index: 1039; background: rgba(20, 24, 40, .45); }
    body.memo-pregled-open .memo-pregled-backdrop { display: block; }
    body.memo-pregled-open { overflow: hidden; }
}
.memo-pregled-backdrop { display: none; }
@media (max-width: 767px) {
    /* phone: the preview fills the screen, navy under the status bar like the rest of the app */
    .memo-pregled { width: 100vw; background: var(--navy); box-shadow: none;
        padding: calc(env(safe-area-inset-top, 0px) + 26px) 10px calc(env(safe-area-inset-bottom, 0px) + 10px); }
    .memo-pregled .card { border-radius: 16px; overflow: hidden; }
    .memo-pregled .card-head { flex-wrap: nowrap; padding: 12px 14px; }
    .memo-pregled .card-head h2 { font-size: 17px; }
    .memo-pregled-close { width: 36px; height: 36px; border-radius: 50%; background: #f1f3f7; color: var(--text); align-items: center; justify-content: center; font-size: 18px; }
    .memo-page { padding: 10px; }
    .memo-pregled .card-foot { padding: 10px 14px; font-size: 12px; }
}

/* Memorandumi list: invoice preview in a popup */
.memo-modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 20px; }
.memo-modal[hidden] { display: none; }
.memo-modal-bg { position: absolute; inset: 0; background: rgba(20, 24, 40, .5); }
.memo-modal-card { position: relative; width: min(600px, 100%); max-height: 100%; overflow-y: auto; margin: 0; }
.memo-modal-card .card-head { gap: 8px; }
.memo-modal-card .card-head h2 { margin-right: auto; }
.memo-modal .memo-pregled-close { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: #f1f3f7; color: var(--text);
    align-items: center; justify-content: center; font-size: 18px; }
body.memo-modal-open { overflow: hidden; }
@media (display-mode: standalone) { .memo-modal { padding-top: calc(env(safe-area-inset-top, 0px) + 34px); } }
.memo-modal .memo-page { position: relative; }
.memo-modal .memo-page > canvas:first-child { cursor: zoom-in; touch-action: none; }
/* the whole page fits in the window, no scrolling */
.memo-modal .memo-page > canvas:first-child { width: auto; max-width: 100%; height: calc(100vh - 190px - env(safe-area-inset-top, 0px)); max-height: 1000px; margin: 0 auto; }
.memo-modal-card { width: auto; max-width: 100%; }
@media (max-width: 767px) {
    .memo-modal { padding: calc(env(safe-area-inset-top, 0px) + 26px) 10px calc(env(safe-area-inset-bottom, 0px) + 10px); align-items: flex-start; }
    .memo-modal-bg { background: var(--navy); }
    .memo-modal-card { width: 100%; }
    .memo-modal .memo-page > canvas:first-child { width: 100%; height: auto; max-height: none; }
}

/* Memorandum form: columns shown on the invoice, two per row */
.memo-kolone { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.memo-kolone .form-group { margin-bottom: 8px; }

/* Invoice: fiscal receipt bar (views/fakture/_workflow.php) */
.fiskal-forma { display: flex; gap: 8px; align-items: center; margin: 0; }
.fiskal-forma .form-control { width: auto; height: 38px; }
@media (max-width: 767px) { .fiskal-forma { width: 100%; } .fiskal-forma .form-control { flex: 1; } }

/* Fiscal device: Opće postavke → Fiskalna kasa and the Fiskalna kasa page */
.fk-stanje { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; }
.fk-stanje .lbl { font-size: 12px; color: var(--muted); }
.fk-stanje .val { font-weight: 600; margin-top: 2px; }
.fk-tacka { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.fk-tacka.ok { background: var(--success); } .fk-tacka.err { background: var(--danger); } .fk-tacka.muted { background: var(--border-2); }
.fk-koraci { margin: 0; padding-left: 20px; } .fk-koraci li { margin-bottom: 8px; line-height: 1.5; }
.fk-koraci code { font-size: 12.5px; }
.fk-status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.fk-status.ok { background: var(--success-soft); color: var(--success); } .fk-status.err { background: var(--danger-soft); color: var(--danger); }
.fk-status.warn { background: var(--warning-soft); color: var(--warning); } .fk-status.muted { background: #eef0f6; color: var(--muted); }
.fk-ukupno { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 18px; font-weight: 600; line-height: 1.45; }
.fk-ukupno .ti { font-size: 18px; flex: none; margin-top: 1px; }
.fk-ukupno.ok { background: var(--success-soft); color: #146b49; } .fk-ukupno.err { background: var(--danger-soft); color: #9c2b2b; }
.fk-povezi { display: flex; gap: 16px 24px; align-items: center; flex-wrap: wrap; }
.fk-povezi > div { flex: 1 1 320px; } .fk-povezi p { margin: 4px 0 0; }
.fk-kod-forma { display: flex; gap: 8px; flex: 0 1 320px; }
.fk-kod { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; text-align: center; }
@media (max-width: 600px) { .fk-kod-forma { flex-basis: 100%; } }
.fk-polja { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 20px; margin-top: 16px; }
.fk-ukupno.info { background: var(--teal-soft); color: var(--teal-2); }
.fk-ukupno + .fk-stanje { margin-top: 4px; }
.fk-izvjestaji { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.fk-izvjestaj { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.fk-izvjestaj-naslov { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.fk-izvjestaj-naslov .ti { font-size: 20px; color: var(--muted); }
.fk-izvjestaj p { margin: 8px 0 14px; line-height: 1.45; flex: 1; }
.fk-izvjestaj-forma { display: flex; flex-direction: column; gap: 8px; }
.fk-izvjestaj-forma .btn { width: 100%; }
.fk-period { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.fk-period > span { font-size: 13px; color: var(--muted); }
.nav-badge-warn { background: var(--warning); }

/* action buttons in list tables (akcije): same framed icon buttons everywhere, pushed to the right */
.akcije { white-space: nowrap; text-align: right; }
.akcije a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 2px 4px; border: 1px solid var(--border, #d5dbe5); border-radius: 8px; background: #fff; font-size: 18px; }
.akcije a:hover, .akcije a:active { background: #f1f4f8; }

/* iPad / desktop: the sidebar can be hidden to give the page the full width (state kept per browser in web/js/app.js) */
.sidebar-collapse, .sidebar-reopen { display: none; }
@media (min-width: 992px) {
    .sidebar { transition: transform .2s ease; }
    .sidebar-back { right: 58px; }
    .sidebar-collapse { width: 34px; height: 34px; border: 0; border-radius: 9px;
        display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; font-size: 20px; }
    .sidebar-collapse:hover, .sidebar-collapse:active { background: rgba(255, 255, 255, .2); }
    .sidebar-reopen { position: fixed; left: 14px; z-index: 1025; width: 44px; height: 44px; border: 0; border-radius: 10px;
        background: var(--navy); color: #fff; font-size: 22px; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); place-items: center; }
    body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
    body.sidebar-collapsed .main { margin-left: 0; padding-left: 72px; }
    body.sidebar-collapsed .sidebar-reopen { display: grid; }
}

/* admin.easyfakt… (management of firms): own colours and an ADMIN badge, so it is never mistaken for a firm's easyfakt */
body.upravljanje { --navy: #1f3b34; --navy-2: #18302a; --navy-3: #2c5047; }
.admin-badge { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 3px 8px; border-radius: 6px;
    background: #f2cf7d; color: #18302a; font-size: 11px; font-weight: 700; letter-spacing: .08em; line-height: 1.2; }
.auth .admin-badge { display: table; margin: 14px 0 0; font-size: 12px; }
/* in the menu under the logo: next to it the hide-menu button would cover it */
.sidebar-brand .admin-badge { display: table; margin: 8px 0 0; }

/* Invoice: recurring bar (views/fakture/_ponavljanje.php) */
.ponavljanje-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding-top: 12px; padding-bottom: 12px; }
.ponavljanje-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 0; }

/* Management: what each package includes (views/upravljanje/index.php) */
.paketi-opis .card { height: calc(100% - 16px); }
.paket-glava { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.paket-glava strong { font-size: 16px; }
.paket-glava span { color: var(--navy); font-weight: 600; white-space: nowrap; }
.paket-stavke { margin: 10px 0 0; padding-left: 18px; }
.paket-stavke li { margin: 3px 0; }

/* More fiscal devices: name form in the device card head, device title on the Fiskalna kasa page */
.fk-naziv-forma { display: flex; gap: 6px; margin-left: auto; }
.fk-naziv-forma .form-control { width: 220px; }
.fk-kasa-blok + .fk-kasa-blok { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.fk-kasa-naslov { font-weight: 600; margin-bottom: 8px; }

/* Support tickets (views/podrska, views/upravljanje/podrska + tiket): conversation like a chat, own messages right */
.tiket-razgovor { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.tiket-poruka { max-width: 78%; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.tiket-poruka.moja { align-self: flex-end; background: var(--teal-soft); border-color: #cfe9f4; }
.tiket-poruka.njihova { align-self: flex-start; }
.tiket-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tiket-tekst { white-space: normal; line-height: 1.5; overflow-wrap: anywhere; }
.tiket-prilozi { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.tiket-odgovor textarea { resize: vertical; }
.tiket-prilog-btn { cursor: pointer; margin-bottom: 0; }
.tiket-status { display: inline-block; vertical-align: middle; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tiket-status.otvoren { background: var(--warning-soft); color: var(--warning); }
.tiket-status.odgovoren { background: var(--teal-soft); color: var(--teal-2); }
.tiket-status.zatvoren { background: #eef0f4; color: var(--muted); }
.tiket-novo td { font-weight: 600; }
.tiket-tacka { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: middle; }
@media (max-width: 767px) { .tiket-poruka { max-width: 92%; } }
.tiket-prilog { display: flex; flex-direction: column; gap: 4px; }
.tiket-prilog img { max-width: 260px; max-height: 200px; border-radius: 8px; border: 1px solid var(--border); }
.tiket-prilog video { max-width: 360px; border-radius: 8px; background: #000; }
.tiket-prilozi { flex-direction: column; }
