/* ============================================================
   ELIKSIR - Modern Design System
   ============================================================ */

:root {
    --sidebar-bg: #070b14;
    --sidebar-surface: #0f1726;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #64748b;
    --sidebar-width: 300px;

    --bg-primary: #f4f7fb;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-hover: #0284c7;
    --primary-light: #e0f2fe;
    --primary-ring: rgba(14, 165, 233, 0.18);

    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);

    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }

/* ---- App Shell ---- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

.app-content {
    flex: 1;
    padding: 28px 36px 48px;
    min-width: 0;
    max-width: 100%;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0b1220 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-link {
    display: block;
    text-decoration: none;
    padding: 4px 2px;
}

.sidebar-logo-img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 72px;
    max-height: 96px;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 4px 16px rgba(14, 165, 233, 0.2));
}

.sidebar-nav {
    flex: 1;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.sidebar-nav::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.25);
}

.sidebar-group {
    margin: 2px 0;
}
.sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--sidebar-text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition), color var(--transition);
}
.sidebar-group-toggle:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-group.is-open > .sidebar-group-toggle,
.sidebar-group.has-active > .sidebar-group-toggle {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.sidebar-group-label {
    flex: 1;
    min-width: 0;
}
.sidebar-group-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
    background: currentColor;
    transition: transform .2s ease;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sidebar-group.is-open > .sidebar-group-toggle .sidebar-group-chevron {
    transform: rotate(180deg);
}
.sidebar-group-menu {
    display: none;
    padding: 2px 0 6px 8px;
    margin: 0 0 4px 10px;
    border-left: 1px solid rgba(148, 163, 184, 0.18);
}
.sidebar-group.is-open > .sidebar-group-menu {
    display: block;
}
.sidebar-group-menu .sidebar-link {
    padding: 9px 12px;
    font-size: 13px;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    flex-shrink: 0;
}

.sidebar-icon::before {
    content: '';
    width: 18px;
    height: 18px;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.sidebar-icon[data-icon="grid"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="users"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="map-pin"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="folder"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="factory"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M2 20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8l-7 5V8l-7 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M2 20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8l-7 5V8l-7 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2z'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="cpu"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Crect x='9' y='9' width='6' height='6'/%3E%3Cpath d='M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='4' y='4' width='16' height='16' rx='2'/%3E%3Crect x='9' y='9' width='6' height='6'/%3E%3Cpath d='M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="clipboard"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="settings"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="calendar"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="bell"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="layers"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="file-text"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="phone"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath fill-rule='evenodd' d='M1.5 4.5a3 3 0 0 1 3-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 0 1-.694 1.955l-1.293 1.293a11.042 11.042 0 0 0 5.516 5.516l1.293-1.293a1.875 1.875 0 0 1 1.955-.694l4.423 1.105a1.875 1.875 0 0 1 1.42 1.819V19.5a3 3 0 0 1-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath fill-rule='evenodd' d='M1.5 4.5a3 3 0 0 1 3-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 0 1-.694 1.955l-1.293 1.293a11.042 11.042 0 0 0 5.516 5.516l1.293-1.293a1.875 1.875 0 0 1 1.955-.694l4.423 1.105a1.875 1.875 0 0 1 1.42 1.819V19.5a3 3 0 0 1-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5z'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="truck"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='1' y='3' width='15' height='13'/%3E%3Cpolygon points='16 8 20 8 23 11 23 16 16 16 16 8'/%3E%3Ccircle cx='5.5' cy='18.5' r='2.5'/%3E%3Ccircle cx='18.5' cy='18.5' r='2.5'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='1' y='3' width='15' height='13'/%3E%3Cpolygon points='16 8 20 8 23 11 23 16 16 16 16 8'/%3E%3Ccircle cx='5.5' cy='18.5' r='2.5'/%3E%3Ccircle cx='18.5' cy='18.5' r='2.5'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="file-check"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpath d='M9 15l2 2 4-4'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpath d='M9 15l2 2 4-4'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="search"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="briefcase"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/%3E%3Cpath d='M2 13h20'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/%3E%3Cpath d='M2 13h20'/%3E%3C/svg%3E"); }
.sidebar-icon[data-icon="wrench"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-version {
    font-size: 11px;
    color: var(--sidebar-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ---- Header ---- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 36px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.header-logo {
    height: 48px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 1;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 6px 6px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-form { display: inline; }

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, #fff 0%, #fafcff 100%);
}

.card-header h2 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card-form {
    padding: 28px;
}

/* ---- Dashboard Stats ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-blue { background: var(--primary-light); color: var(--primary-dark); }
.stat-icon-green { background: var(--success-bg); color: var(--success); }
.stat-icon-purple { background: #f3e8ff; color: #9333ea; }
.stat-icon-orange { background: #fff7ed; color: var(--warning); }
.stat-icon-pink { background: #fce7f3; color: #db2777; }

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13.5px;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 24px !important;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.22);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(14, 165, 233, 0.28);
}

.btn-secondary {
    background: #fff;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: #cbd5e1;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: transparent;
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group-full { grid-column: 1 / -1; }

.device-name-manual {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.device-name-manual[hidden] {
    display: none !important;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    padding: 11px 14px;
    font-size: 14px;
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    width: 100%;
}

.form-input:hover, .form-select:hover, .form-textarea:hover {
    border-color: #cbd5e1;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
    background: #fff;
}

.form-textarea { resize: vertical; min-height: 96px; }

.form-error {
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border-light);
}

/* ---- File Dropzone ---- */
.file-dropzone {
    position: relative;
}

.file-dropzone-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-dropzone-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 180px;
    padding: 28px 24px;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fafcff 0%, #f8fafc 100%);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-align: center;
}

.file-dropzone-area:hover,
.file-dropzone.is-dragover .file-dropzone-area {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-ring);
}

.file-dropzone.is-dragover .file-dropzone-area {
    transform: scale(1.01);
}

.file-dropzone-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.file-dropzone-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.file-dropzone-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.file-dropzone-browse {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.file-dropzone-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.file-dropzone-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
}

.file-dropzone-preview img {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.file-dropzone-file {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.file-dropzone-preview-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.file-dropzone-remove {
    margin-left: auto;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.file-dropzone-remove:hover {
    background: var(--danger-bg);
    border-color: #fecaca;
    color: var(--danger);
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-muted { background: #f1f5f9; color: var(--text-muted); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warning { background: #fff7ed; color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

.badge-lg {
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.code-badge {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.code-badge-lg {
    font-size: 14px;
    padding: 6px 12px;
}

/* ---- Alerts ---- */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 600;
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ---- Page Actions / Filters ---- */
.page-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-bar .form-input,
.filter-bar .form-select {
    width: 100%;
    min-width: 0;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
    flex: 1 1 150px;
    max-width: 220px;
}

.filter-field-wide {
    min-width: 200px;
    flex: 1 1 220px;
    max-width: 280px;
}

.filter-field label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.2;
}

.filter-bar .filter-check {
    align-self: center;
    margin-bottom: 2px;
}

.filter-bar .btn {
    flex: 0 0 auto;
    align-self: flex-end;
}

.filter-group { display: contents; }

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.action-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    line-height: 1;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    white-space: nowrap;
}

.action-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn-view {
    color: #0369a1;
}

.action-btn-view:hover {
    background: var(--primary-light);
    border-color: #bae6fd;
    color: #0284c7;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.12);
}

.action-btn-download {
    color: #047857;
}

.action-btn-download:hover {
    background: var(--success-bg);
    border-color: #a7f3d0;
    color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.action-btn-edit:hover {
    background: #fff;
    border-color: #cbd5e1;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.action-btn-danger {
    color: #dc2626;
}

.action-btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.inline-form { display: inline; }

/* ---- Login Page ---- */
.auth-body {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.22), transparent 32%),
        linear-gradient(135deg, #070b14 0%, #0f172a 45%, #0c4a6e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page {
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-xl);
    padding: 42px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-img {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    min-height: 80px;
    max-height: 120px;
    margin: 0 auto 24px;
    object-fit: contain;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form .btn {
    margin-top: 8px;
    padding: 12px;
    font-size: 14px;
}

/* ---- Settings ---- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.settings-info { padding: 20px 24px; }

.settings-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.settings-row:last-child { border-bottom: none; }

.settings-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.settings-value { color: var(--text-primary); }

.settings-note { margin-bottom: 16px; font-size: 13px; }

.credentials-box {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
}

.settings-list {
    list-style: none;
    margin-top: 12px;
}

.settings-list li {
    padding: 6px 0;
    font-size: 13px;
}

/* ---- Misc ---- */
.font-medium { font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }

.table-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.table-thumb-placeholder {
    color: var(--text-muted);
}

.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-logo {
    width: min(100%, 320px);
    height: auto;
    min-height: 72px;
    max-height: 100px;
    object-fit: contain;
    margin: 0 auto 28px;
    display: block;
}

.error-page h1 {
    font-size: 72px;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.error-page p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
}

/* ---- Dashboard: Obaveštenja & Dnevni raspored ---- */
.dashboard-section {
    margin-bottom: 28px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.announcement-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.announcement-card {
    display: flex;
    gap: 16px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.announcement-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #fff;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.announcement-card-body {
    flex: 1;
    min-width: 0;
}

.announcement-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.announcement-card-meta strong {
    font-size: 16px;
}

.announcement-card-body p {
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.6;
}

.announcement-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.announcement-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.task-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.task-card-done {
    background: #f8fffb;
    border-color: #bbf7d0;
}

.task-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.task-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.task-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.task-complete-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.task-complete-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.task-completion-box {
    padding: 14px;
    background: var(--success-bg);
    border-radius: 12px;
    border: 1px solid #a7f3d0;
}

.task-completion-box p {
    margin: 6px 0 8px;
    color: var(--text-secondary);
}

.admin-quick-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ---- Brze kartice ---- */
.qc-compose {
    margin-bottom: 8px;
}

.qc-compose .card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.qc-compose__form {
    padding: 0 20px 20px;
}

.qc-type-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.qc-type-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: border-color .15s, background .15s, color .15s;
}

.qc-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.qc-type-option.is-dostava { color: #0369a1; }
.qc-type-option.is-ponuda { color: #7c3aed; }
.qc-type-option.is-pozvati { color: #c2410c; }
.qc-type-option.is-ostalo { color: #475569; }

.qc-type-option:has(input:checked),
.qc-type-option:hover {
    border-color: currentColor;
}

.qc-type-option.is-dostava:has(input:checked) { background: #e0f2fe; }
.qc-type-option.is-ponuda:has(input:checked) { background: #ede9fe; }
.qc-type-option.is-pozvati:has(input:checked) { background: #ffedd5; }
.qc-type-option.is-ostalo:has(input:checked) { background: #f1f5f9; }

.qc-admin-grid,
.qc-dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.qc-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid #94a3b8;
}

.qc-card--dostava { border-left-color: #0284c7; }
.qc-card--ponuda { border-left-color: #7c3aed; }
.qc-card--pozvati { border-left-color: #ea580c; }
.qc-card--ostalo { border-left-color: #64748b; }

.qc-card.is-done,
.qc-card.is-inactive {
    opacity: 0.72;
    background: #f8fafc;
}

.qc-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.qc-type {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.qc-type--dostava { background: #e0f2fe; color: #0369a1; }
.qc-type--ponuda { background: #ede9fe; color: #6d28d9; }
.qc-type--pozvati { background: #ffedd5; color: #c2410c; }
.qc-type--ostalo { background: #f1f5f9; color: #475569; }

.qc-card__body {
    margin: 0 0 12px;
    line-height: 1.55;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.qc-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 720px) {
    .qc-type-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


.quick-link-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.quick-link-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.quick-link-card strong {
    font-size: 15px;
    color: var(--text-primary);
}

.quick-link-card span {
    font-size: 13px;
    color: var(--text-muted);
}

.role-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.role-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.role-checkbox:hover {
    border-color: #cbd5e1;
    background: #fafcff;
}

.role-checkbox input {
    accent-color: var(--primary);
}

.role-checkbox span {
    font-size: 13.5px;
    font-weight: 500;
}

.task-snippet {
    font-size: 12px;
    margin-top: 4px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

.warranty-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.warranty-card-active {
    border-color: rgba(34, 197, 94, 0.25);
}

.warranty-card-expired {
    border-color: rgba(148, 163, 184, 0.35);
}

.text-success {
    color: var(--success);
    font-weight: 500;
}

.text-danger {
    color: var(--danger);
    font-weight: 500;
}

/* ---- Device profile (Stanje) ---- */
.device-profile {
    font-size: 15px;
}

.device-profile-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    padding: 0;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.device-profile-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.device-profile-hero--slobodan { border-top: 4px solid var(--success); }
.device-profile-hero--slobodan .device-profile-hero-bg {
    background:
        radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.1) 0%, transparent 45%),
        linear-gradient(180deg, #ffffff 0%, #f0fdf9 100%);
}
.device-profile-hero--prodat { border-top: 4px solid var(--info); }
.device-profile-hero--prodat .device-profile-hero-bg {
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 45%),
        linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}
.device-profile-hero--izdat { border-top: 4px solid var(--warning); }
.device-profile-hero--izdat .device-profile-hero-bg {
    background:
        radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.12) 0%, transparent 45%),
        linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
}
.device-profile-hero--servis { border-top: 4px solid var(--danger); }
.device-profile-hero--servis .device-profile-hero-bg {
    background:
        radial-gradient(circle at 100% 0%, rgba(239, 68, 68, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
}

.device-profile-hero-top {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
    gap: 28px;
    padding: 28px 32px 24px;
    align-items: start;
}

.device-profile-identity {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    min-width: 0;
}

.device-profile-identity-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #dbeafe 100%);
    color: var(--primary-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.device-profile-kicker {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

.device-profile-name {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.device-profile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(4px);
}

.profile-chip svg {
    flex-shrink: 0;
    opacity: 0.65;
}

.profile-chip-serial {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12.5px;
    letter-spacing: 0.02em;
}

.device-profile-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-metric {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.profile-metric-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.profile-metric-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.profile-metric-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.profile-metric-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
}

.profile-metric-sub {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}

.profile-metric-status--slobodan .profile-metric-icon { background: var(--success-bg); color: var(--success); }
.profile-metric-status--slobodan .profile-metric-value { color: #047857; }

.profile-metric-status--prodat .profile-metric-icon { background: var(--info-bg); color: var(--info); }
.profile-metric-status--prodat .profile-metric-value { color: #1d4ed8; }

.profile-metric-status--izdat .profile-metric-icon { background: #fff7ed; color: #c2410c; }
.profile-metric-status--izdat .profile-metric-value { color: #c2410c; }

.profile-metric-status--servis .profile-metric-icon { background: var(--danger-bg); color: var(--danger); }
.profile-metric-status--servis .profile-metric-value { color: #b91c1c; }

.profile-metric-warranty.is-active {
    border-color: #a7f3d0;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}
.profile-metric-warranty.is-active .profile-metric-icon { background: #d1fae5; color: #059669; }
.profile-metric-warranty.is-active .profile-metric-value { color: #047857; }

.profile-metric-warranty.is-expired {
    border-color: var(--border);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}
.profile-metric-warranty.is-expired .profile-metric-icon { background: #e2e8f0; color: #64748b; }
.profile-metric-warranty.is-expired .profile-metric-value { color: #64748b; }

.profile-metric-warranty.is-unknown {
    border-color: var(--border-light);
    background: #fafafa;
}
.profile-metric-warranty.is-unknown .profile-metric-icon { background: #f1f5f9; color: #94a3b8; }
.profile-metric-warranty.is-unknown .profile-metric-value { color: #64748b; font-size: 16px; }

.device-profile-hero-actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 32px 22px;
    border-top: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.6);
}

.device-profile-hero-actions .dropdown-actions {
    justify-content: flex-start;
}

.device-profile-info .settings-row {
    padding: 14px 0;
}

.device-profile-info .settings-label {
    font-size: 14px;
}

.device-profile-info .settings-value {
    font-size: 16px;
    font-weight: 600;
}

.settings-value-emphasis {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--text-primary);
}

.warranty-state {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
}

.warranty-state-active {
    background: var(--success-bg, #ecfdf5);
    color: var(--success, #059669);
}

.warranty-state-expired {
    background: #f1f5f9;
    color: var(--text-muted);
}

.device-profile-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

.device-profile .card-header h2 {
    font-size: 17px;
}

.device-profile-history {
    margin-top: 20px;
}

.data-table-profile th {
    font-size: 13px;
    padding: 14px 18px;
}

.data-table-profile td {
    font-size: 14.5px;
    padding: 16px 18px;
    vertical-align: top;
}

.device-profile-footer {
    margin-top: 20px;
    border: none;
    padding-top: 0;
}

@media (max-width: 768px) {
    .device-profile-hero-top {
        grid-template-columns: 1fr;
        padding: 20px 20px 16px;
        gap: 20px;
    }

    .device-profile-name {
        font-size: 22px;
    }

    .device-profile-hero-actions {
        padding: 14px 20px 18px;
    }
}

.detail-description {
    padding: 14px 0 0;
}

.detail-description p {
    margin-top: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.card-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-light);
}

.completion-list {
    padding: 8px 0;
}

.completion-item {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
}

.completion-item:last-child {
    border-bottom: none;
}

.completion-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.completion-date {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.completion-comment {
    color: var(--text-secondary);
    line-height: 1.6;
}

.stats-grid-8 {
    grid-template-columns: repeat(4, 1fr);
}

.stats-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stanje-stats {
    margin-bottom: 24px;
}

.form-select-sm {
    min-width: 140px;
    padding: 6px 10px;
    font-size: 13px;
}

.filter-bar-wrap {
    flex-wrap: wrap;
}

.stock-status-form {
    margin: 0;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.chart-card .card-header {
    padding-bottom: 0;
}

.chart-wrap {
    position: relative;
    height: 280px;
    padding: 16px 20px 24px;
}

.chart-wrap-donut {
    height: 300px;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .stats-grid, .stats-grid-8, .stats-grid-5, .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { width: 88px; }
    .sidebar-logo-img {
        min-height: 44px;
        max-height: 52px;
        object-position: center;
    }
    .sidebar-brand { padding: 14px 8px; }
    .sidebar-link span:not(.sidebar-icon), .sidebar-version, .sidebar-group-label, .sidebar-group-chevron { display: none; }
    .sidebar-link { justify-content: center; padding: 12px; }
    .sidebar-group-toggle { justify-content: center; padding: 12px; }
    .sidebar-group.is-open > .sidebar-group-menu {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }
    .app-main { margin-left: 88px; }
    .app-content { padding: 16px; }
    .app-header { padding: 16px; }
    .header-logo {
        height: 40px;
        max-width: 140px;
    }
    .form-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-actions { flex-direction: column; }
    .table-actions { justify-content: flex-start; }
    .user-info { display: none; }
    .admin-quick-links { grid-template-columns: 1fr; }
    .stats-grid-8, .stats-grid-5, .stats-grid-3 { grid-template-columns: 1fr; }
}

/* ---- Prodaja portal ---- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.alert-info {
    background: var(--info-bg, #eff6ff);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.location-banner { margin-bottom: 20px; }

.dropdown-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.action-buttons-stack {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.action-buttons-stack .dropdown-actions {
    justify-content: flex-end;
}

.table-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.empty-state-inline {
    padding: 24px;
    color: var(--text-muted);
    margin: 0;
}

.badge-warning {
    background: #fff7ed;
    color: #c2410c;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
}

.call-description {
    padding: 20px 24px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.action-form-intro {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.action-form-intro p { margin-bottom: 6px; }

.form-hint { padding: 0 0 16px; font-size: 13px; }

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.form-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-of-type { border-bottom: none; }

.form-section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.dn-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
}

.dn-doc-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.dn-doc-number { font-size: 24px; font-weight: 800; margin: 4px 0; }

.dn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px 24px;
}

.dn-block h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.dn-locations .dn-block-from { background: #f0fdf9; border-radius: 12px; padding: 16px; }
.dn-locations .dn-block-to { background: #eff6ff; border-radius: 12px; padding: 16px; }

.dn-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
    font-size: 14px;
}

.dn-block-reject { background: #fef2f2; border-radius: 12px; padding: 16px; }

.dn-receive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 24px;
}

.dn-reject-form { border-left: 3px solid var(--danger); padding-left: 20px; }

.dn-memorandum-preview {
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.dn-memorandum-preview p { margin: 0 0 4px; }
.dn-memorandum-preview p:last-child { margin-bottom: 0; }

.dn-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dn-items-header .form-section-title { margin-bottom: 0; }

.dn-item-row {
    margin-bottom: 16px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
}

.dn-item-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.dn-item-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* ---- Contracts ---- */
.filter-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    padding: 0 4px;
}

.contract-device-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.contract-device-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.contract-device-option:hover {
    border-color: var(--primary);
}

.contract-device-option input {
    margin-top: 3px;
}

.contract-device-option__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.contract-detail__hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border);
    background: #fff;
}

.contract-detail__hero--ok { border-left: 5px solid var(--success); }
.contract-detail__hero--near_expiry { border-left: 5px solid var(--warning); }
.contract-detail__hero--debtor { border-left: 5px solid var(--danger); }
.contract-detail__hero--terminated { border-left: 5px solid var(--text-muted); }

.contract-detail__number {
    font-size: 1.6rem;
    margin: 4px 0 6px;
}

.contract-detail__tenant {
    color: var(--text-secondary);
    font-weight: 500;
}

.contract-detail__status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.contract-detail__grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.replace-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    max-width: 100%;
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1.5px solid #fb923c;
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 55%, #fed7aa 100%);
    color: #9a3412;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
    box-shadow: 0 8px 18px rgba(234, 88, 12, 0.12);
    user-select: none;
    white-space: normal;
}

.replace-toggle-btn input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.replace-toggle-btn__mark {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #ea580c;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: transparent;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.replace-toggle-btn__text {
    display: block;
    flex: 1;
    min-width: 0;
}

.replace-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(234, 88, 12, 0.18);
}

.replace-toggle-btn:has(input:checked),
.replace-toggle-btn.is-checked {
    border-color: #ea580c;
    background: linear-gradient(145deg, #ffedd5 0%, #fdba74 100%);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18), 0 10px 22px rgba(154, 52, 18, 0.14);
}

.replace-toggle-btn:has(input:checked) .replace-toggle-btn__mark,
.replace-toggle-btn.is-checked .replace-toggle-btn__mark {
    background: #ea580c;
    border-color: #c2410c;
    color: #fff;
}

.contract-contact-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.contract-manage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.contract-manage-grid .card-span-2 {
    grid-column: 1 / -1;
}

.extend-day-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 960px) {
    .contract-detail__grid,
    .contract-manage-grid {
        grid-template-columns: 1fr;
    }
}

.serial-search-row {
    display: flex;
    gap: 8px;
}
.serial-search-results {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.serial-result-item {
    text-align: left;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.serial-result-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.selected-devices-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.selected-device-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid var(--border);
    font-size: 13px;
}

/* Service history panel */
.service-history-panel { margin-top: 4px; }
.service-history-panel__head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 14px;
}
.service-history-panel__head h3 { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.service-history-badge {
    display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.01em;
}
.service-history-badge--is-ok { background: #d1fae5; color: #065f46; }
.service-history-badge--is-partial { background: #fef3c7; color: #92400e; }
.service-history-badge--is-missed { background: #fee2e2; color: #991b1b; }
.service-history-badge--is-unknown { background: #f1f5f9; color: #475569; }
.service-history-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px;
}
.service-history-stat {
    border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; background: #f8fafc;
}
.service-history-stat__label {
    display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: #64748b; margin-bottom: 4px;
}
.service-history-stat__value { font-size: 22px; font-weight: 800; color: #0f172a; }
.service-history-stat__value--sm { font-size: 14px; font-weight: 700; }
.service-history-stat__value.is-warn { color: #b45309; }

/* Marketing calendar */
.mcal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.mcal-month-title {
    font-size: 1.15rem;
    font-weight: 700;
    min-width: 180px;
    text-align: center;
    color: var(--text-primary);
}
.mcal-card { padding: 12px; }
.mcal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}
.mcal-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 6px 0;
}
.mcal-day {
    min-height: 96px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mcal-day--empty {
    background: transparent;
    border-color: transparent;
}
.mcal-day--today {
    border-color: var(--primary);
    background: var(--primary-light);
}
.mcal-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mcal-day-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}
.mcal-day-add {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    color: var(--primary-dark);
    text-decoration: none;
    opacity: 0.55;
}
.mcal-day-add:hover { opacity: 1; background: #fff; }
.mcal-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}
.mcal-chip {
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    padding: 3px 5px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    color: #0f172a;
}
.mcal-chip--kongres { background: #dbeafe; color: #1d4ed8; }
.mcal-chip--objava { background: #ffedd5; color: #c2410c; }
.mcal-chip--dogadjaj { background: #d1fae5; color: #047857; }
.mcal-chip--ostalo { background: #e2e8f0; color: #475569; }
.mcal-more {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}
@media (max-width: 900px) {
    .mcal-day { min-height: 72px; }
    .mcal-chip { font-size: 10px; }
}
@media (max-width: 640px) {
    .mcal-grid { gap: 4px; }
    .mcal-day { min-height: 64px; padding: 4px; }
    .mcal-day-add { display: none; }
}

.loyalty-sale-box {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
}
.loyalty-sale-box__toggle {
    margin-bottom: 0;
}
.loyalty-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}
.loyalty-toggle input {
    width: 18px;
    height: 18px;
}
.loyalty-sale-box__search {
    margin-top: 12px;
}
.loyalty-sale-search-wrap {
    position: relative;
}
.loyalty-sale-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 40;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}
.loyalty-sale-results[hidden] {
    display: none !important;
}
.loyalty-sale-results__item {
    text-align: left;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--border-light);
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.loyalty-sale-results__item:last-child {
    border-bottom: 0;
}
.loyalty-sale-results__item:hover {
    background: var(--primary-light);
}
.loyalty-sale-results__empty {
    padding: 12px;
    color: var(--text-muted);
    font-size: 13px;
}
.loyalty-sale-box__picked {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
}
.form-input.is-loyalty-filled {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
