/* ============================================
   STAR COURIER - Design System
   Kurirska služba Star
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Brand colors - Vaš Potrčko (usklađeno sa vaspotrcko.rs) */
    --brand-primary: #F79A2B;
    --brand-primary-hover: #E8890F;
    --brand-primary-dark: #B36214;
    --brand-primary-light: #FFF5E9;
    --brand-primary-text: #B36214;      /* tekst/linkovi na svetloj pozadini (kontrast) */
    --brand-on-primary: #252627;        /* tekst na narandžastoj pozadini */
    --brand-secondary: #DEFF05;
    --brand-secondary-dark: #99B805;
    --brand-secondary-light: #FAFFE5;
    --brand-secondary-text: #4D5C03;

    /* Neutrals */
    --grey-950: #141414;
    --grey-900: #252627;
    --grey-800: #2E3033;
    --grey-700: #46484B;
    --grey-600: #696969;
    --grey-500: #828282;
    --grey-400: #ADB5BD;
    --grey-300: #CED4DA;
    --grey-200: #E3E6E9;
    --grey-100: #F1F3F5;
    --grey-50: #F8F9FA;

    /* Semantic */
    --color-success: #1B9E5E;
    --color-success-bg: #E6F7EF;
    --color-danger: #D64045;
    --color-danger-bg: #FCEAEA;
    --color-warning: #E5A100;
    --color-warning-bg: #FFF7E0;
    --color-info: #3B82F6;
    --color-info-bg: #EBF2FE;

    /* Status colors */
    --status-accepted: #8B5CF6;
    --status-accepted-bg: #F3EEFE;
    --status-picked-up: #3B82F6;
    --status-picked-up-bg: #EBF2FE;
    --status-in-progress: #6B7280;
    --status-in-progress-bg: #F0F1F3;
    --status-delivered: #10B981;
    --status-delivered-bg: #E6F7EF;
    --status-unassigned: #EF4444;
    --status-unassigned-bg: #FEE2E2;
    --status-waiting: #F59E0B;
    --status-waiting-bg: #FFF7E0;
    --status-assigned: #99B805;
    --status-assigned-bg: #FAFFE5;

    /* Typography */
    --font-display: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Surface/card backgrounds */
    --card-bg: white;
    --card-row-alt: #f9f9f9;
    --card-controls-bg: #f8f9fa;

    /* Borders & Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 999px;
    --border-color: var(--grey-200);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 20, 25, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 20, 25, 0.06), 0 1px 2px rgba(15, 20, 25, 0.04);
    --shadow-md: 0 4px 8px -2px rgba(15, 20, 25, 0.06), 0 2px 4px -2px rgba(15, 20, 25, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(15, 20, 25, 0.08), 0 4px 8px -2px rgba(15, 20, 25, 0.04);
    --shadow-xl: 0 20px 40px -8px rgba(15, 20, 25, 0.12), 0 8px 16px -4px rgba(15, 20, 25, 0.06);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    background-color: var(--grey-50);
    color: var(--grey-900);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--grey-900);
    letter-spacing: -0.01em;
}

h4 {
    font-size: 18px;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
}

a {
    color: var(--brand-primary-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* --- Navbar --- */
.navbar {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    min-height: 60px;
    transition: box-shadow var(--transition-base);
}

.navbar-default {
    background: var(--grey-900);
    border-bottom: 3px solid var(--brand-secondary);
    box-shadow: var(--shadow-md);
}

.navbar-default .navbar-brand {
    padding: 12px 16px !important;
    transition: opacity var(--transition-fast);
}

.navbar-default .navbar-brand:hover {
    opacity: 0.85;
}

.navbar-default .navbar-brand img {
    height: 32px !important;
    width: auto !important;
}

.navbar-default .navbar-nav > li > a {
    font-family: var(--font-display);
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.02em;
    padding: 20px 18px;
    transition: all var(--transition-fast);
    position: relative;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.navbar-default .navbar-nav > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: calc(100% - 36px);
    height: 3px;
    background: var(--brand-secondary);
    border-radius: 3px 3px 0 0;
    transition: transform var(--transition-base);
}

.navbar-default .navbar-nav > li > a:hover::after,
.navbar-default .navbar-nav > .active > a::after {
    transform: translateX(-50%) scaleX(1);
}

.navbar-default .navbar-nav.navbar-right > li > a {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 13px;
}

.navbar-default .navbar-nav.navbar-right > li > a:hover {
    color: var(--color-danger) !important;
}

/* ============================================================
   NAVIGACIJA — grupe sa podmenijima
   ============================================================
   Aktivna stavka se u traci obelezava narandzastom crtom ispod. Ista ta crta
   se u podmeniju okrece za 90 stepeni i stoji levo od aktivne stavke, pa
   "gde sam" izgleda isto na oba nivoa. */

/* Otvorena grupa izgleda kao aktivna — inace bi traka delovala mrtvo dok je
   podmeni otvoren. */
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.navbar-default .navbar-nav > .open > a::after {
    transform: translateX(-50%) scaleX(1);
}

.navbar-default .navbar-nav > .dropdown > a .caret {
    margin-left: 6px;
    opacity: .55;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.navbar-default .navbar-nav > .dropdown.open > a .caret,
.navbar-default .navbar-nav > .dropdown > a:hover .caret {
    opacity: 1;
}

.navbar-default .navbar-nav > .dropdown.open > a .caret {
    transform: rotate(180deg);
}

/* Panel prati jezik kartica u aplikaciji, ne Bootstrap podrazumevani. */
.navbar-default .navbar-nav .dropdown-menu {
    min-width: 232px;
    margin-top: 0;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--grey-200);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.navbar-default .navbar-nav .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 9px 12px;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--grey-800);
    white-space: nowrap;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.navbar-default .navbar-nav .dropdown-menu > li > a > .fa {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--grey-500);
    transition: color var(--transition-fast);
}

.navbar-default .navbar-nav .dropdown-menu > li > a:hover,
.navbar-default .navbar-nav .dropdown-menu > li > a:focus {
    background: var(--grey-100);
    color: var(--grey-900);
}

.navbar-default .navbar-nav .dropdown-menu > li > a:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: -2px;
}

/* Ista narandzasta crta kao u traci, samo uspravno. */
.navbar-default .navbar-nav .dropdown-menu > .active > a,
.navbar-default .navbar-nav .dropdown-menu > .active > a:hover,
.navbar-default .navbar-nav .dropdown-menu > .active > a:focus {
    background: var(--brand-secondary-light);
    color: var(--grey-900);
    font-weight: 600;
}

.navbar-default .navbar-nav .dropdown-menu > .active > a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-secondary);
}

.navbar-default .navbar-nav .dropdown-menu > .active > a > .fa {
    color: var(--brand-secondary-text);
}

/* Naslov sekcije: govori sta grupa stavki jeste, umesto anonimne linije. */
.navbar-default .navbar-nav .dropdown-menu > .dropdown-header {
    padding: 10px 12px 4px;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--grey-500);
}

.navbar-default .navbar-nav .dropdown-menu > .dropdown-header:first-child {
    padding-top: 4px;
}

/* Skupljena traka (mobilni): podmeni se otvara u toku strane, pa panel treba da
   ostane taman umesto da postane bela mrlja u crnoj traci. */
@media (max-width: 767px) {
    .navbar-default .navbar-nav .open .dropdown-menu {
        padding: 0 0 6px 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .navbar-default .navbar-nav .open .dropdown-menu > li > a {
        padding-left: 34px;
        border-radius: 0;
        color: rgba(255, 255, 255, 0.75);
    }

    .navbar-default .navbar-nav .open .dropdown-menu > li > a > .fa {
        color: rgba(255, 255, 255, 0.45);
    }

    .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
    .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }

    .navbar-default .navbar-nav .open .dropdown-menu > .active > a {
        background: rgba(153, 184, 5, 0.16);
        color: #fff;
    }

    .navbar-default .navbar-nav .open .dropdown-menu > .active > a > .fa {
        color: var(--brand-secondary-text);
    }

    .navbar-default .navbar-nav .open .dropdown-menu > .dropdown-header {
        padding-left: 34px;
        color: rgba(255, 255, 255, 0.4);
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar-default .navbar-nav > .dropdown > a .caret {
        transition: none;
    }
}

.navbar-default .navbar-toggle {
    border-color: rgba(255, 255, 255, 0.2);
    margin-top: 13px;
}

.navbar-default .navbar-toggle .icon-bar,
.navbar-default .navbar-toggle .icon-baar {
    background-color: rgba(255, 255, 255, 0.75);
}

.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Navbar buttons (activate/deactivate restaurant) */
.navbar-nav > li > .btn {
    margin: 14px 12px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    padding: 6px 18px;
    border-radius: var(--radius-full);
    border: none;
    transition: all var(--transition-fast);
}

.navbar-nav > li > .btn-success {
    background: var(--color-success);
    color: white;
}

.navbar-nav > li > .btn-success:hover {
    background: #168A51;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 158, 94, 0.3);
}

.navbar-nav > li > .btn-danger {
    background: var(--color-danger);
    color: white;
}

.navbar-nav > li > .btn-danger:hover {
    background: #c0383c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 64, 69, 0.3);
}

/* --- Tabs --- */
.nav-tabs {
    border-bottom: 2px solid var(--grey-200);
    background: white;
    padding: 0 var(--space-lg);
    margin-bottom: 0;
}

.nav-tabs > li {
    margin-bottom: -2px;
}

.nav-tabs > li > a {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    color: var(--grey-500);
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 16px 20px;
    margin-right: 4px;
    transition: all var(--transition-fast);
    letter-spacing: 0.01em;
}

.nav-tabs > li > a:hover {
    background-color: transparent;
    border-color: transparent !important;
    border-bottom-color: var(--grey-300) !important;
    color: var(--grey-800);
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    color: var(--brand-primary-text);
    background-color: transparent;
    border: none !important;
    border-bottom: 3px solid var(--brand-primary) !important;
}

.tab-content {
    background: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-xl);
}

/* --- Forms --- */
.form-control {
    font-family: var(--font-body);
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 14px;
    color: var(--grey-900);
    background-color: white;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
    height: auto;
    min-height: 38px;
}

.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(247, 154, 43, 0.12);
    outline: none;
}

.form-control::placeholder {
    color: var(--grey-400);
    font-size: 13px;
}

.control-label,
label {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 12.5px;
    color: var(--grey-700);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235E6D82' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Form sections with grey background */
div[style*="background-color: lightgray"],
div[style*="background-color:lightgray"] {
    background-color: var(--grey-50) !important;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) !important;
    margin-bottom: var(--space-lg) !important;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.form-check-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-700);
}

.form-check-input {
    margin-left: var(--space-sm);
    accent-color: var(--brand-primary);
}

/* --- Buttons --- */
.btn {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-hover));
    color: var(--brand-on-primary);
    box-shadow: 0 2px 8px rgba(247, 154, 43, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--brand-primary-hover), #D97F0E);
    color: var(--brand-on-primary);
    box-shadow: 0 4px 16px rgba(247, 154, 43, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success), #168A51);
    color: white;
    box-shadow: 0 2px 8px rgba(27, 158, 94, 0.25);
}

.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(135deg, #168A51, #127A47);
    color: white;
    box-shadow: 0 4px 16px rgba(27, 158, 94, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #c0383c);
    color: white;
    box-shadow: 0 2px 8px rgba(214, 64, 69, 0.25);
}

.btn-danger:hover,
.btn-danger:focus {
    background: linear-gradient(135deg, #c0383c, #a83035);
    color: white;
    box-shadow: 0 4px 16px rgba(214, 64, 69, 0.35);
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, var(--brand-secondary), var(--brand-secondary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(153, 184, 5, 0.25);
}

.btn-info:hover,
.btn-info:focus {
    background: linear-gradient(135deg, var(--brand-secondary-dark), #7A9304);
    color: white;
    box-shadow: 0 4px 16px rgba(153, 184, 5, 0.35);
    transform: translateY(-1px);
}

.btn-xs {
    font-size: 11.5px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.btn-detail,
.btn-xs.btn-detail {
    min-width: 65px;
}

/* Swap button (fa-refresh) */
button.info {
    background: white;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-sm);
    color: var(--grey-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

button.info:hover {
    background: var(--grey-50);
    border-color: var(--brand-primary);
    color: var(--brand-primary-text);
}

/* --- Tables --- */
.table {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    border-collapse: separate;
    border-spacing: 0;
}

.table > thead > tr > th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grey-600);
    background: var(--grey-50);
    border-bottom: 2px solid var(--grey-200) !important;
    padding: 12px 10px !important;
    text-align: center !important;
    white-space: nowrap;
}

th {
    text-align: center !important;
}

td {
    text-align: center;
    vertical-align: middle !important;
    font-size: 13px;
    color: var(--grey-800);
}

#orders td {
    padding: 8px 8px;
    border-bottom: 1px solid var(--grey-100);
    transition: background-color var(--transition-fast);
}

#orders tr:nth-child(even) {
    background-color: var(--grey-50) !important;
}

#orders tr:hover {
    background-color: var(--brand-primary-light) !important;
}

.table > tbody > tr > td {
    border-top: 1px solid var(--grey-100);
    padding: 10px 8px;
}

.table > tbody > tr:last-child > td {
    border-bottom: none;
}

.table-responsive {
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin-top: var(--space-md);
}

h4.orders-counter + .table-responsive {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-top: 0;
}

/* --- Status Badges (table cells) --- */
td[style*="background-color: violet"],
td[style*="background-color:violet"] {
    background-color: var(--status-accepted-bg) !important;
    color: var(--status-accepted) !important;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
    border-radius: var(--radius-full);
    position: relative;
}

td[style*="background-color: dodgerblue"],
td[style*="background-color:dodgerblue"] {
    background-color: var(--status-picked-up-bg) !important;
    color: var(--status-picked-up) !important;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

td[style*="background-color: darkgrey"],
td[style*="background-color:darkgrey"] {
    background-color: var(--status-in-progress-bg) !important;
    color: var(--status-in-progress) !important;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

td[style*="background-color: lightgreen"],
td[style*="background-color:lightgreen"] {
    background-color: var(--status-delivered-bg) !important;
    color: var(--status-delivered) !important;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

td[style*="background-color: red"],
td[style*="background-color:red"] {
    background-color: var(--status-unassigned-bg) !important;
    color: var(--status-unassigned) !important;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

td[style*="background-color: orange"],
td[style*="background-color:orange"] {
    background-color: var(--status-waiting-bg) !important;
    color: var(--status-waiting) !important;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

td[style*="background-color: indianred"],
td[style*="background-color:indianred"] {
    background-color: var(--status-assigned-bg) !important;
    color: var(--status-assigned) !important;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.02em;
}

/* Check / X icons in status */
.fa-check {
    color: var(--color-success) !important;
    font-size: 14px;
}

.fa-times {
    color: var(--color-danger) !important;
    font-size: 14px;
}

/* --- Modals --- */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--grey-900), var(--grey-800));
    color: white;
    border-bottom: 3px solid var(--brand-secondary);
    padding: 18px 24px;
}

.modal-header .modal-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    color: white;
}

.modal-header .close {
    color: rgba(255, 255, 255, 0.7);
    opacity: 1;
    text-shadow: none;
    font-size: 24px;
    transition: color var(--transition-fast);
}

.modal-header .close:hover {
    color: white;
}

.modal-body {
    padding: 24px;
    background: white;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .control-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--grey-600);
    font-weight: 600;
}

.modal-footer {
    background: var(--grey-50);
    border-top: 1px solid var(--grey-200);
    padding: 16px 24px;
}

.modal-backdrop.in {
    opacity: 0.4;
    backdrop-filter: blur(2px);
}

.modal.fade .modal-dialog {
    transition: transform var(--transition-base), opacity var(--transition-base);
    transform: translateY(-20px) scale(0.98);
}

.modal.in .modal-dialog {
    transform: translateY(0) scale(1);
}

/* --- Pagination & Print --- */
div.page {
    page-break-after: always;
    page-break-inside: avoid;
}

/* --- POI Autocomplete Dropdown --- */
.poi-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    list-style: none;
    margin: 2px 0 0 0;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
}

.poi-dropdown li {
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid var(--grey-100);
    color: var(--grey-900);
    transition: background-color var(--transition-fast);
}

.poi-dropdown li:last-child {
    border-bottom: none;
}

.poi-dropdown li:hover {
    background-color: var(--brand-primary-light);
    color: var(--brand-primary-text);
}

[data-theme="dark"] .poi-dropdown li:hover {
    background-color: rgba(247, 154, 43, 0.18);
    color: var(--brand-primary-text);
}

/* --- Google PAC container (Address autocomplete) --- */
div.pac-container {
    z-index: 99999999999 !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    border: 1px solid var(--grey-200) !important;
    margin-top: 4px !important;
    font-family: var(--font-body) !important;
}

.pac-item {
    padding: 8px 14px !important;
    font-size: 13px !important;
    border-bottom: 1px solid var(--grey-100) !important;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.pac-item:hover {
    background-color: var(--brand-primary-light) !important;
}

.pac-item-query {
    font-size: 13px !important;
    color: var(--grey-900) !important;
}

/* --- Clockpicker --- */
.clockpicker-popover {
    z-index: 999999 !important;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* --- Utility Classes --- */
.project-listing {
    margin: 0 auto;
    display: flex;
}

.img_div {
    margin: auto;
}

.text-xs {
    font-size: 13px;
}

/* --- Login Page --- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--grey-900) 0%, var(--grey-800) 50%, var(--brand-primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 70%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(153, 184, 5, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse, rgba(247, 154, 43, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: loginSlideUp 0.5s ease-out;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

@keyframes loginSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    height: 56px;
    width: auto;
}

.login-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--grey-900);
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: -0.02em;
}

.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .form-group label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--grey-700);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.login-card .form-control {
    height: 46px;
    border-radius: var(--radius-md);
    font-size: 15px;
    padding: 10px 16px;
    border: 1.5px solid var(--grey-200);
    transition: all var(--transition-fast);
}

.login-card .form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(247, 154, 43, 0.1);
}

.login-card .btn-primary {
    height: 48px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-hover));
    border: none;
    box-shadow: 0 4px 16px rgba(247, 154, 43, 0.3);
    margin-top: 8px;
}

.login-card .btn-primary:hover {
    box-shadow: 0 6px 24px rgba(247, 154, 43, 0.4);
    transform: translateY(-2px);
}

/* --- jQuery Toast overrides --- */
.jq-toast-single {
    border-radius: var(--radius-md) !important;
    font-family: var(--font-body) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 14px 20px !important;
    font-size: 14px !important;
}

/* --- DatePicker overrides --- */
.ui-datepicker {
    font-family: var(--font-body) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    border: 1px solid var(--grey-200) !important;
    padding: 8px !important;
}

.ui-datepicker-header {
    background: var(--brand-primary) !important;
    border: none !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    color: var(--brand-on-primary) !important;
}

.ui-datepicker-header a {
    color: white !important;
}

.ui-state-active,
.ui-widget-content .ui-state-active {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-on-primary) !important;
    border-radius: var(--radius-sm) !important;
}

.ui-state-hover,
.ui-widget-content .ui-state-hover {
    background: var(--brand-primary-light) !important;
    border-color: var(--brand-primary-light) !important;
    color: var(--brand-primary-text) !important;
    border-radius: var(--radius-sm) !important;
}

/* --- Header Counter --- */
h4.text-center {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--grey-800);
    background: var(--grey-50);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
    display: inline-block;
    margin: var(--space-lg) auto;
    width: 100%;
    text-align: center;
}

h4.orders-counter {
    margin: 0 0 0 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: none;
}

/* --- Delivery time coloring --- */
td[style*="color: green"] {
    color: var(--color-success) !important;
    font-weight: 600;
}

td[style*="color: orange"] {
    color: var(--color-warning) !important;
    font-weight: 600;
}

td[style*="color: red"] {
    color: var(--color-danger) !important;
    font-weight: 600;
}

/* --- Map container --- */
#mapSmall {
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

#map {
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .navbar-default .navbar-collapse {
        background: var(--grey-900);
        border: none;
    }

    .nav-tabs {
        padding: 0 var(--space-sm);
        display: flex;
        overflow-x: auto;
    }

    .nav-tabs > li > a {
        font-size: 13px;
        padding: 12px 14px;
        white-space: nowrap;
    }

    .tab-content {
        padding: var(--space-md);
    }

    .login-card {
        margin: var(--space-md);
        padding: 36px 28px;
    }

    h4.text-center {
        font-size: 14px;
        padding: 10px 14px;
    }

    .table > thead > tr > th {
        font-size: 10.5px;
        padding: 8px 6px !important;
    }

    #orders td {
        padding: 6px 4px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .navbar-default .navbar-brand img {
        height: 26px !important;
    }

    .login-card {
        padding: 28px 20px;
    }
}

/* --- Print Styles --- */
@media print {
    .navbar,
    .nav-tabs,
    .btn,
    .modal {
        display: none !important;
    }

    body {
        background: white;
        font-size: 12px;
    }

    .tab-content {
        box-shadow: none;
        padding: 0;
    }

    .table {
        font-size: 11px;
    }

    .table > thead > tr > th {
        background: var(--grey-100) !important;
        -webkit-print-color-adjust: exact;
    }
}

/* --- Subtle Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tab-pane.active {
    animation: fadeIn 0.3s ease-out;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--grey-50);
}

::-webkit-scrollbar-thumb {
    background: var(--grey-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--grey-400);
}

/* --- Container fluid spacing --- */
.container-fluid {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

/* ============================================
   Order Form - Compact Layout
   ============================================ */
.order-form-panel {
    background: var(--grey-50) !important;
    border: 1.5px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg) var(--space-lg) !important;
    margin-bottom: var(--space-lg) !important;
}

.order-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--grey-200);
}

.order-form-title {
    font-family: var(--font-display) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--grey-800) !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
}

.order-form-title .fa-plus-circle {
    color: var(--brand-secondary-text);
    font-size: 16px;
}

/* Map toggle button - push to right */
.btn-map-toggle {
    margin-left: auto;
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--grey-600);
    background: white;
    border: 1.5px solid var(--grey-200) !important;
    border-radius: var(--radius-full);
    padding: 5px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-xs);
}

.btn-map-toggle:hover,
.btn-map-toggle:focus {
    color: var(--brand-primary-text);
    border-color: var(--brand-primary) !important;
    background: var(--brand-primary-light);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.btn-map-toggle .fa {
    font-size: 13px;
}

/* Form Grid */
.order-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 10px 12px;
    align-items: end;
}

/* Row 1 fields */
.order-field--client    { grid-column: span 2; }
.order-field--time      { grid-column: span 1; }
.order-field--courier-time { grid-column: span 1; }
.order-field--pickup    { grid-column: span 3; }
.order-field--swap      { grid-column: span 1; display: flex; align-items: flex-end; justify-content: center; }
.order-field--delivery  { grid-column: span 3; }

/* Row 2 fields - pad last slot */
.order-field--order-num   { grid-column: span 2; }
.order-field--redemption  { grid-column: span 1; }
.order-field--price       { grid-column: span 1; }
.order-field--invoice     { grid-column: span 1; }
.order-field--comment     { grid-column: span 3; }
.order-field--nosend      { grid-column: span 2; }
.order-field--submit      { grid-column: span 2; }

.order-field label.control-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Swap button */
.btn-swap {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white !important;
    border: 1.5px solid var(--grey-200) !important;
    border-radius: var(--radius-sm);
    color: var(--grey-500);
    font-size: 14px;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
}

.btn-swap:hover {
    color: var(--brand-primary-text) !important;
    border-color: var(--brand-primary) !important;
    background: var(--brand-primary-light) !important;
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Checkbox inline */
.checkbox-inline-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 4px;
}

.checkbox-inline-wrap .form-check-input {
    margin: 0;
    width: 16px;
    height: 16px;
}

.checkbox-inline-wrap .form-check-label {
    margin: 0;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0;
}

/* Submit button in form */
.order-field--submit .btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 13px;
}

/* Map wrapper */
/* Dugme za uklapanje kurira u mapu. Živi u Google-ovom sloju kontrola, pa mora
   samo da liči na njih — bela podloga, ista senka, isti radijus — inače štrči. */
.map-fit-btn {
    margin-top: 10px;
    padding: 7px 13px;
    border: 0;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-800);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.map-fit-btn:hover { background: #f4f6f8; }

.map-fit-btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

.map-fit-btn .fa { margin-right: 5px; color: var(--brand-secondary-text); }

.order-map-wrapper {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--grey-200);
    overflow: hidden;
    animation: mapSlideDown 0.3s ease-out;
}

@keyframes mapSlideDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
        padding-top: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.order-map-container {
    min-height: 280px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* --- Orders Toolbar (above table) --- */
.orders-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    padding: 0;
}

.btn-new-order {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: white;
    background: linear-gradient(135deg, var(--brand-secondary), var(--brand-secondary-dark));
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 22px;
    box-shadow: 0 3px 12px rgba(153, 184, 5, 0.3);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-new-order:hover,
.btn-new-order:focus {
    background: linear-gradient(135deg, var(--brand-secondary-dark), #7A9304);
    color: white;
    box-shadow: 0 5px 20px rgba(153, 184, 5, 0.4);
    transform: translateY(-2px);
}

.btn-new-order:active {
    transform: translateY(0) scale(0.98);
}

.btn-new-order .fa {
    font-size: 13px;
}

/* New order modal - wider body */
#modalNewOrder .modal-body {
    padding: 24px 28px;
}

#modalNewOrder .form-group {
    margin-bottom: 16px;
}

#modalNewOrder .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-default {
    font-family: var(--font-display);
    font-weight: 600;
    background: white;
    color: var(--grey-600);
    border: 1.5px solid var(--grey-200) !important;
    border-radius: var(--radius-sm);
    padding: 8px 20px;
    transition: all var(--transition-fast);
}

.btn-default:hover {
    background: var(--grey-50);
    color: var(--grey-800);
    border-color: var(--grey-300) !important;
}

/* Responsive: stack on smaller screens */
@media (max-width: 1200px) {
    .order-field--client    { grid-column: span 3; }
    .order-field--time      { grid-column: span 2; }
    .order-field--courier-time { grid-column: span 2; }
    .order-field--pickup    { grid-column: span 4; }
    .order-field--swap      { grid-column: span 1; }
    .order-field--delivery  { grid-column: span 4; }

    .order-field--order-num   { grid-column: span 2; }
    .order-field--redemption  { grid-column: span 2; }
    .order-field--price       { grid-column: span 2; }
    .order-field--invoice     { grid-column: span 2; }
    .order-field--comment     { grid-column: span 4; }
    .order-field--nosend      { grid-column: span 3; }
    .order-field--submit      { grid-column: span 3; }
}

@media (max-width: 768px) {
    .order-form-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 8px;
    }

    .order-field--client    { grid-column: span 3; }
    .order-field--time      { grid-column: span 3; }
    .order-field--courier-time { grid-column: span 3; }
    .order-field--pickup    { grid-column: span 5; }
    .order-field--swap      { grid-column: span 1; }
    .order-field--delivery  { grid-column: span 6; }
    .order-field--order-num { grid-column: span 3; }
    .order-field--redemption { grid-column: span 3; }
    .order-field--price     { grid-column: span 3; }
    .order-field--invoice   { grid-column: span 3; }
    .order-field--comment   { grid-column: span 6; }
    .order-field--nosend    { grid-column: span 3; }
    .order-field--submit    { grid-column: span 3; }

    .order-form-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* --- Toolbar Client Filter --- */
.toolbar-client-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: var(--space-md);
}

.toolbar-filter-label {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 !important;
    white-space: nowrap;
}

.toolbar-client-filter .form-control {
    min-width: 180px;
    max-width: 250px;
    height: 36px;
    min-height: 36px;
    font-size: 13px;
    padding: 4px 28px 4px 10px;
}

/* --- Compact Table --- */
.table-compact {
    font-size: 12px;
}

.table-compact > thead > tr > th {
    font-size: 10.5px !important;
    padding: 8px 6px !important;
    white-space: nowrap;
}

.table-compact > tbody > tr > td {
    padding: 6px 5px !important;
    font-size: 12px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Address Autocomplete --- */
.ui-autocomplete {
    z-index: 10500 !important;
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font-body);
    font-size: 13px;
    border: 1px solid var(--grey-200);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.ui-autocomplete .ui-menu-item-wrapper {
    padding: 8px 12px;
}
.ui-autocomplete .ui-state-active {
    background: var(--brand-primary-light) !important;
    color: var(--grey-900) !important;
    border-color: transparent !important;
}

/* --- Map Tab --- */
.map-tab-container {
    display: flex;
    height: calc(100vh - 160px);
    min-height: 500px;
    gap: var(--space-md);
}

.map-tab-sidebar {
    width: 220px;
    min-width: 220px;
    overflow-y: auto;
    padding: var(--space-md);
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
}

.map-tab-sidebar-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--grey-800);
    margin: 0 0 var(--space-md) 0;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--brand-primary);
}

.map-tab-radio {
    padding: 4px 0;
}

.map-tab-radio label {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-800);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
    margin: 0;
}

.map-tab-radio label:hover {
    background: var(--brand-primary-light);
}

.map-tab-radio input[type="radio"] {
    accent-color: var(--brand-primary);
    margin: 0;
}

.map-tab-map {
    flex: 1;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    min-height: 100%;
}

@media (max-width: 768px) {
    .map-tab-container {
        flex-direction: column;
        height: auto;
    }

    .map-tab-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 200px;
    }

    .map-tab-map {
        min-height: 400px;
    }
}

/* ============================================================
   STATISTICS PAGE
   ============================================================ */

.stats-page {
    padding: var(--space-lg) var(--space-lg) var(--space-2xl);
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Header --- */
.stats-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stats-page-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stats-page-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--grey-900);
}

.stats-page-title .fa {
    font-size: 20px;
    color: var(--brand-primary-text);
}

/* --- Filter bar --- */
.stats-filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.stats-presets {
    display: flex;
    gap: 4px;
    background: var(--grey-100);
    border-radius: var(--radius-md);
    padding: 3px;
}

.stats-preset-btn {
    background: none;
    border: none;
    padding: 5px 12px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--grey-600);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.stats-preset-btn:hover {
    background: white;
    color: var(--grey-900);
}

.stats-preset-btn.active {
    background: white;
    color: var(--brand-primary-text);
    font-weight: 600;
    box-shadow: var(--shadow-xs);
}

.stats-date-range {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stats-date-range .form-control {
    width: 110px;
    height: 32px;
    font-size: 13px;
    padding: 4px 10px;
}

.stats-date-sep {
    color: var(--grey-400);
    font-weight: 500;
}

.stats-apply-btn {
    height: 32px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* --- Tabs --- */
.stats-tabs {
    border-bottom: 2px solid var(--grey-200);
    margin-bottom: 0;
}

.stats-tabs > li > a {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-600);
    padding: 10px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
    transition: all var(--transition-fast);
}

.stats-tabs > li > a .fa {
    margin-right: 5px;
    font-size: 12px;
}

.stats-tabs > li > a:hover {
    color: var(--brand-primary-text);
    background: none;
    border-bottom-color: var(--grey-200);
}

.stats-tabs > li.active > a,
.stats-tabs > li.active > a:hover,
.stats-tabs > li.active > a:focus {
    color: var(--brand-primary-text);
    font-weight: 600;
    border-bottom: 2px solid var(--brand-primary);
    background: none;
}

.stats-tab-content {
    padding-top: var(--space-lg);
}

/* --- Loading state --- */
.stats-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-2xl);
    color: var(--grey-500);
    font-size: 14px;
}

.stats-loading .fa-spinner {
    font-size: 20px;
    color: var(--brand-primary-text);
}

/* --- KPI cards --- */
.stats-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stats-kpi-card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
    border-left: 4px solid var(--kpi-color, var(--brand-primary));
    padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) - 4px);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.stats-kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.kpi-body {
    flex: 1;
    min-width: 0;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--grey-900);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.kpi-value small {
    font-size: 14px;
    font-weight: 500;
    color: var(--grey-500);
    letter-spacing: 0;
}

.kpi-label {
    font-size: 12px;
    color: var(--grey-500);
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.kpi-delta.delta-up {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.kpi-delta.delta-down {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.kpi-delta.delta-neutral {
    background: var(--grey-100);
    color: var(--grey-500);
    font-weight: 400;
}

/* --- Leaderboard row states --- */
.perf-rank-1 { background: rgba(245, 166, 35, 0.06) !important; }
.perf-rank-2 { background: rgba(170, 170, 170, 0.05) !important; }
.perf-rank-3 { background: rgba(205, 127, 50, 0.05) !important; }
.perf-ineligible { opacity: 0.45; }
.perf-ineligible td { color: var(--grey-500) !important; }

/* --- Chart cards --- */
.stats-chart-card {
    background: white;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.stats-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--grey-100);
}

.stats-chart-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--grey-800);
}

.stats-chart-title .fa {
    margin-right: 6px;
    color: var(--brand-primary-text);
    font-size: 13px;
}

.stats-chart-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--grey-500);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stats-chart-body {
    padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.stats-chart-wrap {
    position: relative;
}

/* Two-column chart row */
.stats-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

/* --- Coming soon placeholder --- */
.stats-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--grey-400);
    text-align: center;
}

.stats-coming-soon .fa {
    font-size: 48px;
    margin-bottom: var(--space-md);
    color: var(--grey-200);
}

.stats-coming-soon h3 {
    font-size: 18px;
    color: var(--grey-500);
    margin-bottom: var(--space-sm);
}

.stats-coming-soon p {
    font-size: 13px;
    color: var(--grey-400);
    max-width: 420px;
    line-height: 1.7;
}

/* --- 4-column KPI row variant (Finansije) --- */
.stats-kpi-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* --- Finance table totals row --- */
.stats-fin-table tbody tr.stats-totals-row td {
    border-top: 2px solid var(--grey-200);
    background: var(--grey-50);
    font-size: 13px;
}

/* --- CSV button in chart header --- */
.stats-csv-btn {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    color: var(--grey-600);
    border-color: var(--grey-200);
}

.stats-csv-btn:hover {
    color: var(--brand-primary-text);
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
}

/* --- 1/3 + 2/3 chart row variant --- */
/* Dva kruga u istoj kartici — udeo po broju dostava i po prometu. Pola reda,
   jer u trećini bi svaki bio premali da se pročita. */
.stats-charts-row-halves {
    grid-template-columns: 1fr 1fr;
}

.stats-split-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stats-split-label {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--grey-500);
    margin-bottom: 6px;
}

@media (max-width: 900px) {
    .stats-charts-row-halves { grid-template-columns: 1fr; }
    .stats-split-pair { grid-template-columns: 1fr; }
}

.stats-charts-row-thirds {
    grid-template-columns: 1fr 2fr;
}

.stats-chart-two-thirds {
    /* spans the wider column naturally */
}

/* --- Heatmap --- */
.stats-heatmap-wrap {
    overflow-x: auto;
    padding: 4px 0;
}

.stats-heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    font-size: 12px;
    font-family: var(--font-body);
}

.stats-heatmap-table thead th {
    font-weight: 600;
    color: var(--grey-500);
    text-align: center;
    padding: 4px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: none;
}

.stats-heatmap-table thead th.heatmap-label-col {
    text-align: left;
    min-width: 130px;
}

.stats-heatmap-table .heatmap-client-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--grey-700);
    padding: 5px 6px;
    white-space: nowrap;
}

.stats-heatmap-table .heatmap-cell {
    text-align: center;
    width: 52px;
    height: 36px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: default;
    transition: opacity 0.15s;
}

.stats-heatmap-table .heatmap-cell:hover {
    opacity: 0.85;
}

/* --- Pregled heatmap: hour x day-of-week --- */
.stats-heatmap-pregled {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    font-family: var(--font-display);
}
.shp-day-col  { width: 46px; }
.shp-hour-th  {
    font-size: 10px;
    font-weight: 600;
    color: var(--grey-500);
    text-align: center;
    padding: 0 2px 6px;
    min-width: 0;
    white-space: nowrap;
}
.shp-total-th {
    font-size: 11px;
    font-weight: 700;
    color: var(--grey-600);
    text-align: center;
    padding: 0 4px 6px;
    min-width: 36px;
}
.shp-day-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--grey-700);
    padding: 4px 10px 4px 2px;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.shp-day-label.shp-weekend { color: var(--brand-secondary-text); }
.shp-day-label.shp-footer-label {
    color: var(--grey-500);
    font-size: 13px;
}
.shp-cell {
    text-align: center;
    height: 30px;
    min-width: 28px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: default;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    position: relative;
}
.shp-cell:hover {
    transform: scale(1.25);
    box-shadow: 0 3px 10px rgba(247, 154, 43, 0.28);
    z-index: 2;
}
.shp-cell.shp-peak {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}
.shp-row-total {
    font-size: 12px;
    font-weight: 700;
    color: var(--grey-600);
    text-align: right;
    padding: 4px 2px 4px 8px;
    white-space: nowrap;
}
.shp-row-total.shp-grand-total {
    color: var(--brand-primary-text);
    font-size: 13px;
}
.shp-footer .shp-footer-cell {
    font-size: 10px;
    font-weight: 600;
    color: var(--grey-500);
    text-align: center;
    padding: 6px 2px 2px;
    border-top: 1px solid var(--grey-100);
}
/* Legend */
.shp-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    justify-content: flex-end;
}
.shp-legend-label {
    font-size: 11px;
    color: var(--grey-500);
    font-family: var(--font-display);
    white-space: nowrap;
}
.shp-legend-gradient {
    width: 120px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #FFF5E9, #FFE2C2 35%, #F79A2B 70%, #B36214);
    border: 1px solid var(--grey-100);
}
/* Header legend inline */
.stats-heatmap-legend-inline {
    font-size: 11px;
    color: var(--grey-400);
    font-family: var(--font-display);
}

/* --- Client type badge --- */
.stats-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.stats-type-badge.type-restaurant {
    background: rgba(153, 184, 5, 0.12);
    color: #C4671A;
}

.stats-type-badge.type-business {
    background: rgba(247, 154, 43, 0.10);
    color: var(--brand-primary-text);
}

/* --- KPI value small variant (for long text like client name) --- */
.kpi-value-sm {
    font-size: 16px !important;
    line-height: 1.3;
    word-break: break-word;
}

/* --- Driver stats table --- */
.stats-driver-table {
    font-size: 13px;
    margin-bottom: 0;
}

.stats-driver-table thead th {
    font-weight: 600;
    font-size: 12px;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--grey-100);
    padding: 10px 12px;
    white-space: nowrap;
    text-align: center;
}

.stats-driver-table thead th:first-child,
.stats-driver-table tbody td:first-child { text-align: left; }

/* Client table: first two cols left (Klijent + Tip badge) */
.stats-client-table thead th:nth-child(2),
.stats-client-table tbody td:nth-child(2) { text-align: left; }

.stats-driver-table tbody td { text-align: center; }

.stats-driver-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.stats-driver-table thead th.sortable:hover {
    color: var(--brand-primary-text);
}

.stats-driver-table tbody td {
    padding: 9px 12px;
    vertical-align: middle;
    border-top: 1px solid var(--grey-50);
    color: var(--grey-700);
}

.stats-driver-table tbody tr:hover td {
    background: var(--grey-50);
}

.stats-pct-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.stats-pct-badge.pct-good {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.stats-pct-badge.pct-ok {
    background: rgba(245, 158, 11, 0.12);
    color: #D97706;
}

.stats-pct-badge.pct-bad {
    background: rgba(214, 64, 69, 0.12);
    color: var(--color-danger);
}

.stats-cost-per-km {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(247, 154, 43, 0.08);
    color: var(--brand-primary-text);
}

.stats-sort-hint {
    font-size: 11px;
    color: var(--grey-400);
    font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .stats-kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .stats-charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-page {
        padding: var(--space-md);
    }

    .stats-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-filter-bar {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-presets {
        overflow-x: auto;
        width: 100%;
    }

    .stats-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-tabs > li > a {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* =============================================================================
   DARK MODE
   Activated via [data-theme="dark"] on <html>
   ============================================================================= */

/* --- Variable overrides --- */
[data-theme="dark"] {
    /* Invert grey scale (50 ↔ 950) */
    --grey-50:  #1B1C1D;
    --grey-100: #252627;
    --grey-200: #2E3033;
    --grey-300: #3B3D40;
    --grey-400: #46484B;
    --grey-500: #828282;
    --grey-600: #A0A0A0;
    --grey-700: #B8B8B8;
    --grey-800: #D0D0D0;
    --grey-900: #EDEDED;
    --grey-950: #F8F9FA;

    /* Tinted accent backgrounds (replace light pastels with dark tints) */
    --brand-primary-light:    rgba(247, 154, 43, 0.16);
    --brand-primary-text:     #F79A2B;
    --brand-secondary-text:   #DEFF05;
    --brand-secondary-light:  rgba(222, 255, 5, 0.12);
    --color-success-bg:      rgba(27, 158, 94, 0.18);
    --color-danger-bg:       rgba(214, 64, 69, 0.18);
    --color-warning-bg:      rgba(229, 161, 0, 0.18);
    --color-info-bg:         rgba(59, 130, 246, 0.18);
    --status-accepted-bg:    rgba(139, 92, 246, 0.18);
    --status-picked-up-bg:   rgba(59, 130, 246, 0.18);
    --status-in-progress-bg: rgba(107, 114, 128, 0.18);
    --status-delivered-bg:   rgba(16, 185, 129, 0.18);
    --status-unassigned-bg:  rgba(239, 68, 68, 0.18);
    --status-waiting-bg:     rgba(245, 158, 11, 0.18);
    --status-assigned-bg:    rgba(222, 255, 5, 0.12);

    /* Surface/card backgrounds */
    --card-bg: var(--grey-100);
    --card-row-alt: var(--grey-200);
    --card-controls-bg: var(--grey-200);

    /* Border */
    --border-color: #2E3033;

    /* Shadows — more opaque on dark */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.5), 0 4px 8px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 40px -8px rgba(0, 0, 0, 0.6), 0 8px 16px -4px rgba(0, 0, 0, 0.4);
}

/* --- Base --- */
[data-theme="dark"] body {
    background-color: var(--grey-50);
    color: var(--grey-900);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--grey-900);
}

/* --- Navbar (already dark — minor tweaks) --- */
[data-theme="dark"] .navbar-default {
    background: #0A1520;
    border-bottom-color: var(--brand-secondary);
}

/* U tamnoj temi --grey-100 postaje jednak --card-bg, pa bi hover bio nevidljiv. */
[data-theme="dark"] .navbar-default .navbar-nav .dropdown-menu {
    background: #101C28;
    border-color: var(--grey-300);
}

[data-theme="dark"] .navbar-default .navbar-nav .dropdown-menu > li > a:hover,
[data-theme="dark"] .navbar-default .navbar-nav .dropdown-menu > li > a:focus {
    background: var(--grey-200);
}

[data-theme="dark"] .navbar-default .navbar-nav .dropdown-menu > .active > a > .fa {
    color: var(--brand-secondary-text);
}

/* --- Tabs --- */
[data-theme="dark"] .nav-tabs {
    background: var(--grey-100);
    border-bottom-color: var(--grey-200);
}

[data-theme="dark"] .nav-tabs > li > a {
    color: var(--grey-600);
}

[data-theme="dark"] .nav-tabs > li > a:hover {
    color: var(--grey-800);
    border-bottom-color: var(--grey-500) !important;
}

[data-theme="dark"] .nav-tabs > li.active > a,
[data-theme="dark"] .nav-tabs > li.active > a:hover,
[data-theme="dark"] .nav-tabs > li.active > a:focus {
    color: #5BAEE8;
    border-bottom-color: #5BAEE8 !important;
}

[data-theme="dark"] .tab-content {
    background: var(--grey-100);
    box-shadow: var(--shadow-sm);
}

/* --- Forms --- */
[data-theme="dark"] .form-control {
    background-color: var(--grey-200);
    border-color: var(--grey-300);
    color: var(--grey-900);
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--grey-200);
    border-color: var(--brand-primary);
    color: var(--grey-900);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--grey-500);
}

[data-theme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238096AE' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .control-label,
[data-theme="dark"] label {
    color: var(--grey-700);
}

[data-theme="dark"] div[style*="background-color: lightgray"],
[data-theme="dark"] div[style*="background-color:lightgray"] {
    background-color: var(--grey-200) !important;
    border-color: var(--grey-300);
}

/* --- Buttons (default / secondary) --- */
[data-theme="dark"] .btn-default {
    background: var(--grey-200);
    border-color: var(--grey-300);
    color: var(--grey-800);
}

[data-theme="dark"] .btn-default:hover,
[data-theme="dark"] .btn-default:focus {
    background: var(--grey-300);
    color: var(--grey-900);
}

[data-theme="dark"] button.info {
    background: var(--grey-200);
    border-color: var(--grey-300);
    color: var(--grey-700);
}

[data-theme="dark"] button.info:hover {
    background: var(--grey-300);
}

/* --- Tables --- */
[data-theme="dark"] .table {
    background: var(--grey-100);
}

[data-theme="dark"] .table > thead > tr > th {
    background: var(--grey-200);
    color: var(--grey-700);
    border-bottom-color: var(--grey-300) !important;
}

[data-theme="dark"] td {
    color: var(--grey-800);
}

[data-theme="dark"] .table > tbody > tr > td {
    border-top-color: var(--grey-200);
}

[data-theme="dark"] #orders tr:nth-child(even) {
    background-color: var(--grey-200) !important;
}

[data-theme="dark"] #orders tr:hover {
    background-color: rgba(247, 154, 43, 0.12) !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--grey-200);
}

[data-theme="dark"] .table > tbody > tr > td,
[data-theme="dark"] .table > tbody > tr > th {
    color: var(--grey-800);
}

[data-theme="dark"] .table-responsive {
    border-color: var(--grey-300);
}

/* --- Modals --- */
[data-theme="dark"] .modal-content {
    background: var(--grey-100);
}

[data-theme="dark"] .modal-body {
    background: var(--grey-100);
    color: var(--grey-900);
}

[data-theme="dark"] .modal-footer {
    background: var(--grey-200);
    border-top-color: var(--grey-300);
}

[data-theme="dark"] .modal-backdrop.in {
    opacity: 0.7;
}

/* --- Dropdowns --- */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--grey-200);
    border-color: var(--grey-300);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .dropdown-menu > li > a {
    color: var(--grey-800);
}

[data-theme="dark"] .dropdown-menu > li > a:hover,
[data-theme="dark"] .dropdown-menu > li > a:focus {
    background-color: var(--grey-300);
    color: var(--grey-900);
}

[data-theme="dark"] .dropdown-menu .divider {
    background-color: var(--grey-300);
}

/* --- PAC autocomplete --- */
[data-theme="dark"] div.pac-container {
    background: var(--grey-200) !important;
    border-color: var(--grey-300) !important;
}

[data-theme="dark"] .pac-item {
    border-top-color: var(--grey-300) !important;
    color: var(--grey-800) !important;
}

[data-theme="dark"] .pac-item:hover {
    background: var(--grey-300) !important;
}

[data-theme="dark"] .pac-item-query {
    color: var(--grey-900) !important;
}

/* --- jQuery UI Datepicker --- */
[data-theme="dark"] .ui-datepicker {
    background: var(--grey-200) !important;
    border-color: var(--grey-300) !important;
    color: var(--grey-900) !important;
}

[data-theme="dark"] .ui-datepicker-header {
    background: var(--grey-300) !important;
    border-color: var(--grey-300) !important;
    color: var(--grey-900) !important;
}

[data-theme="dark"] .ui-datepicker td a,
[data-theme="dark"] .ui-datepicker td span {
    color: var(--grey-800) !important;
}

[data-theme="dark"] .ui-datepicker td.ui-datepicker-today a {
    background: rgba(247, 154, 43, 0.3) !important;
    color: #5BAEE8 !important;
}

[data-theme="dark"] .ui-datepicker td.ui-state-active a,
[data-theme="dark"] .ui-datepicker td a.ui-state-active {
    background: var(--brand-primary) !important;
    color: var(--brand-on-primary) !important;
}

[data-theme="dark"] .ui-datepicker td a:hover {
    background: var(--grey-300) !important;
}

[data-theme="dark"] .ui-datepicker-prev,
[data-theme="dark"] .ui-datepicker-next {
    color: var(--grey-700) !important;
}

/* --- Statistics page --- */
[data-theme="dark"] .stats-page-header {
    background: var(--grey-100);
    border-bottom-color: var(--grey-200);
}

[data-theme="dark"] .stats-preset-btn {
    background: var(--grey-200);
    border-color: var(--grey-300);
    color: var(--grey-700);
}

[data-theme="dark"] .stats-preset-btn:hover {
    background: var(--grey-300);
    color: var(--grey-900);
    border-color: var(--brand-primary);
}

[data-theme="dark"] .stats-preset-btn.active {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    border-color: var(--brand-primary);
}

[data-theme="dark"] .stats-kpi-card {
    background: var(--grey-200);
}

[data-theme="dark"] .stats-chart-card {
    background: var(--grey-200);
    border-color: var(--grey-300);
}

[data-theme="dark"] .stats-chart-header {
    border-bottom-color: var(--grey-300);
}

[data-theme="dark"] .stats-chart-title {
    color: var(--grey-800);
}

[data-theme="dark"] .kpi-label {
    color: var(--grey-600);
}

[data-theme="dark"] .kpi-delta {
    color: var(--grey-600);
}

[data-theme="dark"] .stats-driver-table thead th {
    border-bottom-color: var(--grey-300);
    color: var(--grey-600);
}

[data-theme="dark"] .stats-driver-table tbody td {
    border-top-color: var(--grey-300);
    color: var(--grey-800);
}

[data-theme="dark"] .stats-driver-table tbody tr:hover td {
    background: var(--grey-300);
}

[data-theme="dark"] .stats-fin-table tbody tr.stats-totals-row td {
    background: var(--grey-300);
    border-top-color: var(--grey-400);
}

[data-theme="dark"] .stats-heatmap-table thead th {
    color: var(--grey-600);
}

[data-theme="dark"] .stats-heatmap-table .heatmap-client-name {
    color: var(--grey-700);
}

[data-theme="dark"] .stats-csv-btn {
    background: var(--grey-300);
    border-color: var(--grey-400);
    color: var(--grey-700);
}

[data-theme="dark"] .stats-tabs {
    border-bottom-color: var(--grey-300);
}

[data-theme="dark"] .stats-tabs > li > a {
    color: var(--grey-600);
}

[data-theme="dark"] .stats-tabs > li.active > a {
    color: #5BAEE8;
    border-bottom-color: #5BAEE8 !important;
}

/* --- Misc utility --- */
[data-theme="dark"] .text-muted {
    color: var(--grey-600) !important;
}

[data-theme="dark"] .panel,
[data-theme="dark"] .well {
    background: var(--grey-200);
    border-color: var(--grey-300);
}

/* --- Navbar theme toggle button --- */
.navbar-theme-btn {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 15px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 13px 4px;
    transition: all var(--transition-fast);
    padding: 0;
}

.navbar-theme-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

/* Map/swap button dark mode */
[data-theme="dark"] .btn-map-toggle {
    background: var(--grey-200) !important;
    border-color: var(--grey-300) !important;
    color: var(--grey-700);
}

[data-theme="dark"] .btn-map-toggle:hover,
[data-theme="dark"] .btn-map-toggle:focus {
    background: var(--brand-primary-light) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary-text);
}

[data-theme="dark"] .btn-swap {
    background: var(--grey-200) !important;
    border-color: var(--grey-300) !important;
    color: var(--grey-600);
}

[data-theme="dark"] .btn-swap:hover {
    background: var(--brand-primary-light) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary-text) !important;
}

/* Preset buttons dark mode */
[data-theme="dark"] .stats-preset-btn:hover {
    background: var(--grey-300);
    color: var(--grey-800);
}

[data-theme="dark"] .stats-preset-btn.active {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    box-shadow: var(--shadow-xs);
}

/* Login card dark mode */
[data-theme="dark"] .login-card {
    background: var(--grey-100);
    border-color: var(--grey-200);
}

/* Transition for smooth theme switch */
body,
.tab-content,
.nav-tabs,
.form-control,
.table,
.modal-content,
.modal-body,
.modal-footer,
.stats-kpi-card,
.stats-chart-card,
.stats-page-header,
.btn-map-toggle,
.btn-swap,
.stats-preset-btn {
    transition:
        background-color var(--transition-base),
        border-color var(--transition-base),
        color var(--transition-base);
}

/* ============================================
   SHIFT SCHEDULE — Raspored smena
   ============================================ */

.shifts-page {
    padding: 0 16px 40px;
}

/* Header */
.shifts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 12px;
}
.shifts-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.shifts-header-left h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--grey-900);
}
.shifts-header-left .fa {
    font-size: 20px;
    color: var(--brand-primary-text);
}
.shifts-header-actions {
    display: flex;
    gap: 8px;
}

/* Tabs */
.shifts-tabs {
    margin-bottom: 0;
}
.shifts-tab-content {
    border: 1px solid var(--grey-200);
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: var(--grey-50);
    padding: 16px;
}

/* Nav bar (navigacija nedeljom/mesecom/danom) */
.shifts-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.shifts-week-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.shifts-week-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--grey-900);
    min-width: 200px;
    text-align: center;
}
.shifts-today-btn {
    margin-left: 4px;
}

/* Stats bar */
.shifts-stats-bar {
    display: flex;
    gap: 24px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: 6px;
    margin-bottom: 14px;
}
.shifts-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.shifts-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-primary-text);
    line-height: 1.2;
}
.shifts-stat-label {
    font-size: 11px;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Nedeljni grid ─────────────────────────────── */
.shifts-grid-wrapper {
    overflow-x: auto;
}
.shifts-grid-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--grey-200);
    table-layout: fixed;
}
.shifts-grid-table thead th {
    background: var(--grey-100);
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-700);
    border-bottom: 2px solid var(--grey-200);
    text-align: center;
}
.shifts-grid-vehicle-col {
    width: 90px;
    min-width: 90px;
    text-align: left !important;
    padding-left: 10px !important;
}
.shifts-grid-day-col {
    width: calc((100% - 90px) / 7);
}
.shifts-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.shifts-day-name {
    font-weight: 700;
}
.shifts-day-date {
    font-weight: 400;
    font-size: 11px;
    color: var(--grey-500);
}
.shifts-grid-table tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--grey-100);
}
.shifts-grid-table tbody td {
    padding: 4px;
    vertical-align: top;
    border-right: 1px solid var(--grey-100);
}
.shifts-vehicle-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-700);
    padding: 4px 6px;
    display: block;
}
.shifts-grid-cell {
    position: relative;
    min-height: 50px;
}
.shifts-weekend {
    background: var(--grey-50) !important;
}

/* Kartica smene */
.shifts-card {
    background: var(--brand-primary-light);
    border: 1px solid var(--brand-primary);
    border-left: 3px solid var(--brand-primary);
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 3px;
    cursor: pointer;
    transition: background 0.15s;
}
.shifts-card:hover {
    background: #d0e8f5;
}
.shifts-card-driver {
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shifts-card-time {
    font-size: 11px;
    color: var(--grey-600);
}
.shifts-card-hours {
    font-size: 11px;
    color: var(--grey-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Dugme dodaj (+) */
.shifts-add-btn {
    display: none;
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: none;
    border: 1px dashed var(--grey-300);
    border-radius: 3px;
    color: var(--grey-400);
    width: 22px;
    height: 22px;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    line-height: 20px;
    text-align: center;
}
.shifts-grid-cell:hover .shifts-add-btn {
    display: block;
}
.shifts-add-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary-text);
}

/* Diff badge */
.shifts-diff-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}
.diff-ok   { background: var(--color-success-bg); color: var(--color-success); }
.diff-warn { background: var(--color-warning-bg); color: var(--color-warning); }
.diff-bad  { background: var(--color-danger-bg);  color: var(--color-danger);  }

/* ── Mesečni prikaz ────────────────────────────── */
.shifts-month-wrapper {
    overflow-x: auto;
}
.shifts-month-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: 6px;
    font-size: 11px;
}
.shifts-month-table thead th {
    background: var(--grey-100);
    padding: 5px 3px;
    text-align: center;
    font-weight: 600;
    color: var(--grey-700);
    border-bottom: 2px solid var(--grey-200);
    min-width: 28px;
}
.shifts-month-driver-col {
    min-width: 120px;
    text-align: left !important;
    padding-left: 8px !important;
    font-weight: 600;
    color: var(--grey-800);
}
.shifts-month-total-col {
    min-width: 70px;
    text-align: center;
    font-weight: 600;
}
.shifts-month-table tbody td {
    padding: 2px 2px;
    border-right: 1px solid var(--grey-100);
    vertical-align: top;
}
.shifts-month-cell {
    text-align: center;
}
.shifts-month-card {
    background: var(--brand-primary-light);
    border-radius: 2px;
    padding: 1px 2px;
    font-size: 10px;
    color: var(--brand-primary-text);
    cursor: pointer;
    white-space: nowrap;
}
.shifts-month-card:hover {
    background: #d0e8f5;
}
.shifts-month-planned { color: var(--brand-primary-text); }
.shifts-month-actual  { color: var(--color-success); font-size: 10px; }
.shifts-month-pct     { color: var(--grey-500); font-size: 10px; margin-left: 2px; }
.shifts-month-card-actual {
    display: block;
    font-size: 10px;
    color: var(--color-success);
    margin-top: 1px;
}
.shifts-excel-actual-hours {
    display: block;
    font-size: 10px;
    color: var(--color-success);
    font-weight: normal;
}
.shifts-excel-actual-total {
    font-size: 10px;
    color: var(--color-success);
    margin-left: 2px;
}
.shifts-month-total-name {
    font-size: 10px;
    color: var(--grey-500);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* ── Dnevni prikaz ─────────────────────────────── */
.shifts-day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.shifts-day-vehicle-row {
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: 6px;
    overflow: hidden;
}
.shifts-day-vehicle-label {
    background: var(--grey-100);
    padding: 6px 12px;
    font-weight: 700;
    font-size: 13px;
    color: var(--grey-800);
    border-bottom: 1px solid var(--grey-200);
}
.shifts-day-assignments {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.shifts-day-card {
    padding: 8px 12px;
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-left: 3px solid var(--brand-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.shifts-day-card:hover {
    background: var(--brand-primary-light);
}
.shifts-day-card-driver {
    font-weight: 600;
    font-size: 14px;
    color: var(--grey-900);
    margin-bottom: 3px;
}
.shifts-day-card-time {
    font-size: 13px;
    color: var(--grey-700);
    margin-bottom: 2px;
}
.shifts-day-planned {
    font-size: 11px;
    color: var(--grey-500);
    margin-left: 4px;
}
.shifts-day-card-actual {
    font-size: 12px;
    color: var(--color-success);
    margin-top: 3px;
}
.shifts-day-card-active {
    font-size: 12px;
    color: var(--brand-secondary-text);
    margin-top: 3px;
}
.shifts-day-card-notes {
    font-size: 11px;
    color: var(--grey-500);
    margin-top: 4px;
    font-style: italic;
}

/* Actual info u modalu */
.shifts-actual-info {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--color-success);
    margin-top: 8px;
}
.shifts-actual-info-title {
    font-weight: 600;
    margin-bottom: 3px;
}

/* Auto-generate confidence bar */
.shifts-confidence-bar {
    position: relative;
    background: var(--grey-200);
    border-radius: 3px;
    height: 16px;
    width: 80px;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.shifts-confidence-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: var(--brand-primary);
    border-radius: 3px;
    opacity: 0.3;
}
.shifts-confidence-bar span {
    position: relative;
    font-size: 11px;
    font-weight: 600;
    color: var(--grey-800);
    padding-left: 4px;
}

/* Loading / empty */
.shifts-loading {
    text-align: center;
    padding: 40px;
    color: var(--grey-500);
    font-size: 15px;
}
.shifts-empty {
    text-align: center;
    padding: 30px;
    color: var(--grey-400);
    font-size: 14px;
}

/* ── Excel-like nedeljni prikaz ──────────────────────────────────────────── */
.shifts-excel-wrapper {
    overflow-x: auto;
}
.shifts-excel-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
    background: #fff;
}
.shifts-excel-day-header {
    background: #2e8cb5;
    color: #fff;
    text-align: center;
    padding: 7px 4px 6px;
    border: 1px solid #1e6e94;
    font-weight: 700;
    min-width: 130px;
}
.shifts-excel-weekend .shifts-excel-day-header,
th.shifts-excel-weekend {
    background: #3a9abd !important;
}
.shifts-excel-day-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.shifts-excel-day-date {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}
.shifts-excel-day-col {
    vertical-align: top;
    border: 1px solid #bbb;
    padding: 3px;
    position: relative;
    background: #fff;
}
.shifts-excel-day-col.shifts-excel-weekend {
    background: #f7f9fb !important;
}
.shifts-excel-entry {
    margin-bottom: 4px;
}
.shifts-excel-entry-time {
    font-size: 10px;
    font-weight: 700;
    color: #555;
    text-align: center;
    background: #e8edf2;
    padding: 1px 2px;
    margin-bottom: 1px;
    border-radius: 2px 2px 0 0;
    letter-spacing: 0.2px;
}
.shifts-excel-entry-row {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 4px;
    border: 1px solid #c5d0d8;
    background: #f4f8fb;
    cursor: pointer;
    border-radius: 0 0 2px 2px;
    transition: background 0.1s;
}
.shifts-excel-entry-row:hover {
    background: #ddeef8;
    border-color: var(--brand-primary);
}
.shifts-excel-entry-row.shifts-excel-has-session {
    background: #d4edda;
    border-color: #82c986;
}
.shifts-excel-entry-row.shifts-excel-has-session:hover {
    background: #b8dfc0;
}
.shifts-excel-vehicle-badge {
    font-size: 10px;
    font-weight: 700;
    color: #444;
    min-width: 28px;
    flex-shrink: 0;
    white-space: nowrap;
}
.shifts-excel-driver-name {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}
.shifts-excel-hours-val {
    font-size: 11px;
    font-weight: 700;
    color: #444;
    min-width: 18px;
    text-align: right;
    flex-shrink: 0;
}
.shifts-excel-day-total {
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin-top: 5px;
    padding: 3px 4px 2px;
    border-top: 2px solid #bbb;
    background: #f0f0f0;
    border-radius: 0 0 3px 3px;
}
.shifts-excel-add-btn {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 3px 0;
    background: none;
    border: 1px dashed #ccc;
    border-radius: 2px;
    color: #aaa;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    line-height: 1.4;
}
.shifts-excel-add-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary-text);
    background: var(--brand-primary-light);
}

/* Napomena za dan */
.shifts-excel-note-wrap {
    margin-top: 5px;
    border-top: 1px dashed #ccc;
    padding-top: 4px;
}
.shifts-excel-note-view {
    min-height: 24px;
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.4;
    transition: background 0.1s;
}
.shifts-excel-note-view:hover {
    background: #fff3cd;
}
.shifts-excel-note-text {
    color: #7c5c00;
    font-weight: 600;
    white-space: pre-wrap;
    word-break: break-word;
}
.shifts-excel-note-placeholder {
    color: #bbb;
    font-style: italic;
}
.shifts-excel-note-textarea {
    width: 100%;
    font-size: 11px;
    border: 1px solid var(--brand-primary);
    border-radius: 3px;
    padding: 3px 5px;
    resize: vertical;
    outline: none;
    line-height: 1.4;
    background: #fffef5;
    color: #333;
    box-shadow: 0 0 0 2px rgba(46,140,181,0.15);
}

/* Dark mode */
[data-theme="dark"] .shifts-excel-table,
[data-theme="dark"] .shifts-excel-day-col {
    background: var(--grey-800);
    border-color: var(--grey-600);
}
[data-theme="dark"] .shifts-excel-day-col.shifts-excel-weekend {
    background: var(--grey-850, #1c1c1c) !important;
}
[data-theme="dark"] .shifts-excel-entry-time {
    background: var(--grey-700);
    color: var(--grey-300);
}
[data-theme="dark"] .shifts-excel-entry-row {
    background: var(--grey-750, #2a2a2a);
    border-color: var(--grey-600);
}
[data-theme="dark"] .shifts-excel-entry-row:hover {
    background: rgba(247, 154, 43,0.2);
}
[data-theme="dark"] .shifts-excel-entry-row.shifts-excel-has-session {
    background: rgba(40,120,50,0.25);
    border-color: #388e3c;
}
[data-theme="dark"] .shifts-excel-vehicle-badge,
[data-theme="dark"] .shifts-excel-driver-name,
[data-theme="dark"] .shifts-excel-hours-val {
    color: var(--grey-200);
}
[data-theme="dark"] .shifts-excel-day-total {
    color: var(--grey-200);
    background: var(--grey-700);
    border-top-color: var(--grey-600);
}
[data-theme="dark"] .shifts-excel-note-wrap {
    border-top-color: var(--grey-600);
}
[data-theme="dark"] .shifts-excel-note-view:hover {
    background: rgba(180, 140, 0, 0.15);
}
[data-theme="dark"] .shifts-excel-note-text {
    color: #f0c060;
}
[data-theme="dark"] .shifts-excel-note-textarea {
    background: var(--grey-800);
    color: var(--grey-200);
    border-color: var(--brand-primary);
}

/* Dark mode */
[data-theme="dark"] .shifts-grid-table,
[data-theme="dark"] .shifts-month-table,
[data-theme="dark"] .shifts-day-vehicle-row {
    background: var(--grey-800);
    border-color: var(--grey-700);
}
[data-theme="dark"] .shifts-grid-table thead th,
[data-theme="dark"] .shifts-month-table thead th,
[data-theme="dark"] .shifts-day-vehicle-label {
    background: var(--grey-700);
    color: var(--grey-200);
    border-color: var(--grey-600);
}
[data-theme="dark"] .shifts-card {
    background: rgba(247, 154, 43, 0.15);
    border-color: var(--brand-primary);
}
[data-theme="dark"] .shifts-stats-bar,
[data-theme="dark"] .shifts-tab-content {
    background: var(--grey-900);
    border-color: var(--grey-700);
}
[data-theme="dark"] .shifts-weekend {
    background: var(--grey-800) !important;
}

/* Time select u shift modalu */
.shifts-time-select {
    display: flex;
    align-items: center;
    gap: 4px;
}
.shifts-time-select .form-control {
    flex: 1;
    padding-left: 6px;
    padding-right: 4px;
}
.shifts-time-sep {
    font-size: 18px;
    font-weight: 700;
    color: var(--grey-600);
    line-height: 1;
}

/* ── Vehicle Documents ───────────────────────────────────────────────────── */
.vdoc-required-row {
    margin-bottom: 10px;
}
.vdoc-required-card {
    border-radius: 6px;
    border: 2px solid var(--grey-200);
    overflow: hidden;
    margin-bottom: 16px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.vdoc-card-ok {
    border-color: #81c784;
}
.vdoc-card-missing {
    border-color: #ef9a9a;
}
.vdoc-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
}
.vdoc-card-ok .vdoc-card-header {
    background: #e8f5e9;
    color: #2e7d32;
}
.vdoc-card-missing .vdoc-card-header {
    background: #ffebee;
    color: #c62828;
}
.vdoc-card-icon {
    font-size: 16px;
}
.vdoc-card-body {
    padding: 12px 14px;
}
.vdoc-card-empty {
    text-align: center;
    padding: 18px 14px;
}
.vdoc-card-filename {
    font-size: 12px;
    color: var(--grey-700);
    margin-bottom: 4px;
    word-break: break-all;
}
.vdoc-card-meta {
    font-size: 11px;
    color: var(--grey-500);
    margin-bottom: 4px;
}
.vdoc-card-expiry {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.vdoc-card-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

[data-theme="dark"] .vdoc-required-card {
    background: var(--grey-800);
    border-color: var(--grey-600);
}
[data-theme="dark"] .vdoc-card-ok {
    border-color: #388e3c;
}
[data-theme="dark"] .vdoc-card-missing {
    border-color: #c62828;
}
[data-theme="dark"] .vdoc-card-ok .vdoc-card-header {
    background: rgba(40,120,50,0.2);
    color: #81c784;
}
[data-theme="dark"] .vdoc-card-missing .vdoc-card-header {
    background: rgba(180,30,30,0.2);
    color: #ef9a9a;
}
[data-theme="dark"] .vdoc-card-filename,
[data-theme="dark"] .vdoc-card-meta {
    color: var(--grey-300);
}

/* Drag & drop zona */
.vdoc-dropzone {
    border: 2px dashed var(--grey-300);
    border-radius: 6px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    background: var(--grey-50, #fafafa);
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.vdoc-dropzone:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
}
.vdoc-dropzone-over {
    border-color: var(--brand-primary) !important;
    background: var(--brand-primary-light, #d0eaf8) !important;
}
.vdoc-dropzone-selected {
    border-color: #81c784;
    background: #f1f8f1;
    cursor: default;
}
.vdoc-dropzone-hint {
    color: var(--grey-500);
}
.vdoc-dropzone-hint i {
    display: block;
    margin-bottom: 8px;
    color: var(--grey-400);
}
.vdoc-dropzone-hint p {
    margin: 0 0 4px;
    font-size: 13px;
}
.vdoc-dropzone-hint small {
    font-size: 11px;
    color: var(--grey-400);
}
.vdoc-dropzone-link {
    color: var(--brand-primary-text);
    text-decoration: underline;
}
.vdoc-dropzone-file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #2e7d32;
    flex-wrap: wrap;
}
.vdoc-dropzone-file i {
    font-size: 18px;
}
.vdoc-dropzone-fname {
    font-weight: 600;
    word-break: break-all;
}
.vdoc-dropzone-fsize {
    color: var(--grey-500);
    font-size: 11px;
}
.vdoc-dropzone-clear {
    background: none;
    border: none;
    color: var(--grey-400);
    cursor: pointer;
    padding: 0 2px;
    font-size: 13px;
    line-height: 1;
}
.vdoc-dropzone-clear:hover {
    color: var(--color-danger, #d32f2f);
}

[data-theme="dark"] .vdoc-dropzone {
    background: var(--grey-800);
    border-color: var(--grey-600);
}
[data-theme="dark"] .vdoc-dropzone:hover,
[data-theme="dark"] .vdoc-dropzone-over {
    background: rgba(46,140,181,0.12) !important;
    border-color: var(--brand-primary) !important;
}
[data-theme="dark"] .vdoc-dropzone-selected {
    background: rgba(40,120,50,0.15);
    border-color: #388e3c;
}
[data-theme="dark"] .vdoc-dropzone-hint {
    color: var(--grey-400);
}
[data-theme="dark"] .vdoc-dropzone-file {
    color: #81c784;
}

/* ─────────────────────────────────────────────────────────────────
   SEF FAKTURE
   ───────────────────────────────────────────────────────────────── */
.sef-page {
    padding: 20px 24px;
    max-width: 1300px;
}
.sef-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.sef-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sef-title i { font-size: 22px; color: var(--blue-500, #F79A2B); }
.sef-title h2 { margin: 0; font-size: 22px; font-weight: 600; }
.sef-tabs { margin-bottom: 0; }
.sef-tab-content {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #ddd);
    border-top: none;
    padding: 20px;
    border-radius: 0 0 6px 6px;
}
.sef-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.sef-filter-select { width: auto !important; min-width: 150px; }
.sef-filter-date   { width: 130px !important; }
.sef-table-wrap    { overflow-x: auto; }
.sef-table         { margin-bottom: 0; }
.sef-table tbody tr:hover { background: var(--hover-bg, #f5f5f5); }
.sef-generate-card {
    max-width: 720px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    padding: 24px;
}
.sef-generate-card h4 { margin-top: 0; }
.sef-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted, #888);
    border-bottom: 1px solid var(--border, #ddd);
    padding-bottom: 4px;
    margin: 16px 0 10px;
}
.sef-lines-table { font-size: 13px; }
.sef-total-row td { border-top: none !important; padding-top: 2px !important; padding-bottom: 2px !important; }
.sef-grand-total td { font-size: 15px; }
.sef-inv-info { margin-bottom: 16px; font-size: 13px; }
.sef-inv-info strong { font-size: 11px; text-transform: uppercase; color: var(--text-muted, #888); }
.sef-paid-alert { font-size: 13px; margin-top: 14px; }
.sef-pay-form  { margin-top: 14px; }
.sef-pay-form h5 { margin-top: 0; }
.sef-sef-info  { margin-top: 10px; }
.sef-xml-pre {
    font-size: 11px;
    max-height: 500px;
    overflow: auto;
    background: var(--code-bg, #f8f8f8);
    border: 1px solid var(--border, #ddd);
    border-radius: 4px;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* --- Time input — 24h format ------------------------------------------ */
input[type="time"] {
    /* Force 24h clock on all platforms */
    -webkit-appearance: none;
    appearance: none;
}

/* Hide AM/PM spinner on Safari/iOS */
input[type="time"]::-webkit-datetime-edit-ampm-field {
    display: none;
}

input[type="time"].input-sm {
    height: 30px;
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1.5;
}

/* Dark mode */
[data-theme="dark"] .sef-tab-content,
[data-theme="dark"] .sef-generate-card {
    background: var(--surface-dark, #1e1e1e);
    border-color: var(--border-dark, #444);
}
[data-theme="dark"] .sef-table tbody tr:hover { background: rgba(255,255,255,.05); }
[data-theme="dark"] .sef-xml-pre {
    background: #141414;
    border-color: #444;
    color: #e0e0e0;
}

/* ── Finansije (Plate / Fiksni troškovi) ─────────────────────────────────── */

.fin-page { padding: var(--space-lg, 20px); max-width: 900px; margin: 0 auto; }
.fin-page-wide { max-width: 1100px; }
.fin-tab-content { border: 1px solid #ddd; border-top: none; border-radius: 0 0 4px 4px; padding: 0; }

.fin-page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.fin-page-title { display: flex; align-items: center; gap: 10px; }
.fin-page-title h2 { margin: 0; font-size: 22px; font-weight: 600; }
.fin-page-title .fa { font-size: 20px; color: var(--color-primary, #F79A2B); }

.fin-nav-bar { display: flex; align-items: center; gap: 8px; }
.fin-month-label { font-weight: 600; font-size: 15px; min-width: 160px; text-align: center; }

.fin-stats-bar {
    display: flex; gap: 24px; flex-wrap: wrap;
    background: var(--surface, #fff); border: 1px solid #e0e0e0;
    border-radius: 6px; padding: 14px 20px; margin-bottom: 20px;
}
.fin-stat { display: flex; flex-direction: column; }
.fin-stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.fin-stat-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.fin-stat-pay .fin-stat-value { color: #2e7d32; }

.fin-table-wrapper { background: var(--surface, #fff); border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; }
.fin-table { margin-bottom: 0; }
.fin-table thead th { background: #f5f5f5; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.fin-table tfoot td { background: #f9f9f9; border-top: 2px solid #ddd !important; }
.fin-pay-value { color: #2e7d32; }

.fin-total-row td { font-weight: 600; }

.fin-loading, .fin-empty { text-align: center; padding: 40px; color: #888; }

/* Detail modal */
.fin-detail-summary {
    display: flex; gap: 20px; flex-wrap: wrap;
    background: #f8f9fa; border-radius: 6px; padding: 14px 20px; margin-bottom: 20px;
}
.fin-detail-kpi { display: flex; flex-direction: column; min-width: 90px; }
.fin-detail-kpi-val { font-size: 20px; font-weight: 700; line-height: 1.1; }
.fin-detail-kpi-lbl { font-size: 11px; color: #888; text-transform: uppercase; margin-top: 2px; }
.fin-detail-kpi-bonus .fin-detail-kpi-val { color: #2e7d32; }
.fin-detail-kpi-ded .fin-detail-kpi-val   { color: #c62828; }
.fin-detail-kpi-net .fin-detail-kpi-val   { color: #1565c0; font-size: 22px; }

.fin-detail-section-title { font-size: 13px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: #555; border-bottom: 1px solid #eee;
    padding-bottom: 6px; margin: 20px 0 8px; }
.fin-detail-table { font-size: 13px; }
.fin-detail-calc-ts { font-size: 11px; margin-top: 16px; }
.fin-op-hours-bar { display:flex; align-items:center; gap:8px; padding:10px 16px; background:#f8f9fa; border-bottom:1px solid #e0e0e0; flex-wrap:wrap; }
.fin-op-hours-label { font-size:13px; font-weight:600; color:#555; white-space:nowrap; }
.fin-op-hours-input { width:90px !important; display:inline-block !important; }
.fin-adj-form { background:#f8f9fa; border:1px solid #e5e5e5; border-radius:4px; padding:10px 12px; margin-top:4px; }

/* Fixed costs */
.fin-category-header {
    display: flex; justify-content: space-between; align-items: center;
    background: #f0f4f8; padding: 8px 14px; font-weight: 600;
    font-size: 13px; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;
    margin-top: 1px;
}
.fin-category-total { font-weight: 700; color: #2e7d32; }
.fin-table-inset { margin-bottom: 0; }
.fin-cost-amount { font-weight: 600; width: 130px; }
.fin-cost-actions { width: 90px; white-space: nowrap; }
.fin-cost-notes { font-size: 12px; }
.fin-cost-meta { font-size: 12px; white-space: nowrap; line-height: 1.8; }
.fin-months-badge {
    display: inline-block; background: #e3f2fd; color: #1565c0;
    border-radius: 3px; padding: 1px 5px; font-size: 11px; margin-left: 4px;
}
.fin-row-inactive td { opacity: 0.5; }

/* ── Star Kartica filter bar ─────────────────────────────────────────────── */
.fin-filter-bar {
    display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
    background: var(--surface, #fff); border: 1px solid #e0e0e0; border-radius: 6px;
    padding: 14px 16px; margin-bottom: 16px;
}
.fin-filter-group { display: flex; flex-direction: column; gap: 4px; }
.fin-filter-label { font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.4px; color: #888; margin: 0; }
.fin-filter-sep { width: 1px; background: #e0e0e0; align-self: stretch; margin: 0 4px; }

/* ── Raspored operatera ──────────────────────────────────────────────────── */

.shifts-op-subtabs { margin-top: 12px; margin-bottom: 0; border-bottom: 1px solid #ddd; }
.shifts-op-tab-content { padding-top: 0; }

/* Grid table */
.shifts-op-grid-wrapper { overflow-x: auto; margin-top: 8px; }
.shifts-op-grid-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.shifts-op-grid-table th,
.shifts-op-grid-table td { border: 1px solid #ddd; padding: 0; vertical-align: top; }

.shifts-op-slot-header { width: 120px; min-width: 100px; background: #f5f5f5; font-weight: 600; }
.shifts-op-day-header { text-align: center; background: #f5f5f5; padding: 6px 4px !important; min-width: 110px; }

.shifts-op-slot-label { padding: 8px 10px; background: #fafafa; white-space: nowrap; }
.shifts-op-time-badge {
    display: inline-block; background: #F79A2B; color: #252627;
    border-radius: 3px; padding: 2px 6px; font-size: 12px; font-weight: 600;
}
.shifts-op-hours-badge {
    display: inline-block; background: #777; color: #fff;
    border-radius: 3px; padding: 2px 5px; font-size: 11px; margin-left: 4px;
}

/* Cells */
.shifts-op-cell { padding: 4px; min-height: 44px; }
.shifts-op-cell-assigned   { background: #f0fff0; }
.shifts-op-cell-unassigned { background: #fffaf0; }
.shifts-op-cell-empty      { background: #fafafa; }

.shifts-op-entry { padding: 4px 6px; border-radius: 3px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.shifts-op-entry:hover { opacity: 0.85; }
.shifts-op-entry-filled     { background: #d4edda; border: 1px solid #c3e6cb; }
.shifts-op-entry-unassigned { background: #fff3cd; border: 1px solid #ffeeba; }
.shifts-op-entry-none       { color: #bbb; font-size: 13px; padding: 8px 6px; cursor: default; }

.shifts-op-operator-name   { font-size: 12px; font-weight: 600; flex: 1; }
.shifts-op-unassigned-label { font-size: 12px; color: #856404; flex: 1; }
.shifts-op-edit-icon       { font-size: 11px; color: #666; }

/* Monthly card override */
.shifts-op-month-card { background: #d4edda; border-color: #c3e6cb; }

/* Pay column */
.shifts-op-pay-col { width: 100px; min-width: 90px; text-align: right; white-space: nowrap; padding: 4px 8px !important; }
.shifts-op-pay-value { font-weight: 600; color: #2e7d32; font-size: 13px; }

/* Modal slot info strip */
.shifts-op-modal-slot-info {
    background: #f5f5f5; border-radius: 4px; padding: 10px 12px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.shifts-op-date-badge {
    display: inline-block; background: #555; color: #fff;
    border-radius: 3px; padding: 2px 7px; font-size: 12px;
}

/* ── Clients ──────────────────────────────────────────────────────────────── */
.cl-avatar { width:38px; height:38px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; color:#fff; flex-shrink:0; }
.cl-avatar-lg { width:60px; height:60px; font-size:22px; }
.cl-avatar-faktura { background: var(--brand-primary); }
.cl-avatar-spec { background: #8B5CF6; }
.cl-avatar-kes { background: var(--color-success); }
.cl-avatar-default { background: var(--grey-400); }

.cl-type-badge { display:inline-block; padding:2px 9px; border-radius:12px; font-size:11px; font-weight:600; line-height:1.6; }
.cl-type-faktura { background: var(--brand-primary-light); color: var(--brand-primary-text); }
.cl-type-spec { background: #F3EEFE; color: #6D28D9; }
.cl-type-kes { background: var(--color-success-bg); color: var(--color-success); }

/* Index */
.clients-page-header { display:flex; align-items:center; justify-content:space-between; padding:16px 0 14px; border-bottom:1px solid var(--grey-200); margin-bottom:18px; }
.clients-page-title { font-size:20px; font-weight:700; color:var(--grey-900); margin:0; display:flex; align-items:center; gap:10px; }
.clients-stats-bar { display:flex; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.clients-stat-card { background:var(--grey-50); border:1px solid var(--grey-200); border-radius:8px; padding:10px 18px; flex:1; min-width:110px; }
.clients-stat-label { font-size:11px; color:var(--grey-500); font-weight:600; text-transform:uppercase; letter-spacing:.5px; }
.clients-stat-value { font-size:24px; font-weight:700; color:var(--grey-900); margin-top:2px; }
.clients-filter-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.clients-search-wrap { position:relative; }
.clients-search-wrap .fa { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--grey-400); pointer-events:none; }
.clients-search-wrap input { padding-left:32px; min-width:220px; }
.clients-type-pills { display:flex; gap:4px; }
.clients-type-pill { padding:4px 14px; border-radius:20px; border:1px solid var(--grey-200); background:#fff; font-size:12px; font-weight:500; cursor:pointer; color:var(--grey-600); transition:all .15s; white-space:nowrap; }
.clients-type-pill:hover { border-color:var(--brand-primary); color:var(--brand-primary-text); background:#fff; }
.clients-type-pill.cl-pill-active-all { background:var(--grey-800); border-color:var(--grey-800); color:#fff; }
.clients-type-pill.cl-pill-active-fak { background:var(--brand-primary); border-color:var(--brand-primary); color: var(--brand-on-primary); }
.clients-type-pill.cl-pill-active-spec { background:#8B5CF6; border-color:#8B5CF6; color:#fff; }
.clients-type-pill.cl-pill-active-kes { background:var(--color-success); border-color:var(--color-success); color:#fff; }
.clients-table { margin-bottom:0; }
.clients-table > thead > tr > th { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:var(--grey-500); border-bottom:2px solid var(--grey-200) !important; padding:8px 12px !important; vertical-align:middle !important; background:var(--grey-50); }
.clients-table > tbody > tr > td { vertical-align:middle !important; padding:10px 12px !important; border-color:var(--grey-100) !important; }
.clients-table > tbody > tr:hover > td { background:var(--grey-50); }
.clients-table > tbody > tr.cl-inactive-row > td { opacity:.5; }
.cl-name-cell { display:flex; align-items:center; gap:10px; }
.cl-name-primary { font-weight:600; font-size:13px; color:var(--grey-900); line-height:1.3; }
.cl-contact-name { font-size:13px; color:var(--grey-800); }
.cl-contact-phone { font-size:12px; color:var(--grey-500); margin-top:1px; }
.cl-price-main { font-size:13px; font-weight:600; color:var(--grey-900); }
.cl-price-sub { font-size:12px; color:var(--grey-500); margin-top:1px; }
.cl-actions { display:flex; align-items:center; gap:4px; justify-content:flex-end; }

/* Flag chips */
.cl-flag { display:inline-block; padding:1px 7px; border-radius:4px; font-size:10px; font-weight:700; letter-spacing:.3px; background:var(--grey-100); color:var(--grey-500); }
.cl-flag-on { background:var(--color-success-bg); color:var(--color-success); }
.cl-flag-post { background:var(--color-info-bg); color:var(--color-info); }
.cl-flag-star { background:var(--color-warning-bg); color:var(--color-warning); }

/* Details header */
.client-detail-header { background:#fff; border:1px solid var(--grey-200); border-radius:10px; padding:20px 24px; margin-bottom:20px; display:flex; align-items:flex-start; gap:18px; }
.client-detail-header-info { flex:1; }
.client-detail-name { font-size:22px; font-weight:700; color:var(--grey-950); margin:0 0 6px; }
.client-detail-meta { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:8px; }
.client-detail-meta-item { font-size:13px; color:var(--grey-600); display:flex; align-items:center; gap:5px; }
.client-detail-flags { display:flex; gap:6px; flex-wrap:wrap; }
.client-detail-actions { display:flex; gap:8px; align-items:center; }

/* Info cards */
.client-info-card { background:#fff; border:1px solid var(--grey-200); border-radius:8px; margin-bottom:12px; overflow:hidden; }
.client-info-card-header { padding:9px 14px; background:var(--grey-50); border-bottom:1px solid var(--grey-200); font-size:11px; font-weight:700; color:var(--grey-500); text-transform:uppercase; letter-spacing:.5px; display:flex; align-items:center; gap:6px; }
.client-info-card-body { padding:4px 14px 8px; }
.client-info-row { display:flex; align-items:flex-start; padding:7px 0; border-bottom:1px solid var(--grey-100); }
.client-info-row:last-child { border-bottom:none; }
.client-info-label { width:105px; flex-shrink:0; font-size:12px; color:var(--grey-500); padding-top:1px; }
.client-info-value { flex:1; font-size:13px; color:var(--grey-800); font-weight:500; word-break:break-all; }
.client-info-value a { color:var(--brand-primary-text); text-decoration:none; }
.client-info-value a:hover { text-decoration:underline; }

/* Notes */
.client-notes-area { width:100%; border:1px solid var(--grey-200); border-radius:6px; padding:8px 10px; font-size:13px; color:var(--grey-800); resize:vertical; min-height:85px; background:var(--grey-50); transition:border-color .15s; font-family:inherit; }
.client-notes-area:focus { outline:none; border-color:var(--brand-primary); background:#fff; box-shadow:0 0 0 3px var(--brand-primary-light); }
.client-notes-hint { font-size:11px; margin-top:4px; min-height:16px; color:var(--grey-400); transition:color .2s; }
.client-notes-hint.saving { color:var(--grey-500); }
.client-notes-hint.saved { color:var(--color-success); }

/* Locations table */
.client-loc-table > thead > tr > th { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--grey-500); border-bottom:2px solid var(--grey-200) !important; padding:8px 10px !important; background:var(--grey-50); }
.client-loc-table > tbody > tr > td { vertical-align:middle !important; font-size:13px; padding:8px 10px !important; border-color:var(--grey-100) !important; }
.client-loc-table > tbody > tr:hover > td { background:var(--grey-50); }

/* Order status pills */
.order-status-pill { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; white-space:nowrap; }
.osp-dodeljena { background:var(--status-assigned-bg); color:var(--status-assigned); }
.osp-prihvacena { background:var(--status-accepted-bg); color:var(--status-accepted); }
.osp-preuzeta { background:var(--status-picked-up-bg); color:var(--status-picked-up); }
.osp-u-obradi { background:var(--status-in-progress-bg); color:var(--status-in-progress); }
.osp-dostavljena { background:var(--status-delivered-bg); color:var(--status-delivered); }

/* Orders tab */
.client-orders-filter-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:14px 0 12px; border-bottom:1px solid var(--grey-200); margin-bottom:14px; }
.client-orders-stats-bar { display:flex; gap:20px; flex-wrap:wrap; background:var(--grey-50); border:1px solid var(--grey-200); border-radius:8px; padding:10px 18px; margin-bottom:14px; }
.client-orders-kpi { text-align:center; }
.client-orders-kpi-value { font-size:18px; font-weight:700; color:var(--grey-900); line-height:1.2; }
.client-orders-kpi-label { font-size:11px; color:var(--grey-500); margin-top:1px; }
.client-orders-table > thead > tr > th { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--grey-500); border-bottom:2px solid var(--grey-200) !important; padding:7px 10px !important; background:var(--grey-50); white-space:nowrap; }
.client-orders-table > tbody > tr > td { font-size:12px; padding:7px 10px !important; border-color:var(--grey-100) !important; vertical-align:middle !important; }
.client-orders-table > tbody > tr:hover > td { background:var(--grey-50); }


/* ============================================================
   PRICING / PRICE LISTS
   ============================================================ */

/* ── Index Page ─────────────────────────────────────────── */
.pricing-page { padding: var(--space-lg); max-width: 960px; }
.pricing-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom: var(--space-lg); }
.pricing-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--grey-900); margin: 0 0 4px; }
.pricing-subtitle { font-size: 13px; color: var(--grey-500); margin: 0; }

.pricing-universal-card {
    display: flex; align-items: center; gap: var(--space-md);
    background: var(--brand-primary-light); border: 1.5px solid var(--brand-primary);
    border-radius: var(--radius-md); padding: 16px 20px; margin-bottom: var(--space-lg);
}
.pricing-universal-badge {
    background: var(--brand-primary); color: var(--brand-on-primary); font-size: 11px; font-weight: 700;
    letter-spacing: .4px; text-transform: uppercase; border-radius: var(--radius-full);
    padding: 4px 10px; white-space: nowrap;
}
.pricing-universal-info { flex: 1; }
.pricing-universal-empty { padding: 12px 16px; border-radius: var(--radius-md); background: var(--color-warning-bg); border: 1px solid var(--color-warning); font-size: 13px; margin-bottom: var(--space-lg); }

.pricing-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--grey-500); margin-bottom: var(--space-md); }

.pricing-lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-lg); }
.pricing-list-card { background: white; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition-fast); }
.pricing-list-card:hover { box-shadow: var(--shadow-md); }
.pricing-list-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pricing-list-name { font-weight: 600; font-size: 14px; color: var(--grey-900); }
.pricing-list-meta { font-size: 12px; color: var(--grey-500); margin-top: 2px; }
.pricing-dot { margin: 0 6px; }
.pricing-list-actions { display: flex; gap: 4px; flex-shrink: 0; }
.pricing-zone-count { font-size: 12px; color: var(--grey-600); }
.pricing-list-base { font-size: 12px; color: var(--grey-500); margin-top: 8px; border-top: 1px solid var(--grey-100); padding-top: 8px; }
.pricing-list-zones { margin-bottom: 4px; }
.pricing-empty-state { text-align: center; padding: 48px 0; color: var(--grey-400); }
.pricing-empty-state i { font-size: 40px; display: block; margin-bottom: 12px; }
.pricing-empty-state p { margin: 0 0 12px; font-size: 14px; }


/* ── Zone Editor ─────────────────────────────────────────── */
.pze-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px; height: 54px; flex-shrink: 0;
    background: white; border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-xs);
    z-index: 10;
}
.pze-toolbar-left  { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.pze-toolbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.pze-back-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    color: var(--grey-600); text-decoration: none; flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.pze-back-btn:hover { background: var(--grey-100); color: var(--grey-900); }

.pze-title-block { display: flex; align-items: center; min-width: 0; }
.pze-list-name {
    font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--grey-900);
    cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pze-list-name:hover .pze-title-edit-icon { opacity: 1; }
.pze-title-edit-icon { font-size: 12px; color: var(--grey-400); opacity: 0; transition: opacity var(--transition-fast); }
.pze-title-input { height: 30px !important; font-size: 15px !important; font-weight: 600 !important; padding: 2px 8px !important; max-width: 280px; }

.pze-base-price-block { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--grey-600); }
.pze-base-label { white-space: nowrap; }
.pze-base-input { width: 80px !important; height: 28px !important; font-size: 13px !important; padding: 2px 8px !important; display: inline-block; }

.pze-draw-controls { display: flex; border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; }
.pze-draw-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 12px; background: white; border: none; font-size: 12px; color: var(--grey-700);
    cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast);
}
.pze-draw-btn:hover { background: var(--grey-50); }
.pze-draw-btn.pze-draw-active { background: var(--brand-primary-light); color: var(--brand-primary-text); }
.pze-draw-btn + .pze-draw-btn { border-left: 1px solid var(--border-color); }

.pze-save-btn { min-width: 110px; }

.pze-body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.pze-sidebar {
    width: 300px; flex-shrink: 0;
    background: white; border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; overflow: hidden;
}
.pze-sidebar-header {
    padding: 12px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    color: var(--grey-500); border-bottom: 1px solid var(--grey-100); flex-shrink: 0;
}
.pze-zones-list { flex: 1; overflow-y: auto; padding: 8px; }
.pze-no-zones { text-align: center; padding: 40px 16px; color: var(--grey-400); }
.pze-no-zones-icon { font-size: 36px; margin-bottom: 10px; display: block; }
.pze-no-zones p { margin: 0 0 6px; font-size: 13px; }

.pze-zone-card {
    background: var(--grey-50); border: 1.5px solid transparent; border-radius: var(--radius-md);
    padding: 10px 12px; margin-bottom: 6px; cursor: pointer; position: relative;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.pze-zone-card:hover { background: white; border-color: var(--grey-200); box-shadow: var(--shadow-xs); }
.pze-zone-card-active { background: white !important; border-color: var(--brand-primary) !important; box-shadow: 0 0 0 3px rgba(247, 154, 43,.12) !important; }

.pze-zone-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pze-zone-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(255,255,255,.5); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.pze-zone-name-wrap { flex: 1; min-width: 0; }
.pze-zone-name-input {
    width: 100%; background: transparent; border: none; outline: none;
    font-size: 13px; font-weight: 600; color: var(--grey-900); padding: 0;
}
.pze-zone-name-input:focus { background: white; border-bottom: 1px solid var(--brand-primary); }
.pze-zone-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.pze-color-btn, .pze-delete-btn {
    background: none; border: none; padding: 3px 5px; border-radius: 4px; cursor: pointer; font-size: 12px;
    color: var(--grey-400); transition: color var(--transition-fast), background var(--transition-fast);
}
.pze-color-btn:hover { color: var(--brand-primary-text); background: var(--brand-primary-light); }
.pze-delete-btn:hover { color: var(--color-danger); background: var(--color-danger-bg); }

.pze-zone-card-price { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pze-price-label { font-size: 11px; color: var(--grey-500); }
.pze-price-input-wrap { display: flex; align-items: center; gap: 4px; }
.pze-price-input { width: 80px !important; height: 26px !important; font-size: 13px !important; padding: 2px 6px !important; text-align: right; }
.pze-price-unit { font-size: 12px; color: var(--grey-500); }
.pze-zone-pts { font-size: 11px; color: var(--grey-400); }

.pze-color-picker {
    display: flex; flex-wrap: wrap; gap: 5px; padding: 8px;
    background: white; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md); position: absolute; right: 8px; top: 36px; z-index: 100; width: 136px;
}
.pze-color-swatch {
    width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.pze-color-swatch:hover { transform: scale(1.15); }
.pze-swatch-active { border-color: var(--grey-900) !important; }

.pze-sidebar-hint { padding: 10px 14px; font-size: 11px; color: var(--grey-500); border-top: 1px solid var(--grey-100); flex-shrink: 0; line-height: 1.5; }

/* Map */
.pze-map-wrap { flex: 1; position: relative; overflow: hidden; }
.pze-map { width: 100%; height: 100%; }
.pze-unsaved-badge {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    background: white; border: 1px solid var(--border-color); border-radius: var(--radius-full);
    padding: 4px 14px; font-size: 12px; color: var(--grey-600); box-shadow: var(--shadow-md);
    display: flex; align-items: center; pointer-events: none;
}

/* ── Client list: pricing column ───────────────────────── */
.cl-pricing-universal { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--grey-500); background: var(--grey-100); border-radius: var(--radius-full); padding: 2px 8px; }
.cl-pricing-custom { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--brand-primary-text); font-weight: 500; }
.cl-pricing-zones { font-size: 11px; color: var(--grey-500); margin-top: 2px; }

/* ── Client Detail: Pricing Tab ─────────────────────────── */
.client-pricing-section { padding: 20px 0; }

.client-pricing-toggle-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
    padding: 16px; background: var(--grey-50); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); margin-bottom: 20px;
}
.client-pricing-toggle-label { font-weight: 600; font-size: 14px; color: var(--grey-900); margin-bottom: 3px; }
.client-pricing-toggle-desc  { font-size: 12px; color: var(--grey-500); }

/* Toggle switch */
.star-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin: 0; cursor: pointer; }
.star-toggle input { opacity: 0; width: 0; height: 0; }
.star-toggle-slider {
    position: absolute; inset: 0; background: var(--grey-300); border-radius: 24px;
    transition: background var(--transition-base);
}
.star-toggle-slider::before {
    content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: white; border-radius: 50%; transition: transform var(--transition-base);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.star-toggle input:checked + .star-toggle-slider { background: var(--brand-primary); }
.star-toggle input:checked + .star-toggle-slider::before { transform: translateX(20px); }

.client-pricing-custom-panel { padding: 4px 0; }
.client-pricing-assign { margin-bottom: 12px; }
.client-pricing-assign-label { font-size: 12px; font-weight: 600; color: var(--grey-600); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; display: block; }
.client-pricing-assign-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.client-pricing-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--grey-400); font-size: 12px; }
.client-pricing-or span { padding: 0 6px; }

.client-pricing-current {
    margin-top: 20px; padding: 14px 16px;
    background: var(--brand-primary-light); border: 1.5px solid var(--brand-primary);
    border-radius: var(--radius-md);
}
.client-pricing-current-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--brand-primary-text); margin-bottom: 6px; }
.client-pricing-current-name  { font-weight: 600; font-size: 15px; color: var(--grey-900); margin-bottom: 4px; }
.client-pricing-current-meta  { font-size: 12px; color: var(--grey-600); }

.client-pricing-universal-info {
    padding: 24px; text-align: center; color: var(--grey-600); font-size: 14px;
    background: var(--grey-50); border: 1px solid var(--border-color); border-radius: var(--radius-md);
}

/* ── Location pricing cell ──────────────────────────────── */
.loc-pricing-cell { display: flex; align-items: center; gap: 4px; }
.loc-pricing-select { flex: 1; min-width: 0; font-size: 12px !important; height: 28px !important; padding: 2px 6px !important; }
.loc-pricing-edit { flex-shrink: 0; }

/* ── Order form: zone price hint ────────────────────────── */
.order-zone-hint {
    font-size: 11px; color: var(--brand-primary-text); margin-top: 3px;
    display: flex; align-items: center; gap: 4px;
}
.order-zone-hint-loading { color: var(--grey-400); }

/* ── Out-of-zone indicators ─────────────────────────────── */
.order-zone-hint-ooz { color: var(--color-warning); }

.order-row-out-of-zone > td:not(.order-status-cell) {
    background: #fff8f0 !important;
    border-left: 3px solid var(--color-warning) !important;
}
.order-row-out-of-zone > td:not(.order-status-cell):not(:first-child) { border-left: none !important; }
.order-row-out-of-zone > td:first-child { border-left: 3px solid var(--color-danger) !important; }

.order-return-badge {
    display: inline-block;
    padding: 1px 5px;
    margin-right: 4px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .3px;
    background: #DBEAFE;
    color: #1D4ED8;
    white-space: nowrap;
}

.order-return-badge-origin {
    background: #E0E7FF;
    color: #4338CA;
}

[data-theme="dark"] .order-return-badge { background: #1E3A5F; color: #93C5FD; }
[data-theme="dark"] .order-return-badge-origin { background: #312E81; color: #C7D2FE; }

.order-ooz-badge {
    color: var(--color-warning); font-size: 11px; margin-left: 4px;
    cursor: default;
}
.order-no-coords-badge {
    color: var(--color-danger); font-size: 11px; margin-left: 4px;
    cursor: default;
}
.status-u-obradi  { background-color: #555555; color: #fff; font-weight: bold; font-size: 11px; }
.status-van-zone  { background-color: #b85c00; color: #fff; font-weight: bold; font-size: 11px; }

/* ── Client pricing: out-of-zone settings section ────────── */
.client-pricing-ooz-section {
    margin-top: 20px; padding: 16px;
    background: var(--color-warning-bg); border: 1px solid var(--color-warning);
    border-radius: var(--radius-md);
}
.client-pricing-ooz-title { font-weight: 600; font-size: 13px; color: var(--grey-900); margin-bottom: 4px; }
.client-pricing-ooz-desc  { font-size: 12px; color: var(--grey-600); }

/* ── Restaurant cenovnik view ───────────────────────────── */
.rest-cenovnik-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:var(--space-lg); }
.rest-cenovnik-title  { font-family:var(--font-display); font-size:22px; font-weight:700; color:var(--grey-900); margin:0 0 4px; }
.rest-cenovnik-subtitle { font-size:13px; color:var(--grey-500); margin:0; }

.rest-cenovnik-empty { text-align:center; padding:60px 0; color:var(--grey-400); }
.rest-cenovnik-empty i { font-size:40px; display:block; margin-bottom:12px; }
.rest-cenovnik-empty p { font-size:14px; margin:0 0 8px; }

.rest-cenovnik-body { display:flex; gap:0; height:calc(100vh - 160px); border:1px solid var(--border-color); border-radius:var(--radius-md); overflow:hidden; box-shadow:var(--shadow-sm); }

.rest-cenovnik-sidebar { width:280px; flex-shrink:0; background:white; border-right:1px solid var(--border-color); display:flex; flex-direction:column; overflow:hidden; }
.rest-cenovnik-base-row { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:var(--brand-primary-light); border-bottom:1px solid var(--brand-primary); flex-shrink:0; }
.rest-cenovnik-base-label { font-size:11px; font-weight:600; color:var(--brand-primary-text); text-transform:uppercase; letter-spacing:.4px; }
.rest-cenovnik-base-price  { font-size:15px; font-weight:700; color:var(--brand-primary-text); }

.rest-zone-card { padding:10px 14px; border-bottom:1px solid var(--grey-100); cursor:pointer; transition:background var(--transition-fast); }
.rest-zone-card:hover { background:var(--grey-50); }
.rest-zone-active { background:var(--brand-primary-light) !important; border-left:3px solid var(--brand-primary); }
.rest-zone-card-top { display:flex; align-items:center; gap:8px; }
.rest-zone-dot  { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.rest-zone-name { flex:1; font-size:13px; font-weight:500; color:var(--grey-900); }
.rest-zone-price { font-size:13px; font-weight:700; color:var(--grey-700); white-space:nowrap; }
.rest-zone-pts  { font-size:11px; color:var(--grey-400); margin-top:2px; padding-left:18px; }

.rest-cenovnik-map-wrap { flex:1; position:relative; overflow:hidden; }
.rest-cenovnik-map  { width:100%; height:100%; }

/* Slobodni dani — chipovi u nedeljnom prikazu */
.shifts-dayoff-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 10px;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.shifts-dayoff-vacation { background: #e3f2fd; color: #1565c0; }
.shifts-dayoff-sick     { background: #fff3e0; color: #e65100; }
.shifts-dayoff-personal { background: #f3e5f5; color: #6a1b9a; }
.shifts-dayoff-other    { background: #f5f5f5; color: #424242; }

/* Dostupnost: slobodna vozila i vozači bez rasporeda */
.shifts-availability-block {
    margin-top: 8px;
    border-top: 1px dashed #ddd;
    padding-top: 6px;
}
.shifts-avail-section { margin-bottom: 5px; }
.shifts-avail-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #888;
    margin-bottom: 3px;
}
.shifts-avail-vehicle {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 11px;
    line-height: 1.4;
    flex-wrap: wrap;
}
.shifts-avail-vehicle-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}
.shifts-avail-vehicle-hours {
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 8px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.shifts-avail-vehicle-slots {
    color: #777;
    font-size: 10px;
    white-space: nowrap;
}
.shifts-avail-drivers {
    font-size: 11px;
    color: #555;
    line-height: 1.5;
}

/* Slobodni dani — indikator u mesečnom prikazu */
.shifts-month-dayoff { background: #fef9e7 !important; }
.shifts-month-dayoff-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 9px;
    margin-top: 2px;
}
[data-theme="dark"] .shifts-dayoff-vacation { background: #1a3a5c; color: #90caf9; }
[data-theme="dark"] .shifts-dayoff-sick     { background: #4a2800; color: #ffcc80; }
[data-theme="dark"] .shifts-dayoff-personal { background: #3a1a4a; color: #ce93d8; }
[data-theme="dark"] .shifts-dayoff-other    { background: #2a2a2a; color: #bdbdbd; }
[data-theme="dark"] .shifts-month-dayoff    { background: #2a2600 !important; }
.rest-cenovnik-map-hint { position:absolute; bottom:10px; left:50%; transform:translateX(-50%); background:white; border:1px solid var(--border-color); border-radius:var(--radius-full); padding:4px 14px; font-size:11px; color:var(--grey-500); box-shadow:var(--shadow-sm); pointer-events:none; white-space:nowrap; }

/* ── Slobodni kuriri bar ─────────────────────────────────────────────────── */
.free-drivers-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    background: var(--color-success-bg);
    border: 1px solid #b2dfcc;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.free-drivers-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-success);
    white-space: nowrap;
}

.free-drivers-count {
    background: var(--color-success);
    color: #fff;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    line-height: 18px;
}

.free-drivers-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}
.free-drivers-pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--color-success);
    opacity: 0;
    animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
    0%   { transform: scale(.6); opacity: .8; }
    100% { transform: scale(1.8); opacity: 0; }
}

.free-drivers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.free-driver-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 7px;
    background: #fff;
    border: 1px solid #b2dfcc;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    color: var(--grey-800);
    white-space: nowrap;
}

.free-driver-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-success);
    flex-shrink: 0;
}

.free-driver-name {
    font-weight: 600;
    color: var(--grey-900);
}

.free-driver-vehicle {
    font-size: 11px;
    color: var(--grey-500);
}
.free-driver-vehicle::before { content: '·'; margin-right: 3px; }

.free-drivers-empty {
    font-size: 12px;
    color: var(--grey-400);
    font-style: italic;
}

/* Autopilot dugme (docs/auto-dispatch-plan.md, sekcija 3.8) */
.btn-autopilot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-300);
    background: #fff;
    color: var(--grey-600);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    cursor: pointer;
}
.btn-autopilot .autopilot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--grey-400);
    flex-shrink: 0;
}
.btn-autopilot.is-on {
    background: var(--color-success-bg);
    border-color: #b2dfcc;
    color: var(--color-success);
}
.btn-autopilot.is-on .autopilot-dot {
    background: var(--color-success);
}

/* Dispatch predlog — red ispod narudžbine bez vozača */
/* Stanje dispatch-a u traci: crveno kad cron stoji, sivo kad je namerno ugasen.
   Namerno bez animacije — treperenje u alatu koji se gleda celu noc je maltretiranje. */
.dispatch-health {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid currentColor;
    cursor: help;
}

.dispatch-health.is-off {
    background: var(--grey-100);
    color: var(--grey-600);
    border-color: var(--grey-300);
}

.dispatch-health.is-info {
    background: var(--grey-100);
    color: var(--grey-700, var(--grey-600));
    border-color: var(--grey-300);
}

.dispatch-health-stack {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.dispatch-health-time {
    font-weight: 400;
    opacity: .8;
}

/* Ishod dispatch-a uz ime vozača. Mala, tiha oznaka — stoji na svakoj vožnji koja
   je prošla kroz dispatch, pa ne sme da se takmiči sa sadržajem reda. */
.dispatch-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 5px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    vertical-align: middle;
    transition: transform var(--transition-fast);
}

.dispatch-mark:hover { transform: scale(1.18); }

/* Prihvaćeno i automatski dodeljeno su ishodi u kojima je dispatch pogodio —
   zeleno. Preraspodela je neutralna informacija, ne greška, pa je plava. */
.dispatch-mark.is-accepted   { background: var(--color-success-bg); color: var(--color-success); }
.dispatch-mark.is-auto       { background: var(--color-success-bg); color: var(--color-success); }
.dispatch-mark.is-overridden { background: var(--brand-primary-light);  color: var(--brand-primary-text); }
.dispatch-mark.is-suggested  { background: var(--brand-secondary-light); color: var(--brand-secondary-text); }
.dispatch-mark.is-escalated  { background: var(--color-danger-bg);  color: var(--color-danger); }

/* Istorija u modalu: koraci jedan ispod drugog, sa linijom koja ih povezuje. */
.dispatch-history-step {
    position: relative;
    padding: 0 0 14px 18px;
    border-left: 2px solid var(--grey-200);
}

.dispatch-history-step:last-child { border-left-color: transparent; padding-bottom: 0; }

.dispatch-history-step::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-primary);
}

.dispatch-history-head { font-size: 12px; margin-bottom: 3px; }

.dispatch-history-reason {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    color: var(--grey-700);
}

.dispatch-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--brand-secondary-text);
    background: var(--brand-secondary-light);
    border-radius: var(--radius-md);
    padding: 3px 8px;
    margin-top: 3px;
}
.dispatch-suggestion .dispatch-suggestion-driver {
    font-weight: 700;
}
.dispatch-suggestion .btn-suggestion-accept {
    border: none;
    background: var(--color-success);
    color: #fff;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    cursor: pointer;
}
.dispatch-suggestion .btn-suggestion-why {
    border: none;
    background: transparent;
    color: var(--brand-secondary-text);
    text-decoration: underline;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
}
.dispatch-suggestion.deadline-risk {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

.driver-row-deleted td {
    opacity: 0.45;
    font-style: italic;
}

/* Neaktivan nije isto što i obrisan: nalog postoji i može da se vrati, pa red
   ostaje čitljiv — samo se vidi da je van upotrebe. */
.driver-row-inactive td {
    opacity: 0.7;
    background: var(--grey-50);
}

.staff-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .4px;
    vertical-align: middle;
}

.staff-badge.is-inactive { background: var(--color-warning-bg); color: var(--color-warning); }
.staff-badge.is-deleted  { background: var(--color-danger-bg);  color: var(--color-danger); }

.order-row-warning td:not(.order-status-cell) { background-color: #fff3cd; }
.order-row-danger td:not(.order-status-cell)  { background-color: #ffd5d5; }
.order-row-overdue td:not(.order-status-cell) { background-color: #f8d7da; }

.order-free-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #cc0000;
    border-radius: 3px;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* ── Dolazne fakture — detalj panel ── */
/* Zbirovi stoje uz filtere, iznad liste — menjaju se sa filterom, pa su odgovor
   na pitanje koje filter postavlja. Odnose se na ceo filtrirani skup, ne na
   prikazanu stranu. */
/* Pregled iznosa u formi jednokratne fakture — vidi se šta će biti upisano
   pre nego što se klikne, jer se posle slanja na SEF ništa ne menja lako. */
.sef-oneoff-total {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    font-size: 13px;
    color: var(--grey-600);
    font-variant-numeric: tabular-nums;
}

.sef-oneoff-total strong { color: var(--grey-900); }
.sef-oneoff-total .is-total strong { color: var(--brand-primary-text); font-size: 15px; }

.sef-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.sef-total {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
    background: var(--card-bg);
    box-shadow: var(--shadow-xs);
}

.sef-total-lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--grey-500);
}

.sef-total-val {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--grey-900);
}

.sef-total-val small { font-size: 11px; font-weight: 500; color: var(--grey-500); }

.sef-total-cnt { font-size: 11px; color: var(--grey-500); }

/* Naplaceno i nenaplaceno nose boju; ukupno ostaje neutralno da zbir ne vice. */
.sef-total.is-paid   { border-left: 3px solid var(--color-success); }
.sef-total.is-unpaid { border-left: 3px solid var(--color-warning); }
.sef-total.is-paid   .sef-total-val { color: var(--color-success); }
.sef-total.is-unpaid .sef-total-val { color: var(--color-warning); }

.sef-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 13px;
}
.sef-pagination-btns { display: flex; align-items: center; gap: 4px; }

.sef-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1040;
}
.sef-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 460px;
    max-width: 96vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,.18);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sef-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fc;
}
.sef-detail-header h4 { margin: 0; font-size: 15px; font-weight: 600; }
.sef-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ============================================================
   GPS TRACKING — live vehicle map (homepage tab)
   ============================================================ */

.tracking-status-driving   { --status-color: #059669; --status-bg: #E6F7EF; }
.tracking-status-idling    { --status-color: #2563EB; --status-bg: #E8F1FD; }
.tracking-status-parked    { --status-color: #DC2626; --status-bg: #FCEAEA; }
.tracking-status-offline   { --status-color: #1F2937; --status-bg: #E5E7EB; }
.tracking-status-no_data   { --status-color: #9AAABA; --status-bg: #F6F8FA; }

.tracking-container {
    display: flex;
    position: relative;
    height: calc(100vh - 160px);
    min-height: 520px;
    gap: var(--space-md);
}

.tracking-sidebar {
    width: 340px;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: width .25s ease, min-width .25s ease, border-width .25s ease, opacity .2s ease;
}

.tracking-sidebar.tracking-sidebar-collapsed {
    width: 0;
    min-width: 0;
    border-width: 0;
    opacity: 0;
    pointer-events: none;
}

.tracking-sidebar-toggle {
    position: absolute;
    top: 14px;
    left: 328px;
    z-index: 700;
    width: 22px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    color: var(--grey-600);
    font-size: 11px;
    cursor: pointer;
    transition: left .25s ease, color var(--transition-fast), border-color var(--transition-fast);
}

.tracking-sidebar-toggle:hover { color: var(--brand-primary-text); border-color: var(--brand-primary); }

.tracking-sidebar-toggle.collapsed { left: 0; }

.tracking-sidebar-header {
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--grey-200);
}

.tracking-sidebar-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--grey-800);
    margin: 0 0 var(--space-sm) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tracking-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-success);
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(27, 158, 94, .5);
    animation: trackingPulse 2s infinite;
}

@keyframes trackingPulse {
    0%   { box-shadow: 0 0 0 0 rgba(27, 158, 94, .45); }
    70%  { box-shadow: 0 0 0 6px rgba(27, 158, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(27, 158, 94, 0); }
}

.tracking-updated-at {
    font-size: 11px;
    color: var(--grey-500);
    font-variant-numeric: tabular-nums;
}

.tracking-search {
    margin-top: var(--space-sm);
}

.tracking-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--grey-200);
}

.tracking-filter-btn {
    border: 1px solid var(--grey-200);
    background: white;
    color: var(--grey-700);
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.4;
}

.tracking-filter-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary-text); }

.tracking-filter-btn.active {
    background: var(--grey-900);
    border-color: var(--grey-900);
    color: white;
}

.tracking-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.tracking-card {
    background: var(--card-bg);
    border: 1px solid var(--grey-200);
    border-left: 3px solid var(--status-color, var(--grey-300));
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.tracking-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(1px);
}

.tracking-card.active {
    box-shadow: var(--shadow-md);
    border-left-width: 4px;
}

.tracking-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.tracking-card-name {
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--grey-900);
}

.tracking-card-plates {
    font-size: 11px;
    color: var(--grey-500);
    font-variant-numeric: tabular-nums;
}

.tracking-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    color: var(--status-color, var(--grey-600));
    background: var(--status-bg, var(--grey-100));
    white-space: nowrap;
}

.tracking-card-driver {
    font-size: 12px;
    color: var(--grey-700);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}

.tracking-card-driver.no-driver {
    color: var(--grey-400);
    font-style: italic;
}

.tracking-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--grey-500);
}

.tracking-card-speed {
    font-weight: 700;
    color: var(--grey-800);
    font-variant-numeric: tabular-nums;
}

.tracking-warning-icon { color: var(--color-warning); margin-right: 3px; }

.tracking-empty {
    text-align: center;
    color: var(--grey-400);
    padding: var(--space-xl) var(--space-md);
    font-size: 13px;
}

.tracking-map-wrap {
    flex: 1;
    position: relative;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tracking-map {
    /* Apsolutno, a ne height:100% — roditelj na mobilnom ima samo min-height, a
       Safari/iOS procenat visine u odnosu na height:auto razresava na 0. */
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tracking-map-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 500;
    display: flex;
    gap: 6px;
}

.tracking-fit-btn {
    background: white;
    border: 1px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-800);
    padding: 6px 10px;
    cursor: pointer;
}

.tracking-fit-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary-text); }

.tracking-fit-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--brand-on-primary);
}

.tracking-legend {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 500;
    background: rgba(255,255,255,.95);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 8px 12px;
    font-size: 11px;
    display: flex;
    gap: 12px;
}

.tracking-legend-item { display: flex; align-items: center; gap: 5px; color: var(--grey-700); }
.tracking-legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-color); }

.tracking-detail-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 600;
    width: 260px;
    background: var(--card-bg);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
}

.tracking-detail-close {
    position: absolute;
    top: 8px;
    right: 10px;
    cursor: pointer;
    color: var(--grey-400);
    font-size: 14px;
}

.tracking-detail-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--grey-900);
    margin: 0 0 2px 0;
}

.tracking-detail-plates {
    font-size: 12px;
    color: var(--grey-500);
    margin-bottom: 8px;
}

.tracking-detail-address {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: var(--grey-700);
    margin-top: 4px;
    line-height: 1.4;
}

.tracking-detail-address i { color: var(--grey-400); margin-top: 2px; }

.tracking-telemetry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    margin: 10px 0;
    padding: 10px 0;
    border-top: 1px solid var(--grey-100);
    border-bottom: 1px solid var(--grey-100);
}

.tracking-telemetry-item { font-size: 11.5px; color: var(--grey-600); }
.tracking-telemetry-value {
    display: block;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--grey-900);
    font-variant-numeric: tabular-nums;
}

.tracking-detail-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.tracking-card-top-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tracking-eye-toggle {
    color: var(--grey-400);
    font-size: 12px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.tracking-eye-toggle:hover { color: var(--brand-primary-text); }
.tracking-eye-toggle.fa-eye { color: var(--grey-600); }

.tracking-card-hidden { opacity: .5; }
.tracking-card-hidden:hover { opacity: .8; }

.tracking-picker-count {
    font-variant-numeric: tabular-nums;
    opacity: .7;
    margin-left: 2px;
}

.tracking-vehicle-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 550;
}

.tracking-vehicle-picker {
    position: absolute;
    top: 46px;
    right: 10px;
    z-index: 600;
    width: 280px;
    max-height: min(420px, calc(100% - 60px));
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.tracking-vehicle-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--grey-900);
    border-bottom: 1px solid var(--grey-200);
}

.tracking-vehicle-picker-actions {
    display: flex;
    gap: 6px;
    padding: var(--space-sm) 12px;
    border-bottom: 1px solid var(--grey-200);
}

.tracking-vehicle-picker-list {
    overflow-y: auto;
    padding: 6px;
}

.tracking-vehicle-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 400;
    margin: 0;
    transition: background var(--transition-fast);
}

.tracking-vehicle-picker-item:hover { background: var(--grey-100); }
.tracking-vehicle-picker-item input[type="checkbox"] { accent-color: var(--brand-primary); margin: 0; }

.tracking-picker-dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background: var(--status-color, var(--grey-300));
}

.tracking-vehicle-picker-name {
    flex: 1;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--grey-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tracking-vehicle-picker-plates {
    font-size: 11px;
    color: var(--grey-500);
    font-variant-numeric: tabular-nums;
}

/* Vehicle name label rendered by the Google Maps marker (next to the arrow icon) —
   default label styling is faint black text with no background, hard to read over
   satellite/street tiles — rendered via a custom OverlayView (not marker.label, which
   silently ignores className/background), positioned in JS via left/top on each draw().
   Background color is set inline per-vehicle to match its status color. */
.tracking-marker-gmap-label {
    position: absolute;
    transform: translate(-50%, -32px);
    color: #fff !important;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 600;
}

@media (max-width: 900px) {
    .tracking-container { flex-direction: column; height: auto; }
    .tracking-sidebar { width: 100%; min-width: 100%; max-height: 320px; }
    .tracking-map-wrap { min-height: 420px; }
}

/* ============================================================
   GPS TRACKING — vehicle history / playback (GPS page tab)
   ============================================================ */

.vh-history-layout {
    display: flex;
    gap: var(--space-md);
    height: calc(100vh - 300px);
    min-height: 480px;
}

.vh-trip-panel {
    width: 360px;
    min-width: 360px;
    display: flex;
    flex-direction: column;
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.vh-trip-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: var(--space-md);
    border-bottom: 1px solid var(--grey-200);
}

.vh-trip-totals-item { font-size: 11px; color: var(--grey-500); }
.vh-trip-totals-value {
    display: block;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--grey-900);
    font-variant-numeric: tabular-nums;
}

.vh-trip-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.vh-trip-row {
    background: var(--card-bg);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow var(--transition-fast);
}

.vh-trip-row:hover { box-shadow: var(--shadow-sm); }
.vh-trip-row.active { box-shadow: var(--shadow-md); border-color: var(--brand-primary); }

.vh-trip-row-time {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--grey-900);
    font-variant-numeric: tabular-nums;
}

.vh-trip-row-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--grey-600);
    margin-top: 4px;
}

.vh-trip-idle-flag { color: var(--color-warning); font-weight: 700; }
.vh-trip-speed-flag { color: var(--color-danger); font-weight: 700; }

.vh-history-map-wrap {
    flex: 1;
    position: relative;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--grey-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.vh-history-map {
    /* Vidi napomenu uz .tracking-map — isti Safari/iOS problem. */
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vh-truncated-notice {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 500;
    background: var(--color-warning-bg);
    color: #8a5a00;
    border: 1px solid #f0d78c;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    padding: 6px 10px;
    box-shadow: var(--shadow-sm);
}

.vh-playback-bar {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    z-index: 500;
    background: rgba(255,255,255,.97);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vh-playback-readout {
    font-size: 11.5px;
    color: var(--grey-600);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .vh-history-layout { flex-direction: column; height: auto; }
    .vh-trip-panel { width: 100%; min-width: 100%; max-height: 300px; }
    .vh-history-map-wrap { min-height: 420px; }
}

[data-theme="dark"] .tracking-sidebar,
[data-theme="dark"] .vh-trip-panel { background: var(--grey-900); border-color: var(--grey-800); }
[data-theme="dark"] .tracking-sidebar-header,
[data-theme="dark"] .tracking-filters,
[data-theme="dark"] .vh-trip-totals { border-color: var(--grey-800); }
[data-theme="dark"] .tracking-card,
[data-theme="dark"] .vh-trip-row { background: var(--grey-800); border-color: var(--grey-700); }
[data-theme="dark"] .tracking-filter-btn { background: var(--grey-800); border-color: var(--grey-700); color: var(--grey-300); }
[data-theme="dark"] .tracking-legend,
[data-theme="dark"] .tracking-detail-panel,
[data-theme="dark"] .vh-playback-bar { background: rgba(26,35,50,.97); border-color: var(--grey-700); }
[data-theme="dark"] .tracking-vehicle-picker { background: var(--grey-900); border-color: var(--grey-700); }
[data-theme="dark"] .tracking-vehicle-picker-header,
[data-theme="dark"] .tracking-vehicle-picker-actions { border-color: var(--grey-800); }
[data-theme="dark"] .tracking-vehicle-picker-item:hover { background: var(--grey-800); }
[data-theme="dark"] .tracking-vehicle-picker-name { color: var(--grey-100); }
[data-theme="dark"] .tracking-sidebar-toggle { background: var(--grey-800); border-color: var(--grey-700); color: var(--grey-300); }

/* ── Tabela potražnje (raspored → tab Potražnja) ────────────────────────────
   24 polja po redu, pa svako mora biti usko a i dalje čitljivo. Popunjena
   polja se ističu, da se na prvi pogled vidi gde potražnja uopšte postoji. */
.demand-grid { font-size: 11px; }
.demand-grid th,
.demand-grid td { padding: 2px 1px !important; text-align: center; vertical-align: middle !important; }
.demand-day-col  { width: 46px; }
.demand-hour-th  { font-weight: 600; color: var(--grey-500); font-size: 10px; }
.demand-total-th { width: 44px; }
.demand-day-label { font-weight: 700; color: var(--grey-700); }
.demand-day-label.demand-weekend { color: var(--brand-secondary-text); }
.demand-row-total { font-weight: 700; color: var(--brand-primary-text); font-variant-numeric: tabular-nums; }

.demand-cell input {
    width: 100%;
    min-width: 30px;
    padding: 2px 1px;
    border: 1px solid var(--grey-200);
    border-radius: 3px;
    text-align: center;
    font-size: 11px;
    background: var(--card-bg);
    color: var(--grey-500);
    -moz-appearance: textfield;
}

.demand-cell input::-webkit-outer-spin-button,
.demand-cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.demand-cell input.is-set {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
    color: var(--grey-900);
    font-weight: 600;
}

/* Sat posle zatvaranja firme — ništa se ne planira, pa ćelija vidno "ne postoji". */
.demand-cell.demand-closed {
    background: repeating-linear-gradient(135deg, var(--grey-100) 0 3px, transparent 3px 6px);
    color: var(--grey-300);
}

.demand-cell.demand-closed input {
    background: transparent;
    border-color: transparent;
    color: var(--grey-300);
    cursor: not-allowed;
}

.demand-day-hint {
    margin-top: 12px;
    font-size: 12px;
}

/* Naslov jedne od tri tabele u tabu Potražnja (potražnja / kapacitet / kuriri). */
.demand-section-title {
    margin: 18px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-800);
}

.demand-section-title .fa {
    margin-right: 6px;
    color: var(--brand-primary-text);
}

.demand-section-title small {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 400;
}

/* Izvedene ćelije (potražnja, kuriri) — isti raster kao unos, ali bez polja, da se
   vidi da se ne menjaju rukom. */
.demand-cell-ro {
    font-variant-numeric: tabular-nums;
    color: var(--grey-400);
}

.demand-cell-ro.is-set {
    background: var(--grey-100);
    color: var(--grey-900);
    font-weight: 600;
}

/* Broj kurira je ono iz čega smene nastaju — nosi boju brenda da se izdvoji od
   sirove potražnje iznad. */
.demand-cell-couriers.is-set {
    background: var(--brand-secondary-light);
    color: var(--brand-secondary-text);
    font-weight: 700;
}

/* Smena iz predloga kojoj još fali kurir ili vozilo — da se na prvi pogled vidi
   šta dispečer tek treba da popuni. */
.shifts-excel-entry-row.shifts-excel-unassigned {
    border-left: 3px solid var(--brand-secondary);
    background: var(--grey-50);
}

.shifts-excel-entry-row.shifts-excel-unassigned .shifts-excel-vehicle-badge,
.shifts-excel-entry-row.shifts-excel-unassigned .shifts-excel-driver-name {
    color: var(--grey-500);
    font-style: italic;
}

.demand-week-avg {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.demand-week-avg strong {
    color: var(--brand-primary-text);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.demand-applied {
    padding: 12px 14px;
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-left: 3px solid var(--brand-primary);
    border-radius: var(--radius-md);
}

/* Pregled predloga pre upisa: dan po red, smene kao pločice koje se mogu izbaciti. */
.demand-proposal-bar { justify-content: flex-start; gap: 12px; }

.demand-preview {
    padding: 12px 14px;
    border: 1px solid var(--grey-200);
    border-left: 3px solid var(--brand-secondary);
    border-radius: var(--radius-md);
}

.demand-preview-table { margin-bottom: 10px; font-size: 12px; }
.demand-preview-table td { vertical-align: middle !important; font-variant-numeric: tabular-nums; }

.demand-shift-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 2px 4px 2px 0;
    padding: 2px 4px 2px 8px;
    background: var(--brand-secondary-light);
    border-radius: 3px;
    color: var(--brand-secondary-text);
    font-weight: 600;
    white-space: nowrap;
}

.demand-shift-chip small { font-weight: 400; }

/* Smena koju raspored već ima — prikazana da se vidi pokrivenost, ali se ne upisuje. */
.demand-shift-chip.is-existing {
    padding-right: 8px;
    background: var(--grey-100);
    color: var(--grey-500);
    font-weight: 400;
}

.demand-shift-remove {
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: .6;
}

.demand-shift-remove:hover { opacity: 1; }

.demand-preview-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================================
   NOVA VOŽNJA — forma za unos vožnje (modal #modalNewOrder)
   Koraci 1–5 u karticama, sa lepljivim pregledom sa strane.
   Prefiks .nv- da se ne meša sa bootstrap form-control stilovima.
   ============================================================ */

.nv-dialog {
    width: auto;
    max-width: 1180px;
    margin: 24px auto;
}

.nv-content {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 20, 25, .28);
}

/* --- Zaglavlje --- */
.nv-head {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 56px 16px 24px;
    background: #fff;
    border-bottom: 1px solid var(--grey-200);
}

.nv-crumb {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--grey-600);
}

.nv-title {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--grey-900);
}

.nv-req {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--grey-600);
}

.nv-star {
    color: var(--color-danger);
}

.nv-close {
    position: absolute;
    top: 16px;
    right: 18px;
    float: none;
    font-size: 26px;
    line-height: 1;
    opacity: .45;
}

.nv-close:hover {
    opacity: .8;
}

/* --- Telo: dve kolone --- */
.nv-body {
    padding: 20px 24px;
    background: var(--grey-100);
    max-height: calc(100vh - 230px);
    overflow-y: auto;
}

.nv-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.nv-main {
    flex: 1 1 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* --- Kartica koraka --- */
.nv-card {
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
    padding: 16px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nv-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--grey-900);
}

.nv-step {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-primary-light);
    color: var(--brand-primary-text);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Polja --- */
.nv-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.nv-field-wide {
    max-width: 460px;
}

.nv-label {
    margin: 0;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--grey-700);
}

.nv-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.nv-input {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--grey-300);
    border-radius: 8px;
    background: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--grey-900);
    box-shadow: none;
    transition: border-color .12s, box-shadow .12s;
}

.nv-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(247, 154, 43, .15);
}

.nv-input::placeholder {
    color: var(--grey-400);
}

.nv-textarea {
    height: auto;
    min-height: 78px;
    padding: 11px 14px;
    line-height: 1.45;
    resize: vertical;
}

.nv-input[type=number]::-webkit-inner-spin-button,
.nv-input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.nv-input[type=number] {
    -moz-appearance: textfield;
}

.nv-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 38px;
    cursor: pointer;
}

.nv-select-wrap {
    position: relative;
}

.nv-select-arrow {
    position: absolute;
    right: 14px;
    top: 12px;
    font-size: 15px;
    color: var(--grey-600);
    pointer-events: none;
}

/* Sufiks jedinice (min / kg / RSD) unutar polja */
.nv-suffix-wrap {
    position: relative;
}

.nv-input-suffix {
    padding-right: 52px;
}

.nv-suffix {
    position: absolute;
    right: 14px;
    top: 10px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--grey-500);
    pointer-events: none;
}

/* Vreme HH:MM — dva selecta koja izgledaju kao jedno polje */
.nv-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nv-time-part {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
    text-align: center;
    cursor: pointer;
}

.nv-time-sep {
    flex: none;
    font-weight: 700;
    color: var(--grey-500);
}

/* --- Greške i napomene --- */
.nv-err {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-danger);
}

.nv-hint {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--grey-600);
}

.nv-warn {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 9px 12px;
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.4;
    color: #7A5A00;
}

.nv-warn .fa {
    margin-top: 2px;
    color: var(--color-warning);
}

/* --- Ruta: A / zameni / B --- */
.nv-route {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.nv-leg {
    flex: 1 1 250px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 16px;
    background: var(--grey-50);
    border: 1px solid var(--grey-200);
    border-radius: 10px;
}

.nv-leg-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--grey-900);
}

.nv-pin {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nv-pin-a { background: var(--brand-primary); }
.nv-pin-b { background: var(--color-success); }

.nv-swap-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.nv-swap {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--grey-300);
    background: #fff;
    color: var(--brand-primary-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nv-swap:hover {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
}

/* --- Čipovi opcija --- */
.nv-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nv-chip,
.nv-check {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px 0 10px;
    border: 1px solid var(--grey-300);
    border-radius: 17px;
    background: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--grey-800);
    cursor: pointer;
}

.nv-chip:hover,
.nv-check:hover {
    border-color: var(--brand-primary);
}

.nv-chip.is-on,
.nv-check.is-on {
    background: var(--brand-primary-light);
    border-color: var(--brand-primary);
    color: var(--brand-primary-text);
}

.nv-chip-box {
    flex: none;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1.5px solid var(--grey-400);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nv-chip-box .fa {
    font-size: 10px;
    color: #fff;
    opacity: 0;
}

.nv-chip.is-on .nv-chip-box,
.nv-check.is-on .nv-chip-box {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.nv-chip.is-on .nv-chip-box .fa,
.nv-check.is-on .nv-chip-box .fa {
    opacity: 1;
}

.nv-chip-card.is-on {
    background: var(--brand-secondary-light);
    border-color: var(--brand-secondary);
    color: var(--brand-secondary-text);
}

.nv-chip-card.is-on .nv-chip-box {
    background: var(--brand-secondary);
    border-color: var(--brand-secondary);
}

.nv-check {
    align-self: flex-start;
    border: 0;
    border-radius: 6px;
    padding-left: 0;
    background: none;
    color: var(--grey-900);
}

.nv-check:hover {
    border: 0;
    background: none;
}

.nv-check.is-on {
    background: none;
    color: var(--grey-900);
}

/* --- Pregled vožnje --- */
.nv-summary {
    flex: 1 1 270px;
    max-width: 340px;
    min-width: 0;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: 12px;
}

.nv-summary-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--grey-900);
}

.nv-sum-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nv-sum-val {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--grey-900);
    overflow-wrap: anywhere;
}

.nv-sum-meta {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--grey-600);
}

.nv-sum-route {
    display: flex;
    gap: 12px;
}

.nv-sum-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5px;
}

.nv-sum-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.nv-sum-dot-a { background: var(--brand-primary); }
.nv-sum-dot-b { background: var(--color-success); }

.nv-sum-line {
    flex: 1;
    width: 2px;
    margin: 4px 0;
    background: var(--grey-200);
}

.nv-sum-legs {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.nv-sum-flags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nv-sum-flag {
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--brand-primary-light);
    color: var(--brand-primary-text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
}

.nv-sum-money {
    border-top: 1px solid var(--grey-200);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nv-sum-money-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 14px;
}

.nv-sum-money-row > span:first-child {
    color: var(--grey-600);
}

.nv-sum-money-row.is-total {
    padding-top: 6px;
    font-weight: 600;
}

.nv-sum-money-row.is-total > span:first-child {
    color: var(--grey-900);
}

/* --- Podnožje --- */
.nv-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 24px;
    background: var(--grey-50);
    border-top: 1px solid var(--grey-200);
}

.nv-foot-err {
    margin-right: auto;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-danger);
}

.nv-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 24px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.nv-btn-ghost {
    background: #fff;
    border-color: var(--grey-300);
    color: var(--grey-700);
}

.nv-btn-ghost:hover {
    background: var(--grey-100);
}

.nv-btn-primary {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
}

.nv-btn-primary:hover {
    background: var(--brand-primary-dark);
}

.nv-btn-primary[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

/* Na uskim ekranima pregled ide pod formu i prestaje da bude lepljiv. */
@media (max-width: 991px) {
    .nv-dialog {
        margin: 10px;
    }

    .nv-summary {
        position: static;
        max-width: none;
        flex-basis: 100%;
        order: -1;
    }

    .nv-body {
        padding: 14px;
        max-height: calc(100vh - 200px);
    }

    .nv-head {
        padding: 14px 48px 14px 16px;
    }

    .nv-foot {
        padding: 12px 16px;
    }
}
