@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800&display=swap');

/* =====================================================================
   DESIGN TOKENS
   Stripe/Google aesthetic — clean, simple, professional
===================================================================== */
:root {
    /* Brand — Professional Indigo */
    --blue:         hsl(225, 73%, 57%);
    --blue-hover:   hsl(225, 73%, 47%);
    --blue-light:   hsl(225, 73%, 65%);
    --blue-glow:    hsla(225, 73%, 57%, 0.15);
    --blue-tint:    hsla(225, 73%, 57%, 0.06);

    /* Semantic - Sophisticated Palettes */
    --green:         hsl(142, 69%, 38%);
    --green-tint:    hsla(142, 69%, 38%, 0.08);
    --green-border:  hsla(142, 69%, 38%, 0.2);
    --red:           hsl(0, 72%, 51%);
    --red-tint:      hsla(0, 72%, 51%, 0.08);
    --amber:         hsl(38, 92%, 50%);
    --amber-tint:    hsla(38, 92%, 50%, 0.08);
    --cyan:          hsl(188, 86%, 37%);
    
    /* Shape & Depth */
    --r-xs:  6px;
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  24px;

    /* Motion — Apple-style Snappy */
    --ease:       cubic-bezier(0.2, 0.8, 0.2, 1);
    --t-fast:     all 0.15s var(--ease);
    --t:          all 0.25s var(--ease);
    --t-slow:     all 0.4s var(--ease);
}

/* ── LIGHT ─────────────────────────────────────────────────────────── */
[data-theme="light"] {
    --bg:           #f7f8fc;
    --surface:      #ffffff;
    --surface-dim:  #f1f3f9;
    --surface-high: #ffffff;
    --border:       #e2e8f0;
    --border-soft:  rgba(15, 23, 42, 0.06);
    --text:         #0f172a;
    --text-2:       #475569;
    --text-3:       #94a3b8;
    --input-bg:     #ffffff;
    --input-border: #cbd5e1;

    --sh-xs:  0 1px 2px rgba(0,0,0,0.06);
    --sh-sm:  0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --sh:     0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --sh-md:  0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.04);
    --sh-lg:  0 25px 50px -12px rgba(0,0,0,0.12);
    --sh-overlay: 0 0 0 1px rgba(0,0,0,0.05), var(--sh-lg);

    --header-bg: hsla(225, 25%, 98%, 0.88);
    --blur:      blur(20px) saturate(180%);

    /* Modal specific — Light Mode (Frost) */
    --modal-bg:     rgba(255, 255, 255, 0.75);
    --modal-border: rgba(15, 23, 42, 0.08); /* Subtle grey definition */
    --modal-glow:   inset 0 1px 0 rgba(255,255,255,0.4);
    --modal-overlay-bg: rgba(15, 23, 42, 0.35);

    /* ── Legacy aliases (keep old var names resolving) ────────────────── */
    --primary:     var(--blue);
    --success:     var(--green);
    --error:       var(--red);
    --warning:     var(--amber);
    --info:        var(--cyan);
    --text-muted:  var(--text-2);
    --card:        var(--surface);
    --shadow:      var(--sh);
    --shadow-sm:   var(--sh-sm);
    --shadow-md:   var(--sh-md);
    --shadow-lg:   var(--sh-lg);
    --radius-md:   var(--r-md);
    --radius-sm:   var(--r-sm);
    --radius-lg:   var(--r-lg);
    --primary-glow: var(--blue-glow);
    --primary-light: var(--blue-tint);
}

/* ── DARK ──────────────────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg:           #0c0f18;
    --surface:      #131722;
    --surface-dim:  #0f1219;
    --surface-high: #1a1f2e;
    --border:       rgba(255, 255, 255, 0.07);
    --border-soft:  rgba(255, 255, 255, 0.04);
    --text:         #e8edf8;
    --text-2:       #8b9ab5;
    --text-3:       #4a566e;
    --input-bg:     rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.10);

    --sh-xs:  0 1px 2px rgba(0,0,0,0.3);
    --sh-sm:  0 1px 4px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.2);
    --sh:     0 4px 16px rgba(0,0,0,0.40), 0 2px 6px rgba(0,0,0,0.2);
    --sh-md:  0 8px 28px rgba(0,0,0,0.48), 0 3px 10px rgba(0,0,0,0.25);
    --sh-lg:  0 20px 52px rgba(0,0,0,0.55), 0 8px 22px rgba(0,0,0,0.3);
    --sh-overlay: 0 32px 80px rgba(0,0,0,0.65), 0 12px 32px rgba(0,0,0,0.4);

    --header-bg: rgba(12, 15, 24, 0.88);
    --blur:      blur(16px) saturate(180%);

    /* Modal specific — Dark Mode (Deep Indigo) */
    --modal-bg:     rgba(19, 23, 34, 0.72);
    --modal-border: rgba(255, 255, 255, 0.12); /* Brighter edge */
    --modal-glow:   inset 0 1px 0 rgba(255, 255, 255, 0.15);
    --modal-overlay-bg: rgba(0, 0, 0, 0.45);

    /* ── Legacy aliases ───────────────────────────────────────────────── */
    --primary:     var(--blue);
    --success:     var(--green);
    --error:       var(--red);
    --warning:     var(--amber);
    --info:        var(--cyan);
    --text-muted:  var(--text-2);
    --card:        var(--surface);
    --shadow:      var(--sh);
    --shadow-sm:   var(--sh-sm);
    --shadow-md:   var(--sh-md);
    --shadow-lg:   var(--sh-lg);
    --radius-md:   var(--r-md);
    --radius-sm:   var(--r-sm);
    --radius-lg:   var(--r-lg);
    --primary-glow: var(--blue-glow);
    --primary-light: var(--blue-tint);
}

/* =====================================================================
   RESET & BASE
===================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    font-size: 15px;
}

/* Subtle top gradient accent — thin, tasteful */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    z-index: 1000;
    opacity: 0.6;
}

/* =====================================================================
   LAYOUT
===================================================================== */
.app-container {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 20px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    position: relative;
}

/* =====================================================================
   HEADER — sticky, frosted
===================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    margin-bottom: 28px;
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--header-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    /* Compensate for app-container padding */
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px;
}

.logo-container img {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* =====================================================================
   SURFACE / CARD
   No blur on content cards — Stripe uses flat white cards
===================================================================== */
.glass {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass:hover {
    box-shadow: var(--sh);
    border-color: rgba(37, 99, 235, 0.18);
}

/* =====================================================================
   TYPOGRAPHY HELPERS
===================================================================== */
.label-upper {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 6px;
}

/* =====================================================================
   BUTTONS
===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    min-height: 40px;
    border: none;
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: var(--t);
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
}

/* Primary — solid blue, Stripe-style */
.btn-primary {
    background: var(--blue);
    color: #ffffff;
    box-shadow: var(--sh-xs), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover {
    background: var(--blue-hover);
    box-shadow: var(--sh-sm), 0 0 0 3px var(--blue-glow);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--sh-xs);
}

/* Ghost — minimal, secondary action */
.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: var(--surface-dim);
    color: var(--text);
    border-color: var(--input-border);
}
.btn-ghost:active { background: var(--surface-dim); }

/* Danger */
.btn-danger {
    background: var(--red);
    color: #ffffff;
    box-shadow: var(--sh-xs);
}
.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: var(--sh-sm);
}

/* Success — green, used for Zaključi servis and positive confirmations */
.btn-success {
    background: var(--green);
    color: #ffffff;
    box-shadow: var(--sh-xs), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-success:hover {
    background: hsl(142, 69%, 32%);
    transform: translateY(-1px);
    box-shadow: var(--sh-sm), 0 0 0 3px hsla(142, 69%, 38%, 0.2);
}
.btn-success:active {
    transform: translateY(0);
    box-shadow: var(--sh-xs);
}

/* Small size modifier */
.btn-sm {
    padding: 7px 14px;
    min-height: 34px;
    font-size: 0.82rem;
}

.back-btn { margin-bottom: 20px; margin-top: 8px; }

/* Split item */
.btn-split-item {
    padding: 0 !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: var(--blue-tint) !important;
    border: 1px solid rgba(37,99,235,0.18) !important;
    color: var(--blue) !important;
    margin-left: 4px;
    flex-shrink: 0;
}
.btn-split-item:hover {
    background: var(--blue) !important;
    color: #fff !important;
    border-color: var(--blue) !important;
    transform: scale(1.1) !important;
}
.btn-split-item svg { flex-shrink: 0; pointer-events: none; }

/* =====================================================================
   FORMS
===================================================================== */
.form-group { margin-bottom: 16px; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-2);
}

input, select, textarea {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--t);
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-right: 36px;
    cursor: pointer;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow);
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.divider-or {
    position: relative;
    text-align: center;
    margin: 20px 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-3);
}
.divider-or::before, .divider-or::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 24px);
    height: 1px;
    background: var(--border);
}
.divider-or::before { left: 0; }
.divider-or::after  { right: 0; }

/* =====================================================================
   DASHBOARD CARDS (MODERN)
===================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 8px 0;
}

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--t);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.dash-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--blue-tint);
    opacity: 0;
    transition: var(--t);
}

.dash-card:hover {
    transform: translateY(-4px);
    border-color: var(--blue-light);
    box-shadow: var(--sh-md);
}

.dash-card:hover::before { opacity: 1; }

.dash-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, currentColor, transparent 92%);
    margin-bottom: 4px;
    transition: var(--t);
}

.dash-card:hover .dash-icon {
    transform: scale(1.1);
    background: color-mix(in srgb, currentColor, transparent 85%);
}

.dash-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0;
}
.dash-card p {
    font-size: 0.8rem;
    color: var(--text-2);
    line-height: 1.45;
    margin: 0;
}

/* =====================================================================
   LOGIN
===================================================================== */
.login-page-wrap {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: 
        radial-gradient(at 0% 0%, hsla(225, 73%, 57%, 0.08) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(188, 86%, 37%, 0.05) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(260, 73%, 57%, 0.05) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(142, 69%, 38%, 0.05) 0, transparent 50%),
        var(--bg);
    position: relative;
    overflow: hidden;
}

.login-page-wrap::after {
    content: '';
    position: absolute;
    top: -10%; left: -10%; right: -10%; bottom: -10%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
}

.login-card-wrap {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    display: block;
    height: 64px;
    margin: 0 auto 28px;
    object-fit: contain;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-2);
    margin-bottom: 28px;
}

.login-bg-glow {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, hsla(225, 73%, 57%, 0.12) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.login-card {
    text-align: left;
    padding: 40px !important;
    border-radius: var(--r-xl) !important;
    box-shadow: var(--sh-md), 0 0 0 1px rgba(255,255,255,0.4) inset !important;
}

/* =====================================================================
   WIZARD
===================================================================== */
.wizard-header { margin-bottom: 24px; }

.wizard-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 12px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}

.step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-3);
    transition: var(--t);
    flex-shrink: 0;
}
.step-item.active .step-circle {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    box-shadow: 0 0 0 4px var(--blue-glow);
}
.step-item.completed .step-circle {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.step-label {
    font-size: 0.67rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--t);
}
.step-item.active .step-label,
.step-item.completed .step-label { color: var(--text); }

.step-connector {
    flex: 1;
    height: 1.5px;
    background: var(--border);
    margin: 0 6px;
    margin-top: 17px;
    border-radius: 2px;
    transition: background 0.3s ease;
}
.step-connector.active   { background: var(--blue); }
.step-connector.completed { background: var(--green); }

.wizard-card {
    padding: 28px;
    margin-bottom: 14px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    letter-spacing: -0.01em;
}
.section-title svg { opacity: 0.45; flex-shrink: 0; }

.customer-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    border-radius: var(--r-pill);
    background: var(--blue-tint);
    border: 1px solid rgba(37,99,235,0.2);
    color: var(--blue);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 10px;
}

.selected-customer-badge {
    padding: 11px 14px;
    border-radius: var(--r-md);
    background: var(--green-tint);
    border: 1px solid var(--green-border);
    color: var(--green);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
}

/* =====================================================================
   ORDER ITEM CARDS
===================================================================== */
.order-item-card {
    background: var(--surface-dim);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: var(--t-fast);
}
.order-item-card .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 8px;
}

.item-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.badge-IDA             { background: var(--blue-tint);  color: var(--blue); }
.badge-Maska           { background: rgba(124, 58, 237, 0.08); color: #7c3aed; }
.badge-Tlačna          { background: var(--cyan-tint);  color: var(--cyan); }
.badge-Tlačna-posoda   { background: var(--cyan-tint);  color: var(--cyan); }
.badge-Pljučni-avtomat { background: var(--amber-tint); color: var(--amber); }

/* =====================================================================
   SERVICE CHECKBOXES
===================================================================== */
.services-label {
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 10px;
    margin-top: 14px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 7px;
}

.service-checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: var(--t-fast);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    min-height: 42px;
    user-select: none;
}
.service-checkbox-label:hover {
    border-color: var(--blue);
    background: var(--blue-tint);
}
.service-checkbox-label.checked {
    background: var(--blue-tint);
    border-color: var(--blue);
}

/* Status variants */
.service-checkbox-label.service-status-pending {
    border: 1.5px solid var(--amber) !important;
    background: var(--amber-tint) !important;
}
.service-checkbox-label.service-status-pending .service-text {
    font-weight: 700;
    color: var(--amber);
}
.service-checkbox-label.service-status-done {
    border: 1.5px solid var(--green) !important;
    background: var(--green-tint) !important;
}
.service-checkbox-label.service-status-done .service-text {
    font-weight: 700;
    color: var(--green);
}
.service-checkbox-label.service-status-done .checkmark {
    background: var(--green);
    border-color: var(--green);
}
.service-checkbox-label.exclusive-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.service-checkbox-label .checkmark {
    width: 17px;
    height: 17px;
    min-width: 17px;
    border: 1.5px solid var(--input-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t-fast);
    background: var(--input-bg);
    flex-shrink: 0;
}
.service-checkbox-label.checked .checkmark {
    background: var(--blue);
    border-color: var(--blue);
}
.service-checkbox-label.checked .checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}
.service-checkbox-label input[type="checkbox"] { display: none; }

.service-text {
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 500;
    color: var(--text);
}

.service-count {
    background: var(--surface-dim);
    border: 1px solid var(--border);
    padding: 1px 8px;
    border-radius: var(--r-pill);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-3);
    transition: var(--t-fast);
    flex-shrink: 0;
    margin-left: auto;
}
.service-count.all-checked {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* =====================================================================
   SIGNATURE PAD
===================================================================== */
.sig-wrap { margin-top: 4px; }

.signature-container {
    background: #fff;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--input-border);
    transition: border-color 0.2s ease;
}
.signature-container:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow);
}

canvas.signature-pad {
    width: 100%;
    height: 130px;
    cursor: crosshair;
    display: block;
    touch-action: none;
}

.sig-preview {
    width: 100%;
    height: 110px;
    object-fit: contain;
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: #fff;
}

.sig-redo-btn { font-size: 0.75rem; margin-top: 6px; }

/* =====================================================================
   SEARCH DROPDOWN
===================================================================== */
.search-dropdown { position: relative; }

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 300;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    box-shadow: var(--sh-lg);
    border-radius: var(--r-md);
}

.search-item {
    padding: 10px 13px;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}
.search-item:hover { background: var(--blue); color: #fff; }

/* =====================================================================
   LIST CARDS — nalog, prevzem, archive
===================================================================== */
.nalog-card {
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: var(--t);
    border-radius: var(--r-lg);
}
.nalog-card:hover {
    box-shadow: var(--sh-md);
    border-color: rgba(37,99,235,0.2);
    transform: translateX(2px);
}
.nalog-card:active { transform: translateX(0); }

.nalog-card-left h4 {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
    color: var(--text);
}
.nalog-card-left p {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.4;
    margin: 0;
}

.nalog-badge {
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.badge-open     { background: var(--amber-tint);  color: var(--amber);  border: 1px solid var(--amber-border); }
.badge-finished { background: var(--green-tint);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-prevzet  { background: var(--cyan-tint);   color: var(--cyan); }

/* =====================================================================
   AUTO-SAVE INDICATOR
===================================================================== */
.autosave-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px;
    border-radius: var(--r-pill);
    font-size: 0.74rem;
    font-weight: 600;
    background: var(--green-tint);
    color: var(--green);
    border: 1px solid var(--green-border);
    animation: fadeIn 0.25s ease;
}
.autosave-indicator.saving {
    background: var(--amber-tint);
    color: var(--amber);
    border-color: var(--amber-border);
}

/* =====================================================================
   ITEM DETAIL
===================================================================== */
.detail-item-card {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--surface-dim);
    transition: var(--t-fast);
}
.detail-item-card:hover { border-color: rgba(37,99,235,0.2); }

.sub-sn-input { max-width: 160px; }

.detail-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

/* =====================================================================
   ADMIN TABS
===================================================================== */
.admin-tabs-bar {
    display: flex;
    overflow-x: auto;
    margin-bottom: 14px;
    padding: 4px;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: var(--r-lg);
    background: var(--surface-dim);
    border: 1px solid var(--border);
}
.admin-tabs-bar::-webkit-scrollbar { display: none; }

.admin-tab {
    flex: 1;
    min-width: 90px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-2);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--t-fast);
    border-radius: var(--r-md);
    white-space: nowrap;
    font-family: inherit;
}
@media (max-width: 640px) {
    .admin-tab { flex: 0 0 auto; min-width: 100px; font-size: 0.78rem; }
}
.admin-tab:hover { color: var(--text); background: var(--surface); }
.admin-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--sh-xs);
}

.admin-panel { animation: fadeIn 0.25s ease; }

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border-soft);
    transition: var(--t-fast);
    gap: 12px;
}
@media (max-width: 500px) {
    .admin-item { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 4px; }
    .admin-item > div:last-child { width: 100%; justify-content: flex-end; }
}
.admin-item:last-child { border-bottom: none; }
.admin-item:hover { background: var(--surface-dim); border-radius: var(--r-sm); padding: 12px 8px; margin: 0 -4px; }

/* =====================================================================
   CENIK TABLE
===================================================================== */
.cenik-table { width: 100%; border-collapse: collapse; }
.cenik-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    border-bottom: 1.5px solid var(--border);
}
.cenik-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.88rem;
    color: var(--text);
}
.cenik-table tr:last-child td { border-bottom: none; }
.cenik-group-header td {
    font-weight: 700;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 14px;
    color: var(--blue);
    background: var(--blue-tint);
}

.price-input {
    width: 100px !important;
    text-align: right;
    padding: 6px 10px !important;
    font-weight: 600;
}

/* =====================================================================
   TOAST
===================================================================== */
#toast-container {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom));
    right: 16px;
    z-index: 4000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}

.toast {
    pointer-events: auto;
    min-width: 260px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.865rem;
    font-weight: 500;
    animation: toastIn 0.32s var(--ease-out);
    box-shadow: var(--sh-overlay);
    background: var(--surface-high);
    border: 1px solid var(--border);
}
.toast.removing { animation: toastOut 0.24s ease forwards; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--blue); }
.toast-warning { border-left: 3px solid var(--amber); }

@keyframes toastIn  { from { opacity:0; transform:translateY(12px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toastOut { to   { opacity:0; transform:translateY(6px)  scale(0.96); } }

/* =====================================================================
   LOADER
===================================================================== */
.animate-spin { animation: spin 0.85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   VIEWS
===================================================================== */
.view { display: none; }
.view.active {
    display: block;
    animation: fadeIn 0.28s var(--ease-out);
}

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

/* =====================================================================
   EMPTY STATE
===================================================================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-3);
    font-size: 0.875rem;
}

/* =====================================================================
   SHIMMER
===================================================================== */
.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: var(--r-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* =====================================================================
   UTILITY CLASSES — compatibility & helpers
===================================================================== */

/* Glass-styled textarea/input (used in side drawer) */
.glass-input {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--t);
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
    -webkit-appearance: none;
    appearance: none;
}
.glass-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow);
}

/* Glass-sub: lighter card inside a card (piece manager rows) */
.glass-sub {
    background: var(--surface-dim);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}

/* Button size variants */
.btn-sm  { padding: 6px 12px; min-height: 32px; font-size: 0.8rem; }
.btn-xs  { padding: 4px 8px;  min-height: 28px; font-size: 0.75rem; border-radius: var(--r-xs); }

/* =====================================================================
   SCROLLBARS — invisible but functional
===================================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* =====================================================================
   PIECE MANAGER
===================================================================== */
.piece-manager-container { display: flex; flex-direction: column; gap: 12px; }

.bulk-actions-toolbar {
    padding: 12px 16px;
    background: var(--blue-tint);
    border: 1px solid rgba(37,99,235,0.18);
    border-radius: var(--r-md);
}

.piece-row {
    padding: 13px 15px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    transition: var(--t-fast);
    background: var(--surface-dim);
}
.piece-row:hover { border-color: var(--blue); }

.piece-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.piece-index {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.piece-sn-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--input-border);
    border-radius: var(--r-xs);
    padding: 6px 10px;
    font-size: 0.875rem;
}

.piece-services { display: flex; flex-wrap: wrap; gap: 5px; }

.svc-mini-btn {
    padding: 4px 10px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--t-fast);
    color: var(--text-2);
}
.svc-mini-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
.svc-mini-btn.suggested:not(.active) {
    background: var(--surface-high);
    border-color: var(--blue);
    color: var(--blue);
    border-style: dashed;
}
.svc-mini-btn.locked {
    cursor: default;
    opacity: 0.7;
}
.svc-mini-btn.active.locked {
    background: var(--text-3);
    border-color: var(--text-3);
}

/* =====================================================================
   ITEM GROUP CARD
===================================================================== */
.item-group-card {
    padding: 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: var(--t);
    background: var(--surface-dim);
}
.item-group-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--sh-md);
    border-color: rgba(37,99,235,0.22);
}

.progress-pill {
    padding: 2px 10px;
    background: var(--blue-tint);
    color: var(--blue);
    border-radius: var(--r-pill);
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid rgba(37,99,235,0.18);
}

.order-meta {
    padding: 12px 14px;
    border-radius: var(--r-md);
    margin-bottom: 18px;
    border: 1px solid var(--border);
    background: var(--surface-dim);
}
.order-meta span {
    font-size: 0.79rem;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-2);
}

/* =====================================================================
   SUBITEMS TABLE
===================================================================== */
.subitems-service-col {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}
.subitems-service-col .service-checkbox-label {
    width: auto;
    justify-content: flex-start;
    padding: 4px 10px;
    min-height: 34px;
    font-size: 0.75rem;
    margin: 0;
}

.subitems-table th {
    color: var(--text-3);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    padding: 7px 10px;
}
.subitems-table td {
    border-bottom: 1px solid var(--border-soft);
    padding: 7px 10px;
    font-size: 0.865rem;
}

.sub-sn-input {
    border: 1px solid var(--input-border);
    border-radius: var(--r-xs) !important;
    background: var(--input-bg);
    max-width: 160px;
}
.sub-sn-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px var(--blue-glow) !important;
}

/* =====================================================================
   MINI SVC ICONS
===================================================================== */
.mini-svc {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.63rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--t-fast);
    background: var(--input-bg);
    color: var(--text-3);
}
.mini-svc:hover { border-color: var(--blue); color: var(--blue); }
.mini-svc.active { background: var(--green); border-color: var(--green); color: #fff; }

/* =====================================================================
   SIDE DRAWER
===================================================================== */
.side-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--t-slow);
    display: flex;
    justify-content: flex-end;
}
.side-drawer-overlay.active { opacity: 1; visibility: visible; }

.side-drawer-content {
    width: 100%;
    max-width: 560px;
    height: 100%;
    background: var(--surface);
    box-shadow: var(--sh-overlay);
    transform: translateX(100%);
    transition: transform 0.3s var(--ease);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}
.side-drawer-overlay.active .side-drawer-content { transform: translateX(0); }

.side-drawer-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.side-drawer-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.side-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
}
.side-drawer-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    background: var(--surface);
}

/* =====================================================================
   MATERIAL & PIECE CARDS (FAANG Aesthetic)
===================================================================== */
.material-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.material-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--surface-high);
    border: 1px solid var(--border-soft);
    box-shadow: var(--sh-xs);
    transition: var(--t);
    position: relative;
    overflow: hidden;
}

.material-card:hover {
    box-shadow: var(--sh-sm);
    transform: translateY(-1px);
    border-color: var(--border);
}

.material-card-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.material-card-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.material-card-meta {
    font-size: 0.75rem;
    color: var(--text-3);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.material-card-qty-badge {
    background: var(--surface-dim);
    color: var(--text-2);
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--t);
    border: 1px solid transparent;
}

.status-pill.ordered {
    background: var(--amber-tint);
    color: var(--amber);
}

.status-pill.replaced {
    background: var(--green-tint);
    color: var(--green);
}

.status-pill:hover {
    filter: brightness(0.95);
    transform: scale(1.02);
}

.status-pill.locked {
    cursor: default;
    opacity: 0.8;
}
.status-pill.locked:hover { transform: none; }

.material-actions {
    display: flex;
    gap: 4px;
    margin-left: 12px;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-xs);
    color: var(--text-3);
    border: 1px solid transparent;
}

.btn-icon-sm:hover {
    background: var(--red-tint);
    color: var(--red);
    border-color: var(--red-tint);
}

/* =====================================================================
   SAFE AREA
===================================================================== */
@supports (padding: max(0px)) {
    .app-container {
        padding-left:  max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

/* =====================================================================
   RESPONSIVE — TABLET ≤768px
===================================================================== */
@media (max-width: 768px) {
    .form-row-3 { grid-template-columns: 1fr 1fr; }
    .wizard-card { padding: 20px; }

    header {
        margin-left: -16px;
        margin-right: -16px;
        padding: 0 16px;
    }
    .app-container { padding-left: 16px; padding-right: 16px; }
}

/* =====================================================================
   RESPONSIVE — MOBILE ≤640px
===================================================================== */
@media (max-width: 640px) {
    body { font-size: 14px; }

    .app-container { padding-left: 12px; padding-right: 12px; }
    header { margin-left: -12px; margin-right: -12px; padding: 0 12px; height: 54px; }

    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .dashboard-grid .dash-card { grid-column: span 1 !important; }
    #admin-card              { grid-column: span 2 !important; }
    #pwa-install-container   { grid-column: span 2 !important; }

    .wizard-card { padding: 14px; }
    .step-label  { display: none; }
    .step-connector { margin-top: 16px; }
    .step-circle { width: 30px; height: 30px; font-size: 0.8rem; }

    .services-grid { grid-template-columns: 1fr 1fr; }
    canvas.signature-pad { height: 110px; }

    #toast-container { left: 10px; right: 10px; bottom: max(12px, env(safe-area-inset-bottom)); }
    .toast { min-width: auto; font-size: 0.82rem; }

    /* Prevent iOS font zoom on input focus */
    input, select, textarea { font-size: 16px; }

    .dash-card { padding: 16px 14px; }
    .dash-icon { width: 38px; height: 38px; }
    .dash-card h3 { font-size: 0.88rem; }
    .dash-card p  { font-size: 0.74rem; }
}

/* =====================================================================
   RESPONSIVE — SMALL MOBILE ≤400px
===================================================================== */
@media (max-width: 400px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid .dash-card { grid-column: span 1 !important; }
    #admin-card, #pwa-install-container { grid-column: span 1 !important; }
    .services-grid { grid-template-columns: 1fr; }
    .price-input { width: 80px !important; }
}

/* =====================================================================
   PRINT
===================================================================== */
@media print {
    header, .btn, #loader, #admin-modal, #toast-container { display: none !important; }
    body { background: #fff; color: #000; }
    .glass { border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; }
}

/* =====================================================================
   SERVICE SELECTION UI (Pills/Toggles)
===================================================================== */
.services-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: 10px;
}

.services-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-checkbox-label {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--surface-dim);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.service-checkbox-label:hover {
    background: var(--surface-high);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.service-checkbox-label.checked {
    background: var(--blue-tint);
    border-color: var(--blue);
    color: var(--blue);
    box-shadow: 0 2px 4px rgba(37,99,235,0.1);
}

.service-checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Hide the old checkmark span if it exists in templates */
.service-checkbox-label .checkmark {
    display: none;
}

/* Service tag in cards */
.service-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--surface-high);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-weight: 600;
}

/* =====================================================================
   MODAL — FAANG Glassmorphism Redesign
===================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay-bg);
    backdrop-filter: blur(12px) saturate(160%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.modal-overlay.active { 
    display: flex; 
    opacity: 1;
}

.modal-box {
    width: 100%;
    max-width: 480px;
    background: var(--modal-bg);
    backdrop-filter: blur(34px) saturate(200%);
    border-radius: var(--r-xl);
    border: 1px solid var(--modal-border);
    box-shadow: 
        var(--sh-overlay),
        var(--modal-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92) translateY(10px);
    transition: transform 0.4s var(--ease);
}
.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 28px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--blue-tint);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px var(--blue-glow);
}
.modal-icon-wrap svg { width: 20px; height: 20px; }

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.05);
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--t);
}
.modal-close-btn:hover {
    background: var(--red-tint);
    color: var(--red);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0 28px 28px;
    font-size: 0.95rem;
    color: var(--text-2);
}

.modal-footer {
    padding: 20px 28px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =====================================================================
   ADMIN TABS & PANELS
===================================================================== */
.admin-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.admin-tabs-bar {
    display: flex;
    flex-direction: column;
    width: 280px;
    min-width: 280px;
    padding: 8px;
    background: var(--surface-dim);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 20px;
}

.admin-content {
    flex: 1;
    min-width: 0;
}

.admin-tab {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 20px;
    border-radius: var(--r-md);
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-tab i {
    opacity: 0.5;
    transition: inherit;
    width: 18px;
}

.admin-tab:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.admin-tab.active {
    background: var(--surface);
    color: var(--blue);
    box-shadow: var(--sh-sm);
}

.admin-tab.active i {
    opacity: 1;
    color: var(--blue);
}

@media (max-width: 1024px) {
    .admin-tabs-bar {
        width: 220px;
        min-width: 220px;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
        gap: 20px;
    }
    .admin-tabs-bar {
        width: 100%;
        min-width: 0;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        border-radius: var(--r-md);
        position: static;
        padding: 5px;
        scrollbar-width: none;
    }
    .admin-tabs-bar::-webkit-scrollbar { display: none; }
    .admin-tab {
        width: auto;
        padding: 10px 18px;
        border-radius: 100px;
    }
}

.admin-panel {
    animation: slideUp 0.3s ease-out;
}

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

.admin-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    margin-bottom: 12px;
    transition: var(--t);
}
.admin-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--sh-sm);
}

/* =====================================================================
   STATS & DASHBOARD (FAANG-STYLE)
===================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 24px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    background: var(--blue-tint);
    border-radius: 50%;
    opacity: 0.5;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--blue);
    line-height: 1;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
}

.chart-container {
    padding: 24px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

/* Leaderboard tables */
.leaderboard-container {
    margin-top: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.lb-row {
    display: grid;
    grid-template-columns: 40px 1fr 100px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.lb-row:last-child { border-bottom: none; }

.lb-rank {
    font-weight: 800;
    color: var(--text-3);
    font-size: 0.85rem;
}

.lb-row:nth-child(1) .lb-rank { color: #f59e0b; } /* Gold */
.lb-row:nth-child(2) .lb-rank { color: #94a3b8; } /* Silver */
.lb-row:nth-child(3) .lb-rank { color: #b45309; } /* Bronze */

.lb-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.lb-value {
    text-align: right;
    font-weight: 700;
    color: var(--blue);
}

/* Audit Log Table */
.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.audit-table th, .audit-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}

.audit-table th {
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    font-size: 0.7rem;
}

.audit-action-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
}

/* =====================================================================
   STATUS PILL — NEW 4-STATE (A)
===================================================================== */
.status-pill-zamenjano { background: #10b98120; color: #10b981; border: 1px solid #10b98140; cursor: default; }
.status-pill-narociti  { background: #ef444420; color: #ef4444; border: 1px solid #ef444440; cursor: default; }
.status-pill-naroceno  { background: #f59e0b20; color: #f59e0b; border: 1px solid #f59e0b40; cursor: default; }
.status-pill-prislo    { background: #10b98120; color: #10b981; border: 1px solid #10b98140; cursor: default; animation: pulseGreen 1.8s ease-in-out infinite; }

@keyframes pulseGreen {
    0%,100% { box-shadow: 0 0 0 0 #10b98130; }
    50%      { box-shadow: 0 0 0 6px #10b98100; }
}

/* Kataloška oznaka */
.material-kataloska {
    font-size: 0.7rem;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: monospace;
}

/* =====================================================================
   NALOG EXPIRY INDICATORS (B)
===================================================================== */
.nalog-card--warning { border-left: 3px solid #f59e0b !important; }
.nalog-card--danger  { border-left: 3px solid #ef4444 !important; }

.age-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.age-warning { background: #f59e0b20; color: #f59e0b; border: 1px solid #f59e0b40; }
.age-danger  { background: #ef444420; color: #ef4444; border: 1px solid #ef444440; animation: pulseDanger 1.6s ease-in-out infinite; }

@keyframes pulseDanger {
    0%,100% { box-shadow: 0 0 0 0 #ef444425; }
    60%      { box-shadow: 0 0 0 5px #ef444400; }
}

/* =====================================================================
   MATERIAL INDICATOR PILLS (A) — nalog card
===================================================================== */
.mat-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.67rem;
    font-weight: 700;
}
.mat-narociti { background: #ef444418; color: #ef4444; border: 1px solid #ef444435; }
.mat-naroceno { background: #f59e0b18; color: #f59e0b; border: 1px solid #f59e0b35; }
.mat-prislo   { background: #10b98118; color: #10b981; border: 1px solid #10b98135; animation: pulseGreen 2s ease-in-out infinite; }

/* =====================================================================
   MATERIAL ARRIVED BANNER (A)
===================================================================== */
.material-arrived-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, #10b98118, #34d39918);
    border: 1px solid #10b98135;
    color: #10b981;
    animation: pulseGreen 2s ease-in-out infinite;
}

/* =====================================================================
   SEGMENTED TOGGLE (A — material modal)
===================================================================== */
.seg-toggle {
    display: flex;
    background: var(--surface-dim);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 4px;
    gap: 4px;
}
.seg-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    border: none;
    border-radius: calc(var(--r-md) - 2px);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-3);
    background: transparent;
    transition: all 0.2s var(--ease);
}
.seg-btn:hover { background: var(--surface-high); color: var(--text); }
.seg-btn.active {
    background: var(--surface);
    color: var(--blue);
    box-shadow: var(--sh-sm);
    border: 1px solid rgba(37,99,235,0.18);
}

/* =====================================================================
   COMMENTS SECTION (E)
===================================================================== */
.comment-input-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.comment-input-row textarea {
    min-height: 60px !important;
}

.comment-bubble {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    animation: fadeIn 0.2s var(--ease-out);
}
.comment-mine { flex-direction: row-reverse; }
.comment-mine .comment-body { align-items: flex-end; }

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 80%;
}

.comment-meta {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.comment-body > div:last-child {
    padding: 8px 12px;
    border-radius: var(--r-md);
    background: var(--surface-high);
    border: 1px solid var(--border-soft);
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
}
.comment-mine > .comment-body > div:last-child {
    background: var(--blue-tint);
    border-color: rgba(37,99,235,0.2);
    color: var(--text);
}

.comment-count-badge {
    background: var(--blue);
    color: #fff;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 7px;
    display: inline-flex;
    align-items: center;
}

/* =====================================================================
   MATERIAL ORDERS PAGE (A — MaterialOrders.js)
===================================================================== */
.mat-orders-container {
    padding-bottom: 40px;
}

.mat-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.mat-kpi {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--r-pill);
    font-size: 0.8rem;
    font-weight: 700;
}
.mat-kpi-red   { background: #ef444418; color: #ef4444; border: 1px solid #ef444430; }
.mat-kpi-amber { background: #f59e0b18; color: #f59e0b; border: 1px solid #f59e0b30; }

.mat-group { display: flex; flex-direction: column; background: var(--surface-card, var(--surface)); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.mat-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-dim);
}
.mat-group-title--narociti { color: #ef4444; }
.mat-group-title--naroceno { color: #f59e0b; }
.mat-group-count {
    margin-left: auto;
    background: currentColor;
    color: #fff;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
}

.mat-table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-md) var(--r-md); }
.mat-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 640px;
}
.mat-orders-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 1;
}
.mat-orders-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
    font-size: 0.85rem;
}
.mat-orders-table tbody tr:hover { background: var(--surface-high); }

.nalog-ref {
    color: var(--blue);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
}
.nalog-ref:hover { text-decoration: underline; }

.mat-naziv-cell { max-width: 200px; }

.kataloska-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    background: var(--surface-dim);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-soft);
    color: var(--text-2);
}

.mat-action-btn {
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.mat-action-naroči { background: #f59e0b20; color: #f59e0b; border: 1px solid #f59e0b40; border-radius: var(--r-sm); padding: 4px 10px; font-size: 0.72rem; font-weight: 700; cursor: pointer; transition: var(--t); }
.mat-action-naroči:hover { background: #f59e0b30; }
.mat-action-prislo { background: #10b98120; color: #10b981; border: 1px solid #10b98140; border-radius: var(--r-sm); padding: 4px 10px; font-size: 0.72rem; font-weight: 700; cursor: pointer; transition: var(--t); }
.mat-action-prislo:hover { background: #10b98130; }

/* =====================================================================
   DASHBOARD BADGE (A)
===================================================================== */
.dash-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: #fff;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    min-width: 22px;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 8px #ef444440;
    animation: pulseDanger 1.8s ease-in-out infinite;
}

/* =====================================================================
   PAGE HEADER (shared)
===================================================================== */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-3);
}

/* label-upper utility */
.label-upper {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    display: block;
    margin-bottom: 8px;
}

/* =====================================================================
   RESPONSIVE fixes for new elements
===================================================================== */
@media (max-width: 640px) {
    #material-orders-card { grid-column: span 1 !important; }
    .mat-orders-header { flex-direction: column; align-items: flex-start; }
    .mat-orders-table { font-size: 0.78rem; }
    .mat-orders-table th, .mat-orders-table td { padding: 7px 8px; }
    .comment-body { max-width: 90%; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* =====================================================================
   MATERIAL CARD — FAANG REDESIGN
   Structure: left color stripe | icon | name + meta | footer: status badge + CTA
===================================================================== */

/* Color tokens per status */
:root {
    --mat-zamenjano-color: #10b981;
    --mat-zamenjano-bg:    #10b98115;
    --mat-zamenjano-border:#10b98130;

    --mat-narociti-color:  #ef4444;
    --mat-narociti-bg:     #ef444412;
    --mat-narociti-border: #ef444430;

    --mat-naroceno-color:  #f59e0b;
    --mat-naroceno-bg:     #f59e0b12;
    --mat-naroceno-border: #f59e0b30;

    --mat-prislo-color:    #10b981;
    --mat-prislo-bg:       #10b98115;
    --mat-prislo-border:   #10b98130;
}

/* Empty state */
.mat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 36px 20px;
    color: var(--text-3);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Grid wrapper */
.mat-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

/* Base card */
.mat-card {
    display: flex;
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
    background: var(--surface-high);
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
    position: relative;
}
.mat-card:hover {
    box-shadow: var(--sh-md);
    transform: translateY(-1px);
}

/* Left color stripe */
.mat-card-stripe {
    width: 4px;
    flex-shrink: 0;
    border-radius: 0;
}
.mat-card-zamenjano .mat-card-stripe { background: var(--mat-zamenjano-color); }
.mat-card-narociti  .mat-card-stripe { background: var(--mat-narociti-color); }
.mat-card-naroceno  .mat-card-stripe { background: var(--mat-naroceno-color); }
.mat-card-prislo    .mat-card-stripe { background: var(--mat-prislo-color); animation: pulseGreen 2s ease-in-out infinite; }

/* Card body */
.mat-card-body {
    flex: 1;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* Top row: icon + info + menu */
.mat-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* Status icon circle */
.mat-card-status-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mat-si-zamenjano { background: var(--mat-zamenjano-bg); color: var(--mat-zamenjano-color); border: 1px solid var(--mat-zamenjano-border); }
.mat-si-narociti  { background: var(--mat-narociti-bg);  color: var(--mat-narociti-color);  border: 1px solid var(--mat-narociti-border); }
.mat-si-naroceno  { background: var(--mat-naroceno-bg);  color: var(--mat-naroceno-color);  border: 1px solid var(--mat-naroceno-border); }
.mat-si-prislo    { background: var(--mat-prislo-bg);    color: var(--mat-prislo-color);    border: 1px solid var(--mat-prislo-border); }

/* Name + chips */
.mat-card-info {
    flex: 1;
    min-width: 0;
}
.mat-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    margin-bottom: 5px;
}
.mat-card-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

/* Chip variants */
.mat-qty-chip,
.mat-kat-chip,
.mat-price-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
}
.mat-qty-chip {
    background: var(--surface-dim);
    color: var(--text-2);
    border: 1px solid var(--border-soft);
}
.mat-kat-chip {
    background: transparent;
    color: var(--text-3);
    border: 1px dashed var(--border);
    font-family: monospace;
    font-size: 0.67rem;
}
.mat-price-chip {
    background: transparent;
    color: var(--text-3);
    border: 1px solid var(--border-soft);
}

/* Edit / delete hover menu (top-right) */
.mat-card-menu {
    display: flex;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.mat-card:hover .mat-card-menu { opacity: 1; }

.mat-menu-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--r-xs);
    border: 1px solid var(--border-soft);
    background: var(--surface-dim);
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.mat-menu-btn:hover {
    background: var(--surface-high);
    color: var(--blue);
    border-color: var(--blue);
}
.mat-menu-btn-del:hover {
    background: #ef444415;
    color: #ef4444;
    border-color: #ef444440;
}

/* Footer row: status badge + CTA action */
.mat-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 2px;
    border-top: 1px solid var(--border-soft);
}

/* Small status badge (bottom-left, read-only) */
.mat-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}
.mat-status-zamenjano { background: var(--mat-zamenjano-bg); color: var(--mat-zamenjano-color); }
.mat-status-narociti  { background: var(--mat-narociti-bg);  color: var(--mat-narociti-color); }
.mat-status-naroceno  { background: var(--mat-naroceno-bg);  color: var(--mat-naroceno-color); }
.mat-status-prislo    {
    background: var(--mat-prislo-bg);
    color: var(--mat-prislo-color);
    animation: pulseGreen 2s ease-in-out infinite;
}

/* Primary CTA action button */
.mat-action-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--r-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.mat-action-cta:hover { transform: scale(1.04); }
.mat-action-cta:active { transform: scale(0.97); }

/* Naroči — amber CTA */
.mat-cta-order {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
    box-shadow: 0 2px 8px #f59e0b40;
}
.mat-cta-order:hover { background: #d97706; border-color: #d97706; }

/* Prispelo — green CTA */
.mat-cta-arrived {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 2px 8px #10b98140;
}
.mat-cta-arrived:hover { background: #059669; border-color: #059669; }

/* Show menu buttons on mobile (no hover) */
@media (max-width: 640px) {
    .mat-card-menu { opacity: 1; }
    .mat-card-title { font-size: 0.86rem; }
}

/* =====================================================================
   PWA INSTALL BANNER
===================================================================== */
#pwa-banner {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-overlay);
    backdrop-filter: blur(20px);
    min-width: 280px;
    max-width: 90vw;
    animation: slideUpBanner 0.35s var(--ease-out);
}

@keyframes slideUpBanner {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#pwa-banner img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}

.pwa-info { flex: 1; min-width: 0; }
.pwa-info h4 { font-size: 0.85rem; font-weight: 700; margin: 0 0 2px; }
.pwa-info p  { font-size: 0.72rem; color: var(--text-3); margin: 0; }

/* =====================================================================
   MATERIAL MODAL FORM FIELDS
===================================================================== */
.mat-modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mat-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mat-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mat-field-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mat-field-optional {
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.55;
    background: var(--surface-dim);
    padding: 1px 6px;
    border-radius: 100px;
    border: 1px solid var(--border-soft);
}

.mat-field-input {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--input-border);
    border-radius: var(--r-sm);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    transition: var(--t);
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.mat-field-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-glow);
}
.mat-field-input::placeholder { color: var(--text-3); opacity: 0.6; }
.mat-field-mono { font-family: monospace; font-size: 0.82rem; letter-spacing: 0.02em; }

.mat-field-suffix-wrap {
    position: relative;
}
.mat-field-suffix-wrap .mat-field-input {
    padding-right: 36px;
}
.mat-field-suffix {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-3);
    pointer-events: none;
    letter-spacing: 0.03em;
}

/* Segmented toggle color variants */
.seg-btn-green.active {
    color: #10b981 !important;
    background: #10b98115 !important;
    border-color: #10b98135 !important;
    box-shadow: none !important;
}
.seg-btn-red.active {
    color: #ef4444 !important;
    background: #ef444415 !important;
    border-color: #ef444435 !important;
    box-shadow: none !important;
}

/* =====================================================================
   CONTRIBUTOR CHIPS
===================================================================== */
.contributors-row {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contributors-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 5px;
}

.contributors-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.contributor-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 4px;
    border-radius: 100px;
    border: 1px solid color-mix(in srgb, var(--chip-color) 25%, transparent);
    background: color-mix(in srgb, var(--chip-color) 10%, transparent);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    transition: var(--t-fast);
}
.contributor-chip:hover {
    background: color-mix(in srgb, var(--chip-color) 16%, transparent);
}

.contributor-chip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--chip-color);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
}

.contributor-chip-name {
    color: var(--text-2);
    font-weight: 600;
}

/* Fallback for browsers without color-mix */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
    .contributor-chip {
        border-color: rgba(128,128,128,0.2);
        background: var(--surface-high);
    }
}
/* =====================================================================
   SECTION SUBTITLE + CONTRIBUTORS (NalogDetail)
===================================================================== */
.section-subtitle {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 10px;
}
.section-subtitle svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.contributors-section {
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--surface-dim);
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
}

.contributors-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 100px;
    border: 1px solid color-mix(in srgb, var(--chip-accent, var(--primary)) 22%, transparent);
    background: color-mix(in srgb, var(--chip-accent, var(--primary)) 9%, transparent);
    transition: var(--t-fast);
    cursor: default;
}
.user-chip:hover {
    background: color-mix(in srgb, var(--chip-accent, var(--primary)) 16%, transparent);
}

.user-chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--chip-accent, var(--primary));
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
}

.user-chip-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
}

@supports not (color: color-mix(in srgb, red 10%, transparent)) {
    .user-chip { background: var(--surface-high); border-color: var(--border); }
}

/* =====================================================================
   PIN LOCK OVERLAY & NUMPAD
===================================================================== */
#pin-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s var(--ease-out);
}

@supports (backdrop-filter: blur(20px)) {
    #pin-lock-overlay {
        background: color-mix(in srgb, var(--bg) 85%, transparent);
        backdrop-filter: blur(30px);
    }
}

.pin-lock-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 380px;
    width: 100%;
}

.pin-lock-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    color: var(--blue);
    box-shadow: var(--sh);
    border: 1px solid var(--border);
}

.pin-lock-content h2 { margin-bottom: 8px; font-size: 1.5rem; font-weight: 800; }
.pin-lock-content p { color: var(--text-2); font-size: 0.95rem; margin-bottom: 30px; }

.pin-display {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    height: 20px;
    justify-content: center;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--surface-dim);
    border: 2px solid var(--border);
    transition: var(--t-fast);
}

.pin-dot.filled {
    background: var(--blue);
    border-color: var(--blue);
    transform: scale(1.2);
}

.pin-dot.error {
    background: var(--red);
    border-color: var(--red);
    animation: shake 0.4s ease-in-out;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.num-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--t-fast);
    box-shadow: var(--sh-xs);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.num-btn:active {
    transform: scale(0.92);
    background: var(--surface-dim);
}

.num-btn i { color: var(--text-2); }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@media (max-width: 640px) {
    .mat-field-row { grid-template-columns: 1fr; }
    #pwa-banner { bottom: max(80px, env(safe-area-inset-bottom)); }
}

/* =====================================================================
   NFC SCAN SYSTEM
===================================================================== */

/* Scan banner — sticky top bar inside drawer */
.nfc-scan-banner {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.83rem;
    font-weight: 600;
}
.nfc-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--blue);
    flex-shrink: 0;
    animation: nfc-pulse 1.4s ease-in-out infinite;
}
@keyframes nfc-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6); opacity: 0.4; }
}

/* Confirm card — bottom-sheet */
.nfc-confirm-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: 20px 20px max(20px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    animation: slide-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    max-width: 600px;
    margin: 0 auto;
}
.nfc-confirm-card--conflict {
    border-top: 2px solid var(--red);
}
@keyframes slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.nfc-card-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 0 auto 16px;
}
.nfc-card-device {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.nfc-card-serial {
    font-family: monospace;
    font-size: 0.78rem;
    background: var(--surface-dim);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: inline-block;
    margin-bottom: 10px;
    color: var(--text-2);
}
.nfc-conflict-row {
    padding: 8px 12px;
    background: var(--red-tint);
    border-left: 3px solid var(--red);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    font-size: 0.8rem;
    color: var(--red);
    font-weight: 600;
    margin-bottom: 8px;
}
.nfc-suggest-row {
    padding: 8px 12px;
    background: var(--amber-tint);
    border-left: 3px solid var(--amber);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    font-size: 0.8rem;
    color: var(--amber);
    font-weight: 600;
    margin-bottom: 8px;
}
.nfc-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.nfc-card-actions .btn { flex: 1; justify-content: center; }

/* Offline badge */
.nfc-offline-badge {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--amber-tint);
    border: 1px solid var(--amber);
    border-radius: var(--r-pill, 999px);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--amber);
    cursor: pointer;
}

/* Wizard NFC banner */
.wizard-nfc-banner {
    display: none; /* shown via JS inline style */
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px 12px;
    background: var(--blue-tint);
    border: 1px solid rgba(37,99,235,0.2);
    border-radius: var(--r-md);
    margin-bottom: 12px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--blue);
}
.nfc-banner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.nfc-chip-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(37,99,235,0.15);
}
.nfc-serial-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(37,99,235,0.1);
    border: 1px solid rgba(37,99,235,0.3);
    border-radius: 999px;
    padding: 3px 8px 3px 10px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--blue);
}
.nfc-serial-chip code { font-family: monospace; letter-spacing: 0.03em; }
.nfc-serial-chip button {
    background: none; border: none; cursor: pointer;
    color: inherit; font-size: 0.95rem; line-height: 1;
    padding: 0 2px; opacity: 0.5; transition: opacity 0.15s;
}
.nfc-serial-chip button:hover { opacity: 1; color: var(--red); }

/* Email warning banner (wizard) */
.wizard-email-banner {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--amber-tint);
    border: 1px solid var(--amber);
    border-radius: var(--r-md);
    margin-bottom: 12px;
    font-size: 0.83rem;
    flex-wrap: wrap;
}
.wizard-email-banner input {
    flex: 1;
    min-width: 180px;
    font-size: 0.83rem;
    padding: 6px 10px;
}

/* TP Builder */
.tp-builder {
    display: none;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-dim);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.tp-builder label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.tp-builder select, .tp-builder input { min-width: 100px; }

/* =====================================================================
   FLEET VIEW
===================================================================== */
.fleet-kpi-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.fleet-kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-2);
}
.fleet-kpi-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.fleet-kpi-ok     { border-left: 3px solid var(--green); }
.fleet-kpi-warn   { border-left: 3px solid var(--amber); }
.fleet-kpi-overdue{ border-left: 3px solid var(--red); }
.fleet-kpi-total  { border-left: 3px solid var(--blue); }

.fleet-filter-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 0.83rem;
    padding: 7px 10px;
}

.fleet-table {
    width: 100%;
    border-collapse: collapse;
}
.fleet-table th {
    padding: 10px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    text-align: left;
    background: var(--surface-dim);
}
.fleet-table td {
    padding: 11px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.fleet-row {
    cursor: pointer;
    transition: background 0.15s ease;
}
.fleet-row:hover { background: var(--surface-dim); }
.fleet-row:last-child td { border-bottom: none; }
.fleet-row-overdue td:first-child { border-left: 3px solid var(--red); }
.fleet-row-warn td:first-child   { border-left: 3px solid var(--amber); }
.fleet-row-ok td:first-child     { border-left: 3px solid var(--green); }

.fleet-serial {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    background: var(--surface-dim);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* =====================================================================
   HISTORY TIMELINE
===================================================================== */
.history-timeline {
    position: relative;
    padding-left: 20px;
}
.history-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}
.history-timeline-item {
    position: relative;
    margin-bottom: 16px;
}
.history-timeline-item::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 2px var(--blue);
}
.history-timeline-item:last-child { margin-bottom: 0; }
.history-tl-date {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-3);
    margin-bottom: 2px;
}
.history-tl-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.history-tl-services {
    font-size: 0.78rem;
    color: var(--text-2);
    margin-top: 2px;
}

@media (max-width: 640px) {
    .fleet-kpi-bar { grid-template-columns: repeat(2, 1fr); }
    .fleet-table th:nth-child(3),
    .fleet-table td:nth-child(3) { display: none; }
}

/* Item inline edit panel (wizard) */
.item-inline-edit {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--surface-dim);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--r-md) var(--r-md);
    animation: slide-up 0.18s ease both;
}
.item-inline-edit .form-group { margin-bottom: 10px; }
.item-inline-edit textarea {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--r-sm);
    color: var(--text);
    padding: 7px 10px;
    font-family: inherit;
}

/* NFC kategorija-card: storitve checkbox grid */
.svc-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface-dim);
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.15s, border-color 0.15s;
}
.svc-check-label:hover { background: var(--hover); }
.svc-check-label input { accent-color: var(--blue); width: 15px; height: 15px; flex-shrink: 0; }
.svc-check-label input:checked ~ span { font-weight: 600; color: var(--blue); }
.services-grid { display: flex; flex-direction: column; gap: 6px; }

/* Piece manager NFC scan button */
.piece-nfc-btn {
    padding: 4px 8px;
    flex-shrink: 0;
    color: var(--blue);
    opacity: 0.7;
    transition: opacity 0.15s;
}
.piece-nfc-btn:hover { opacity: 1; }
.piece-row-header { display: flex; align-items: center; gap: 6px; }

/* =============================================================
   NFC LOOKUP VIEW  (view-nfc-lookup)
   ============================================================= */
.nlv-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 40px;
    min-height: calc(100vh - 120px);
}
.nlv-state {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    width: 100%;
}

/* Scan ring */
.nlv-scan-ring {
    width: 148px; height: 148px;
    border-radius: 50%;
    border: 3px solid rgba(59,130,246,0.25);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.3s;
}
.nlv-scan-ring::before {
    content: '';
    position: absolute; inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(59,130,246,0.1);
}
.nlv-scan-ring:hover { border-color: rgba(59,130,246,0.5); }
.nlv-scan-ring-inner {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(59,130,246,0.08);
    border: 2px solid rgba(59,130,246,0.2);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s;
}
.nlv-scan-ring:hover .nlv-scan-ring-inner { background: rgba(59,130,246,0.14); }
.nlv-scan-ring--active {
    border-color: rgba(59,130,246,0.6);
    animation: nfc-ring-pulse 1.8s ease-in-out infinite;
}
.nlv-scan-ring--active .nlv-scan-ring-inner { background: rgba(59,130,246,0.15); }
@keyframes nfc-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.3); }
    50%       { box-shadow: 0 0 0 20px rgba(59,130,246,0); }
}

/* Loader ring */
.nlv-loader-ring {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    animation: spin 0.75s linear infinite;
}

/* Result layout */
.nlv-serial-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-dim);
    border-radius: var(--r-md);
    margin-bottom: 14px;
    border: 1px solid var(--border);
}
.nlv-serial-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.4; margin-bottom: 3px; }
.nlv-serial { font-family: monospace; font-size: 0.88rem; letter-spacing: 0.04em; }

.nlv-alert {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    margin-bottom: 12px;
    font-size: 0.82rem;
}
.nlv-alert > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nlv-alert--warn { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: var(--amber); }
.nlv-alert--warn i { flex-shrink: 0; }

.nlv-card {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: var(--r-lg);
    margin-bottom: 16px;
    align-items: flex-start;
}
.nlv-card-icon {
    width: 48px; height: 48px; flex-shrink: 0;
    border-radius: var(--r-md);
    border: 1px solid;
    display: flex; align-items: center; justify-content: center;
}
.nlv-card-body { flex: 1; min-width: 0; }
.nlv-kat { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.nlv-device { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.nlv-opis { font-size: 0.8rem; opacity: 0.55; margin-bottom: 6px; }
.nlv-last-svc { font-size: 0.75rem; opacity: 0.5; margin-top: 6px; display: flex; align-items: center; gap: 5px; }

.nlv-section-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.07em; opacity: 0.5;
    margin-bottom: 12px;
}

/* History timeline */
.nlv-history { width: 100%; }
.nlv-hist-row {
    display: flex; gap: 14px;
    padding-bottom: 18px;
    position: relative;
    animation: slide-up 0.25s ease both;
}
.nlv-hist-row::after {
    content: '';
    position: absolute;
    left: 6px; top: 14px;
    width: 1px; bottom: 0;
    background: var(--border);
}
.nlv-hist-row:last-child::after { display: none; }
.nlv-hist-dot {
    width: 13px; height: 13px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--surface);
    margin-top: 3px; z-index: 1;
}
.nlv-hist-dot--first { background: var(--blue); }
.nlv-hist-body { flex: 1; }
.nlv-hist-title { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.nlv-hist-date { font-size: 0.75rem; opacity: 0.45; font-weight: 400; }
.nlv-hist-customer { font-size: 0.78rem; opacity: 0.5; margin-bottom: 5px; }
.nlv-hist-services { display: flex; flex-wrap: wrap; gap: 4px; }

/* Unknown tag state */
.nlv-unknown {
    display: flex; flex-direction: column; align-items: center;
    padding: 32px 24px; border-radius: var(--r-lg);
    text-align: center; width: 100%;
}
.nlv-unknown-icon { margin-bottom: 16px; opacity: 0.4; }
.nlv-unknown h3 { margin: 0 0 8px; font-size: 1rem; }
.nlv-unknown p { font-size: 0.82rem; opacity: 0.5; margin: 0 0 20px; max-width: 260px; line-height: 1.5; }
.nlv-empty { font-size: 0.8rem; opacity: 0.35; text-align: center; padding: 20px 0; }
