﻿/* ========== CSS VARIABLES (ЦВЕТОВАЯ СХЕМА) ========== */
:root {
  --primary: #990000;
  --primary-dark: #7a0000;
  --primary-rgb: 153, 0, 0;
  --bg: #f0f2f5;
  --surface: #ffffff;
  --on-surface: #1e293b;
  --on-surface-variant: #64748b;
}

/* ========== ОСНОВНЫЕ СТИЛИ ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
background: #f3f4f6;
color: #1e293b;
line-height: 1.5;
height: 100vh;
overflow: hidden;
}
.container {
width: 100%;
height: 100vh;
background: white;
display: flex;
flex-direction: column;
overflow: hidden;
}

/* ========== HEADER ========== */
.header {
background: var(--primary);
color: white;
padding: 15px 30px;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 15px;
z-index: 10;
position: relative;
box-shadow: 0 4px 20px rgba(var(--primary-rgb),0.3);
overflow: hidden;
}
#headerCanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: none;
}
.header > *:not(#headerCanvas) {
position: relative;
z-index: 1;
}
.header h1 { font-size: 22px; font-weight: 700; margin: 0; flex: 1; letter-spacing: 0.3px; }
.org-name { font-size: 0.8rem; opacity: 0.75; white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.stats-badge {
background: rgba(255,255,255,0.15);
backdrop-filter: blur(4px);
padding: 8px 16px;
border-radius: 30px;
font-weight: 700;
font-size: 15px;
white-space: nowrap;
border: 1px solid rgba(255,255,255,0.15);
}
.add-button {
background: rgba(255,255,255,0.15);
backdrop-filter: blur(4px);
border: 1px solid rgba(255,255,255,0.2);
color: white;
padding: 9px 18px;
border-radius: 30px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 8px;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
white-space: nowrap;
}
.add-button:hover {
background: rgba(255,255,255,0.25);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ========== AUTH FORM ========== */
.auth-card {
background: white;
border-radius: 20px;
padding: 36px;
margin: 60px auto;
max-width: 420px;
box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
border: 1px solid #e2e8f0;
display: flex;
flex-direction: column;
gap: 20px;
z-index: 20;
}
.auth-card h2 { text-align: center; color: var(--primary); font-size: 1.5rem; margin-bottom: 6px; font-weight: 700; }
.auth-card .form-group { width: 100%; }
.auth-card label { font-weight: 600; color: #475569; margin-bottom: 6px; display: block; font-size: 0.85rem; }
.auth-card .form-control {
width: 100%;
padding: 12px 16px;
border: 2px solid #e2e8f0;
border-radius: 12px;
font-size: 0.95rem;
background: #f8fafc;
transition: all 0.2s;
box-sizing: border-box;
}
.auth-card .form-control:focus {
border-color: var(--primary);
box-shadow: 0 0 0 4px rgba(var(--primary-rgb),0.08);
outline: none;
background: white;
}
.auth-card .btn {
width: 100%;
padding: 13px;
background: var(--primary);
color: white;
border: none;
border-radius: 30px;
font-weight: 700;
font-size: 1rem;
cursor: pointer;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
box-shadow: 0 4px 12px rgba(var(--primary-rgb),0.2);
}
.auth-card .btn:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(var(--primary-rgb),0.3); }
.auth-card .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.loading {
display: inline-block;
width: 18px;
height: 18px;
border: 2.5px solid rgba(255,255,255,.3);
border-radius: 50%;
border-top-color: white;
animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== FILTERS — primary bg with white translucent pills ========== */
.filters-card {
    margin: 10px 28px 12px 28px;
    background: var(--primary);
    border-radius: 20px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    z-index: 200;
    position: relative;
    color: white;
}
.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filter-group {
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    position: relative;
}
.filter-group label { display: none; }

/* Filter chip — translucent white pill */
.filter-chip {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    height: 34px;
    padding: 0 14px 0 4px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
    position: relative;
}
.filter-chip:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.15);
}
.filter-chip:active { transform: scale(0.98); }

.filter-chip-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.filter-chip:hover .filter-chip-icon {
    background: rgba(255,255,255,0.3);
    color: white;
}

.filter-chip-label {
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    font-weight: 500;
}

.filter-chip-count {
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    line-height: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.filter-chip-count:empty { display: none; }
.filter-chip-count:not(:empty) { animation: filterPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

.filter-chip-value {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
    flex-shrink: 0;
}

/* Active — white pill, primary text */
.filter-chip.active {
    background: white;
    border-color: white;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.filter-chip.active .filter-chip-icon {
    background: rgba(var(--primary-rgb),0.12);
    color: var(--primary);
}
.filter-chip.active .filter-chip-label,
.filter-chip.active .filter-chip-value { color: var(--primary); }
.filter-chip.active .filter-chip-count {
    background: var(--primary);
    color: white;
}

/* Search */
.search-group {
    flex: 1 1 200px;
    min-width: 180px;
    position: relative;
}
.search-group label { display: none; }
.search-group input, .search-group .form-control {
    width: 100%;
    height: 34px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    padding: 0 16px 0 36px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}
.search-group input::placeholder, .search-group .form-control::placeholder {
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}
.search-group input:hover, .search-group .form-control:hover {
    background: rgba(255,255,255,0.18);
}
.search-group input:focus, .search-group .form-control:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}
.search-group .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    pointer-events: none;
}

/* Date & select */
.filter-group input[type="date"].form-control,
.filter-group select {
    height: 34px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    padding: 0 12px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}
.filter-group input[type="date"].form-control { padding: 0 12px; }
.filter-group input[type="date"].form-control:hover,
.filter-group select:hover {
    background: rgba(255,255,255,0.18);
}
.filter-group input[type="date"].form-control:focus,
.filter-group select:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}
.filter-group select option { color: #1e293b; background: white; }
.filter-group input[type="date"].form-control::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(1);
    opacity: 0.5;
}

/* Dropdown popup (white) */
.filter-dropdown {
    z-index: 10001 !important;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 16px;
    box-shadow:
        0 4px 24px rgba(0,0,0,0.15),
        0 0 0 1px rgba(0,0,0,0.04);
    max-height: 320px;
    overflow-y: auto;
    display: none;
    animation: fadeIn 0.15s ease;
    min-width: 220px;
    padding: 8px;
}
.filter-dropdown.show { display: block; }
.filter-dropdown::-webkit-scrollbar { width: 4px; }
.filter-dropdown::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.filter-option {
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.filter-option:hover {
    background: rgba(var(--primary-rgb),0.08);
    color: var(--primary);
}
.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

/* Dropdown item labels — override .filter-group label { display:none } */
.filter-dropdown label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}
.filter-dropdown label:hover {
    background: rgba(0,0,0,0.04);
}
.filter-dropdown label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    margin: 0;
    flex-shrink: 0;
}

/* Reset */
.reset-filters-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    height: 34px;
    padding: 0 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.reset-filters-btn:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.filter-buttons-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
#exportShiftsBtn,
.reset-filters-btn#exportExcelBtn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
}
#exportShiftsBtn:hover,
.reset-filters-btn#exportExcelBtn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Actions row */
.filters-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 2px;
    flex-wrap: wrap;
}

/* Radius row */
.radius-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 0;
    border-top: none;
    align-items: center;
}
.radius-row-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}
.radius-row > .filter-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    min-width: 160px;
    gap: 6px;
}
.radius-row > .filter-group:nth-of-type(2) { flex: 0 0 auto; min-width: 0; gap: 4px; }
.radius-row > .filter-group:nth-of-type(2) .filter-icon-label { margin-left: 0; }

.radius-input {
    height: 34px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    border-radius: 18px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}
.radius-input::placeholder { color: rgba(255,255,255,0.4); }
.radius-input:hover { background: rgba(255,255,255,0.18); }
.radius-input:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}
.radius-select {
    height: 30px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    color: white;
    border-radius: 15px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    width: auto;
    min-width: auto;
    box-sizing: border-box;
}
.radius-select:hover { background: rgba(255,255,255,0.18); }
.radius-select:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}
.radius-select option { color: #1e293b; background: white; }

.filter-group .filter-icon-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 600;
    margin-left: 12px;
    margin-bottom: 0;
    letter-spacing: 0.2px;
}
.filter-group .filter-icon-label i { font-size: 12px; }

@keyframes filterPopIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== MOBILE FILTERS ========== */
@media (max-width: 768px) {
    .filters-card {
        margin: 8px 12px 12px 12px;
        padding: 10px 12px;
        border-radius: 18px;
    }
    .filter-chip { height: 32px; font-size: 11px; padding: 0 10px 0 3px; }
    .filter-chip-icon { width: 24px; height: 24px; font-size: 10px; }
    .search-group { flex: 1 1 100%; min-width: 0; order: -1; }
    .search-group input, .search-group .form-control {
        height: 36px;
        font-size: 13px;
    }
    .filter-group input[type="date"].form-control,
    .filter-group select { height: 36px; }
    .filters-actions-row { flex-wrap: wrap; justify-content: stretch; }
    .filters-actions-row > * { flex: 1 1 auto; }
}

/* ========== BUTTONS ========== */
.btn-primary {
background: var(--primary);
color: white;
border: none;
border-radius: 12px;
padding: 8px 20px;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.8rem;
transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary {
background: white;
color: var(--primary);
border: 1px solid var(--primary);
border-radius: 12px;
padding: 8px 20px;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.8rem;
transition: all 0.2s;
}
.btn-secondary:hover { background: #fef6f6; transform: translateY(-1px); }
.btn-small {
padding: 4px 12px;
font-size: 0.7rem;
}

/* ========== MAIN LAYOUT ========== */
.main-layout {
flex: 1;
display: flex;
overflow: hidden;
padding: 0 28px 20px 28px;
gap: 20px;
}
.shops-sidebar {
width: 380px;
background: white;
border-radius: 20px;
border: 1px solid #e2e8f0;
display: flex;
flex-direction: column;
overflow: hidden;
z-index: 5;
box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.shops-header {
padding: 16px 20px;
border-bottom: 1px solid #eef2f6;
background: white;
}
.shops-header h3 { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.shops-list {
flex: 1;
overflow-y: auto;
padding: 12px;
}
.shop-card {
background: white;
border-radius: 16px;
padding: 16px;
margin-bottom: 10px;
border: 1px solid #e8ecf0;
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.shop-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(var(--primary-rgb),0.08); }
.shop-card.selected { border-left: 4px solid var(--primary); background: #fef6f6; }
.shop-name { font-weight: 700; font-size: 1rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.shop-name .shop-icon { width: 24px; height: 24px; object-fit: contain; }
.shop-address { font-size: 0.75rem; color: #64748b; margin-bottom: 8px; display: flex; gap: 4px; }
.shop-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #f1f5f9; padding: 4px 10px; border-radius: 16px; font-size: 0.7rem; font-weight: 500; color: #475569; }
.map-container {
flex: 1;
display: flex;
flex-direction: column;
border-radius: 20px;
overflow: hidden;
border: 1px solid #e2e8f0;
background: #f8fafc;
z-index: 5;
position: relative;
}
#map { 
    flex: 1;
    position: relative;
    min-height: 300px;
}
.route-bar {
padding: 12px 16px;
background: white;
border-top: 1px solid #eef2f6;
display: flex;
flex-wrap: wrap;
gap: 10px;
align-items: center;
z-index: 20;
position: relative;
visibility: visible !important;
opacity: 1 !important;
}
.route-input {
flex: 1;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 40px;
padding: 8px 14px;
font-size: 0.8rem;
}
.route-info { font-size: 0.75rem; color: #2c6e2c; font-weight: 500; }

/* ========== AUTOCOMPLETE ========== */
.autocomplete-container {
position: relative;
flex: 1;
}
.autocomplete-list {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: white;
border: 1px solid #ddd;
border-radius: 8px;
max-height: 200px;
overflow-y: auto;
z-index: 1001;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
display: none;
margin-top: 4px;
}
.autocomplete-list-up {
position: absolute;
bottom: 100%;
left: 0;
right: 0;
background: white;
border: 1px solid #ddd;
border-radius: 8px;
max-height: 200px;
overflow-y: auto;
z-index: 1001;
box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
display: none;
margin-bottom: 4px;
}
.autocomplete-list.show, .autocomplete-list-up.show { display: block; }
.autocomplete-item {
padding: 8px 12px;
cursor: pointer;
border-bottom: 1px solid #f0f0f0;
color: #1e293b;
background: white;
font-size: 13px;
white-space: normal;
word-break: break-word;
}
.autocomplete-item:hover { background: #f7fafc; }

/* ========== SIDEBAR ========== */
.sidebar {
position: fixed;
top: 0;
right: -660px;
width: 100%;
max-width: 620px;
height: 100vh;
background: #f0f2f5;
box-shadow: -8px 0 40px rgba(0,0,0,0.15);
transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
z-index: 1000;
overflow-y: auto;
overflow-x: hidden;
}
.sidebar.open { right: 0; }

/* ========== NAV SIDEBAR (LEFT) ========== */
.nav-sidebar {
right: auto;
left: -340px;
max-width: 300px;
box-shadow: 8px 0 40px rgba(0,0,0,0.15);
transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
background: #ffffff;
will-change: left;
display: flex;
flex-direction: column;
}
.nav-sidebar.open { left: 0; right: auto; }
.nav-sidebar .sidebar-header {
background: var(--primary);
border-bottom: none;
box-shadow: 0 2px 12px rgba(0,0,0,0.15);
flex-shrink: 0;
}
.nav-sidebar .sidebar-content {
padding: 8px 0;
background: transparent;
flex: 1;
overflow-y: auto;
}
.sidebar .sidebar-header {
position: sticky;
top: 0;
background: var(--primary);
color: white;
padding: 16px 22px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 5;
border-bottom: none;
box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.sidebar .sidebar-header h3 { font-size: 1.15rem; font-weight: 800; margin: 0; letter-spacing: 0.3px; }
.sidebar .sidebar-header .ds-header-left { display: flex; align-items: center; gap: 10px; }
.sidebar .sidebar-header button {
background: rgba(255,255,255,0.12);
border: none;
font-size: 1.15rem;
cursor: pointer;
padding: 8px 12px;
border-radius: 8px;
color: white;
opacity: 0.85;
transition: all 0.2s;
}
.sidebar .sidebar-header button:hover { background: rgba(255,255,255,0.25); opacity: 1; }
.sidebar .sidebar-content { padding: 20px; background: #f0f2f5; }

/* ========== NAV MINIBAR (LEFT) ========== */
.nav-minibar {
    position: fixed;
    top: 0;
    left: 0;
    width: 54px;
    height: 100vh;
    background: var(--primary);
    border-right: none;
    z-index: 998;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    gap: 4px;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-open .nav-minibar {
    transform: translateX(-60px);
}
.minibar-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-bottom: 6px;
}
.minibar-toggle:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}
.minibar-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    font-size: 1.15rem;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    position: relative;
}
.minibar-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}
.minibar-link.active {
    color: white;
    background: rgba(255,255,255,0.2);
}
.minibar-link.active::after {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
}
.minibar-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.badge-registration {
    background: #22c55e;
}
.badge-waiting {
    background: #eab308;
    top: auto;
    bottom: -2px;
}
.minibar-link i {
    transition: transform 0.2s;
}
.minibar-link:hover i {
    transform: scale(1.1);
}

.container { transition: padding-left 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.nav-closed .container { padding-left: 54px; }
.nav-open .container { padding-left: 0; }

/* ========== NAVIGATION LINKS ========== */
.nav-link {
display: flex;
align-items: center;
gap: 14px;
padding: 12px 20px;
color: #475569;
text-decoration: none;
margin: 2px 10px;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
font-weight: 500;
border-radius: 10px;
position: relative;
}
.nav-link:hover {
background: #f1f5f9;
color: #1e293b;
}
.nav-link.active {
background: var(--primary);
color: white;
box-shadow: 0 2px 8px rgba(var(--primary-rgb),0.2);
}
.nav-link.active::before {
content: '';
position: absolute;
left: -10px;
top: 50%;
transform: translateY(-50%);
width: 4px;
height: 24px;
background: var(--primary);
border-radius: 0 4px 4px 0;
}
.nav-link i {
width: 22px;
text-align: center;
font-size: 1.1rem;
transition: transform 0.2s;
}
.nav-link:hover i {
transform: translateX(2px);
}

/* ========== USER INFO IN SIDEBAR ========== */
.user-info-sidebar {
position: sticky;
bottom: 0;
margin-top: auto;
padding: 12px 16px;
background: #f8fafc;
border-top: 2px solid var(--primary);
backdrop-filter: blur(8px);
}
.user-info-sidebar .user-row {
display: flex;
align-items: center;
gap: 10px;
}
.user-info-sidebar .user-avatar {
width: 40px;
height: 40px;
background: var(--primary);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.2rem;
flex-shrink: 0;
box-shadow: 0 2px 8px rgba(var(--primary-rgb),0.2);
}
.user-info-sidebar .user-details {
flex: 1;
min-width: 0;
}
.user-info-sidebar .user-name {
font-weight: 700;
color: #1e293b;
font-size: 0.85rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-info-sidebar .user-role {
font-size: 0.7rem;
color: #64748b;
margin-top: 1px;
text-transform: uppercase;
letter-spacing: 0.5px;
font-weight: 600;
}
.user-info-sidebar .user-actions {
display: flex;
align-items: center;
gap: 6px;
margin-top: 8px;
padding-top: 8px;
border-top: 1px solid #e2e8f0;
}
.sidebar-settings-link {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
color: #475569;
text-decoration: none;
font-size: 0.8rem;
font-weight: 600;
border-radius: 8px;
transition: all 0.15s;
white-space: nowrap;
flex: 1;
}
.sidebar-settings-link:hover {
background: #e2e8f0;
color: var(--primary);
}
.sidebar-settings-link.active {
color: var(--primary);
}
.logout-btn {
background: #dc2626;
color: white;
border: none;
border-radius: 10px;
padding: 9px 18px;
font-size: 0.8rem;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 8px;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
white-space: nowrap;
box-shadow: 0 2px 8px rgba(220,38,38,0.2);
margin-left: auto;
}
.logout-btn:hover {
background: #b91c1c;
transform: translateY(-2px);
box-shadow: 0 6px 16px rgba(220,38,38,0.35);
}

/* ========== CONTACT EDITOR ========== */
.contact-editor-card {
background: white;
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 16px;
margin-bottom: 16px;
}
.contact-editor-card .remove-item {
background: #fee2e2;
color: #991b1b;
border: 1px solid #fecaca;
border-radius: 8px;
padding: 8px 12px;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
transition: all 0.2s;
margin-top: 8px;
}
.contact-editor-card .remove-item:hover {
background: #fecaca;
transform: translateY(-1px);
}

/* ========== CONTACTS LIST ========== */
.contacts-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.contact-item {
background: #fef6f6;
border: 1px solid #fee2e2;
border-radius: 12px;
padding: 14px 16px;
}
.contact-row {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 6px;
}
.contact-row:last-child {
margin-bottom: 0;
}
.contact-icon {
font-size: 1rem;
min-width: 20px;
}
.contact-name {
font-weight: 600;
color: var(--primary);
font-size: 0.95rem;
}
.contact-phone {
font-size: 0.9rem;
color: #1e293b;
}
.contact-position {
font-size: 0.85rem;
color: #64748b;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.no-contacts {
color: #64748b;
font-size: 0.9rem;
padding: 12px;
text-align: center;
}

/* ========== FIELD GROUPS ========== */
.field-group {
background: white;
border-radius: 16px;
padding: 20px;
margin-bottom: 16px;
border: 1px solid #e8ecf0;
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.field-group:hover {
box-shadow: 0 6px 20px rgba(0,0,0,0.07);
border-color: #d0d5db;
transform: translateY(-1px);
}
.field-group h4 {
font-size: 0.78rem;
font-weight: 700;
margin-bottom: 16px;
color: #1e293b;
text-transform: uppercase;
letter-spacing: 0.8px;
padding-bottom: 10px;
border-bottom: 2px solid #f0f2f5;
display: flex;
align-items: center;
gap: 8px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field-label { font-size: 0.75rem; color: #64748b; margin-bottom: 6px; display: block; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.field-value {
font-weight: 500;
color: #0f172a;
word-break: break-word;
background: #f8fafc;
padding: 10px 14px;
border-radius: 10px;
font-size: 0.88rem;
border: 1px solid #f0f2f5;
}
.tariff-row {
display: flex;
justify-content: space-between;
padding: 6px 0;
border-bottom: 1px solid #e2e8f0;
font-size: 0.8rem;
}
.tariff-daily {
font-weight: bold;
color: var(--primary);
}

/* ========== FILTER SIDEBAR ========== */
.filter-sidebar .filter-group { margin-bottom: 16px; }
.filter-sidebar .filter-group label {
color: var(--primary);
font-weight: 600;
margin-bottom: 6px;
display: block;
}
.filter-sidebar .filter-button { background: #f1f5f9; border: 1px solid #ddd; color: #1e293b; }
.filter-sidebar .filter-dropdown { position: static; margin-top: 6px; box-shadow: none; border: 1px solid #e2e8f0; }

/* ========== LOADING & NOTIFICATIONS ========== */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255,255,255,0.9);
display: flex;
align-items: center;
justify-content: center;
z-index: 2000;
}
.spinner { width: 40px; height: 40px; border: 4px solid #e2e8f0; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
.notification {
position: fixed;
bottom: 24px;
right: 24px;
padding: 14px 24px;
border-radius: 14px;
color: white;
font-weight: 600;
z-index: 2001;
background: #22c55e;
box-shadow: 0 8px 24px rgba(34,197,94,0.3);
min-width: 280px;
max-width: 420px;
animation: notificationSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
font-size: 0.9rem;
border: 1px solid rgba(255,255,255,0.15);
}
.notification.error { background: #ef4444; box-shadow: 0 8px 24px rgba(239,68,68,0.3); }
.notification.info { background: #3b82f6; box-shadow: 0 8px 24px rgba(59,130,246,0.3); }

@keyframes notificationSlide {
from { opacity: 0; transform: translateX(40px); }
to { opacity: 1; transform: translateX(0); }
}

/* ========== FORMS ========== */
.form-section {
background: #ffffff;
border-radius: 20px;
padding: 20px;
margin-bottom: 20px;
border: 1px solid #eef2f6;
box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.form-section h4 {
font-size: 0.9rem;
font-weight: 600;
margin-bottom: 18px;
color: #1e293b;
border-left: 3px solid var(--primary);
padding-left: 12px;
display: flex;
align-items: center;
gap: 8px;
}
.form-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
.form-grid-full {
grid-column: span 2;
}
.form-field {
margin-bottom: 0;
}
.form-field label {
display: block;
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #64748b;
margin-bottom: 6px;
}
.form-field input, .form-field select {
width: 100%;
padding: 10px 12px;
border: 1px solid #e2e8f0;
border-radius: 12px;
font-size: 0.85rem;
background: white;
transition: 0.2s;
}
.form-field input:focus, .form-field select:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 2px rgba(var(--primary-rgb),0.1);
}

/* ========== PREVIEW LIST ========== */
.preview-list {
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 16px;
padding: 8px;
max-height: 260px;
overflow-y: auto;
margin-top: 12px;
}
.preview-item {
padding: 8px 12px;
font-size: 0.8rem;
border-bottom: 1px solid #f0f0f0;
display: flex;
justify-content: space-between;
align-items: center;
}
.preview-item:last-child { border-bottom: none; }
.badge-preview {
background: #e2e8f0;
padding: 4px 10px;
border-radius: 30px;
font-size: 0.7rem;
color: #334155;
}

/* ========== DYNAMIC ITEMS ========== */
.dynamic-item, .contact-editor-card {
background: #ffffff;
border: 1px solid #e2e8f0;
border-radius: 16px;
padding: 16px;
margin-bottom: 16px;
transition: all 0.2s ease;
}
.dynamic-item:hover, .contact-editor-card:hover {
border-color: var(--primary);
}
.remove-item, .remove-contact-btn {
background: #fee2e2;
color: #991b1b;
border: none;
padding: 4px 12px;
border-radius: 8px;
font-size: 0.7rem;
cursor: pointer;
transition: 0.2s;
}
.remove-item:hover, .remove-contact-btn:hover { background: #fecaca; }
.daily-rate-preview {
font-size: 0.7rem;
color: #2c6e2c;
margin-top: 6px;
display: flex;
justify-content: space-between;
align-items: center;
background: #f1f5f9;
padding: 5px 10px;
border-radius: 10px;
}
.add-item-btn {
background: #f1f5f9;
border: 1px dashed var(--primary);
color: var(--primary);
padding: 8px 16px;
border-radius: 12px;
font-size: 0.8rem;
font-weight: 500;
cursor: pointer;
margin-top: 8px;
width: 100%;
transition: 0.2s;
}
.add-item-btn:hover {
background: #ffffff;
border: 1px solid var(--primary);
}
.select-with-option {
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
.select-with-option select {
flex: 2;
padding: 10px 12px;
border: 1px solid #e2e8f0;
border-radius: 12px;
background: white;
font-size: 0.85rem;
}
.select-with-option input {
flex: 1;
padding: 10px 12px;
border: 1px solid #e2e8f0;
border-radius: 12px;
font-size: 0.85rem;
min-width: 120px;
}
.select-with-option button {
background: var(--primary);
color: white;
border: none;
border-radius: 40px;
padding: 8px 20px;
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
transition: 0.2s;
}
.select-with-option button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ========== ADMIN NOTIFICATIONS ========== */
.admin-notif-bell {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
}
.admin-notif-bell:hover { background: rgba(255,255,255,0.15); }
.admin-notif-bell.active { background: rgba(255,255,255,0.2); color: #fff; }
.admin-notif-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    pointer-events: none;
}
.admin-notif-dropdown {
    position: fixed;
    top: 56px;
    right: 16px;
    width: 380px;
    max-height: 480px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 10001;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.15s ease;
}
.admin-notif-dropdown.show { display: flex; }
.admin-notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
}
.admin-notif-dropdown-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}
.admin-notif-clear-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: 0.2s;
}
.admin-notif-clear-btn:hover { background: #eff6ff; }
.admin-notif-delete-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: 0.2s;
}
.admin-notif-delete-btn:hover { background: #fef2f2; }
.admin-notif-dropdown-actions {
    display: flex;
    gap: 4px;
}
.admin-notif-item-delete {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    padding: 0;
    margin-top: 2px;
    transition: 0.15s;
}
.admin-notif-item-delete:hover { background: #fee2e2; color: #ef4444; }
.admin-notif-dropdown-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 400px;
}
.admin-notif-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
    padding: 32px 16px;
}
.admin-notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.15s;
    margin-bottom: 2px;
}
.admin-notif-item:hover { background: #f8fafc; }
.admin-notif-item.unread { background: #f0f7ff; }
.admin-notif-item.unread:hover { background: #e8f2fe; }
.admin-notif-item-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-top: 2px;
}
.admin-notif-item-content {
    flex: 1;
    min-width: 0;
}
.admin-notif-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}
.admin-notif-item-text {
    font-size: 0.73rem;
    color: #64748b;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-notif-item.expanded .admin-notif-item-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
.admin-notif-item-time {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 4px;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== LOADER ==================== */
.app-loader {
    position: fixed; inset: 0; z-index: 99999;
    background: linear-gradient(160deg, #0c0c14 0%, #141420 50%, #0a0a12 100%);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.app-loader::after {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(120,100,200,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, color-mix(in srgb, var(--primary) 8%, transparent) 0%, transparent 50%);
    pointer-events: none;
}
.app-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; position: relative; z-index: 1; }
.loader-letters {
    display: flex; justify-content: center; gap: 4px;
    min-height: 64px; align-items: baseline; margin-bottom: 32px;
}
.loader-letter {
    display: inline;
    font-size: 3.2rem; font-weight: 200; color: rgba(255,255,255,0.7);
    letter-spacing: 4px;
    transition: all 0.3s ease;
}
.loader-letter:nth-child(7) { color: color-mix(in srgb, var(--primary) 85%, white); }
.loader-letter.appear {
    animation: ldAppear 0.6s cubic-bezier(0.22,0.61,0.36,1) both;
}
@keyframes ldAppear {
    from { transform: translateY(24px); opacity: 0; letter-spacing: 12px; }
    to { transform: translateY(0); opacity: 1; letter-spacing: 4px; }
}
.loader-letter.scramble {
    animation: ldScramble 0.08s ease infinite;
}
@keyframes ldScramble {
    0%   { transform: translateY(0px); }
    25%  { transform: translateY(-2px); }
    75%  { transform: translateY(1px); }
    100% { transform: translateY(0px); }
}
.loader-letter.settle {
    animation: ldSettle 0.8s cubic-bezier(0.22,0.61,0.36,1) both;
}
@keyframes ldSettle {
    0%   { opacity: 0; transform: translateY(-16px) scale(0.8); filter: blur(4px); }
    50%  { opacity: 0.8; }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.loader-progress {
    width: 200px; height: 1px;
    background: rgba(255,255,255,0.04);
    margin: 0 auto; overflow: hidden; position: relative;
}
.loader-progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 40%, transparent), var(--primary), color-mix(in srgb, var(--primary) 40%, transparent));
    transition: width 0.3s ease;
}
