      @font-face {
        font-family: 'Space Grotesk';
        src: url('/static/fonts/SpaceGrotesk-VariableFont_wght.ttf') format('truetype');
        font-weight: 300 700;
        font-display: swap;
      }
      :root {
        --brand-primary: #7C35FD;
        --brand-secondary: #2043FB;
        --brand-dark: #1005A5;
      }
        body {
            font-family: 'Space Grotesk', sans-serif;
            background: #0f1117;
            color: #e2e8f0;
            font-size: 14px;
        }

        .text-xs { font-size: 0.9rem !important; }
        .text-sm { font-size: 1rem !important; }

        .mono {
            font-family: 'Space Grotesk', monospace;
        }

        .card {
            background: #1a1d27;
            border: 1px solid #2d3148;
            border-radius: 8px;
        }

        .btn-primary {
            background: linear-gradient(135deg, #7C35FD 0%, #2043FB 100%);
            color: white;
            padding: 8px 20px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.1s ease, background 0.2s;
            border: none;
        }

        .btn-primary:hover {
            background: linear-gradient(135deg, #6a25e8 0%, #1838e0 100%);
        }

        .btn-primary:disabled {
            background: #2d3148;
            color: #718096;
            cursor: not-allowed;
        }

        .btn-secondary {
            background: #2d3148;
            color: #a0aec0;
            padding: 8px 20px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.1s ease, background 0.2s;
            border: none;
        }

        .btn-secondary:hover {
            background: #363b5a;
        }

        .izvj-sub-btn {
            background: none;
            border: none;
            border-bottom: 2px solid transparent;
            padding: 8px 20px;
            color: #9ca3af;
            cursor: pointer;
            font-size: 14px;
            margin-bottom: -1px;
            transition: color 0.15s;
        }
        .izvj-sub-btn:hover { color: #e2e8f0; }
        .izvj-sub-btn-active { color: white !important; border-bottom-color: #7C35FD !important; }

        .btn-success {
            background: #22c55e;
            color: white;
            padding: 6px 14px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            font-size: 15px;
            border: none;
        }

        .btn-danger {
            background: #ef4444;
            color: white;
            padding: 4px 10px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            font-size: 14px;
            border: none;
        }

        .btn-edit {
            background: #2d3148;
            color: #a0aec0;
            padding: 4px 10px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            font-size: 14px;
            margin-right: 4px;
            border: none;
        }

        .btn-status {
            background: #2a1a5f;
            color: #60a5fa;
            padding: 4px 10px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            font-size: 14px;
            margin-right: 4px;
            border: none;
        }

        input,
        select,
        textarea {
            background: #0f1117;
            border: 1px solid #2d3148;
            color: #e2e8f0;
            padding: 8px 12px;
            border-radius: 6px;
            width: 100%;
            outline: none;
        }

        input[type="radio"], input[type="checkbox"] { width: auto; }

        input:focus,
        select:focus,
        textarea:focus {
            border-color: #7C35FD;
            box-shadow: 0 0 0 3px rgba(124, 53, 253, 0.15);
        }

        .tab {
            padding: 10px 20px;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            color: #718096;
            font-weight: 600;
            font-size: 15px;
            transition: all 0.2s;
        }

        .tab.active {
            border-bottom-color: transparent;
            color: #7C35FD;
        }

        /* Nav groups — desktop only */
        .nav-group {
            display: flex;
            flex-direction: column;
        }

        .nav-group-label {
            display: none;
        }

        .nav-group-tabs {
            display: flex;
        }

        .nav-group-separator {
            display: none;
        }

        @media (min-width: 768px) {
            .nav-group-label {
                display: block;
                font-size: 12px;
                font-weight: 700;
                letter-spacing: 0.1em;
                text-transform: uppercase;
                color: #4a5568;
                padding: 6px 20px 0;
                line-height: 1;
            }

            .nav-group-separator {
                display: block;
                width: 1px;
                background: #2d3748;
                margin: 8px 4px 6px;
                align-self: stretch;
            }
        }

        .badge-dostupan {
            background: #14532d;
            color: #4ade80;
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 14px;
        }

        .badge-zauzet {
            background: #450a0a;
            color: #f87171;
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 14px;
        }

        .badge-bolovanje {
            background: #431407;
            color: #fb923c;
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 14px;
        }

        .badge-kreiran {
            background: #422006;
            color: #fbbf24;
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 14px;
        }

        .badge-lansiran {
            background: #2a1a5f;
            color: #60a5fa;
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 14px;
        }

        .modal-bg {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 50;
        }

        .pct-100 {
            background: #450a0a;
            color: #f87171;
        }

        .pct-60 {
            background: #422006;
            color: #fb923c;
        }

        .pct-low {
            background: #14532d;
            color: #4ade80;
        }

        th {
            color: #718096;
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 10px 12px;
        }

        td {
            padding: 10px 12px;
            border-bottom: 1px solid #2d3148;
        }

        tr:last-child td {
            border-bottom: none;
        }

        /* Sticky header za raspored tablicu */
        .raspored-scroll {
            overflow-x: auto;
            overflow-y: auto;
            max-height: 72vh;
        }
        .raspored-scroll thead th {
            position: sticky;
            top: 0;
            background: #1a1d27;
            z-index: 10;
            box-shadow: 0 1px 0 #2d3148;
        }

        .import-drop-zona {
            border: 2px dashed #2d3148;
            transition: border-color 0.2s, background 0.2s;
        }

        .import-drop-zona:hover {
            border-color: #7C35FD;
            background: #1a1d27;
        }

        .import-drop-zona.dragover {
            border-color: #7C35FD;
            background: #1a2040;
        }

        @media (max-width: 640px) {
            .hidden-mobile { display: none !important; }
            .desktop-row { display: none; }
            .mobile-row { display: table-row; }
        }
        @media (min-width: 641px) {
            .show-mobile { display: none !important; }
            .desktop-row { display: table-row; }
            .mobile-row { display: none; }
        }

        /* Mikro-interakcije: modal, gumbi, tabovi, focus, login */

        @keyframes modal-in {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes card-in {
            from { opacity: 0; transform: scale(0.96); }
            to { opacity: 1; transform: scale(1); }
        }

        .modal-bg {
            animation: modal-in 150ms ease-out;
        }

        .modal-bg > .card {
            animation: card-in 150ms ease-out;
        }

        .btn-success,
        .btn-danger,
        .btn-edit,
        .btn-status {
            transition: transform 0.1s ease, background 0.2s;
        }

        .btn-primary:active,
        .btn-secondary:active,
        .btn-success:active,
        .btn-danger:active,
        .btn-edit:active,
        .btn-status:active {
            transform: scale(0.97);
        }

        .btn-primary:disabled,
        .btn-secondary:disabled,
        .btn-success:disabled,
        .btn-danger:disabled,
        .btn-edit:disabled,
        .btn-status:disabled {
            transform: none;
        }

        .btn-primary:focus-visible,
        .btn-secondary:focus-visible,
        .btn-success:focus-visible,
        .btn-danger:focus-visible,
        .btn-edit:focus-visible,
        .btn-status:focus-visible {
            outline: 2px solid #7C35FD;
            outline-offset: 2px;
        }

        .tab {
            position: relative;
        }

        .tab::after {
            content: "";
            position: absolute;
            bottom: -2px;
            left: 0;
            height: 2px;
            width: 0;
            background: #7C35FD;
            transition: width 0.2s ease;
        }

        .tab.active::after {
            width: 100%;
        }

        #login-screen::before,
        #totp-forma::before,
        #setup-2fa-forma::before {
            content: "";
            position: absolute;
            inset: 0;
            pointer-events: none;
            background: radial-gradient(ellipse 600px 400px at 50% 40%, rgba(124, 53, 253, 0.10), transparent 70%);
        }

        @keyframes login-card-in {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        #login-screen .card,
        #totp-forma .card,
        #setup-2fa-forma .card {
            animation: login-card-in 200ms ease-out;
            position: relative;
            z-index: 1;
        }

        .hdr-separator {
            width: 1px;
            height: 20px;
            background: #2d3148;
        }
        #hdr-tvrtka {
            font-size: 18px;
            font-weight: 600;
            color: #e2e8f0;
            letter-spacing: 0.01em;
        }

/* A1b — flash na in-place ažuriranom redu (_replaceRow) */
@keyframes row-flash {
    from { background-color: rgba(74, 222, 128, 0.18); }
    to   { background-color: transparent; }
}

.row-flash td {
    animation: row-flash 400ms ease-out;
}

/* A2a — toast obavijesti */
#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    cursor: pointer;
    min-width: 240px;
    max-width: 380px;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #2d3148;
    border-left: 3px solid #718096;
    background: #1a1d27;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: toast-in 150ms ease-out;
}

.toast-success { border-left-color: #4ADE80; }
.toast-error   { border-left-color: #F87171; }
.toast-info    { border-left-color: #60A5FA; }

.toast-out { animation: toast-out 150ms ease-in forwards; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(16px); }
}

@media (max-width: 640px) {
    #toast-container { left: 12px; right: 12px; top: 12px; }
    .toast { min-width: 0; max-width: none; }
}

/* A3 — skeleton loading */
@keyframes skeleton-pulse {
    0%   { opacity: 0.55; }
    50%  { opacity: 0.25; }
    100% { opacity: 0.55; }
}

.skeleton-bar {
    height: 12px;
    border-radius: 4px;
    background: #2d3148;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-row td {
    padding: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-bar { animation: none; }
}

/* A4a — grid rasporeda: pillovi i hijerarhija ćelije */

/* Status pill (godišnji, bolovanje, dopust...) — boje ostaju inline iz STATUS_STYLE */
.rsp-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Hijerarhija unutar ćelije s rasporedom */
.rsp-opterecenje {        /* postotak — najprigušeniji */
    font-size: 0.7rem;
    color: #6b7280;
}
.rsp-projekt {            /* broj projekta — prigušen, monospace */
    font-family: 'Space Grotesk', monospace;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 2px;
}
.rsp-zadatak {            /* zadatak — ISTAKNUT, nosi značenje */
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    color: #e2e8f0;
    margin-top: 3px;
    word-break: break-word;
    white-space: normal;
}
.rsp-vrijeme {            /* planirano vrijeme — monospace, prigušeno */
    font-family: 'Space Grotesk', monospace;
    font-size: 0.68rem;
    color: #8b93a5;
    margin-top: 3px;
}
.rsp-tip {                /* badge tipa radnog vremena */
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    color: #c084fc;
    margin-top: 2px;
}

/* A4b — avatar inicijali u gridu rasporeda (iste vrijednosti kao .initials u javnom linku) */
.rsp-radnik-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rsp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #d1d5db;
    flex-shrink: 0;
    user-select: none;
}

/* Mobilni header — ime tvrtke ispod loga, ne preko datuma */
@media (max-width: 640px) {
    #hdr-tvrtka {
        font-size: 15px;
    }
    .hdr-separator {
        display: none;   /* okomiti separator nema smisla kad je stupac */
    }

    /* header postaje kompaktniji, lijevi blok u stupac */
    .border-b.flex.items-center.justify-between > .flex.items-center.gap-3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .border-b.flex.items-center.justify-between {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Mobitel: veća upisna polja i checkboxovi za lakši unos (stariji radnici) */
@media (max-width: 640px) {
    input,
    select,
    textarea {
        font-size: 16px;      /* čitljivije + ubija iOS zoom-on-focus (< 16px zumira) */
        padding: 10px 12px;   /* malo veća dodirna površina */
    }

    /* Checkboxovi i radio gumbi — veći, lakši za pogoditi prstom */
    input[type="checkbox"],
    input[type="radio"] {
        width: 22px;
        height: 22px;
        transform: scale(1);   /* eksplicitna veličina umjesto scale — pouzdanije */
        cursor: pointer;
    }

    /* Labela uz checkbox/radio — malo razmaka da se lakše tapne cijeli red */
    input[type="checkbox"] + label,
    input[type="radio"] + label {
        padding-left: 4px;
        line-height: 1.6;
    }
}
