/* ========== CSS VARIABLES (ЦВЕТОВАЯ СХЕМА) ========== */
:root {
  --primary: #990000;
  --primary-dark: #7a0000;
  --primary-rgb: 153, 0, 0;
  --accent: #990000;
  --accent-rgb: 153, 0, 0;
  --bg: #f0f2f5;
  --surface: #ffffff;
  --on-surface: #1e293b;
  --on-surface-variant: #64748b;
  --surface-2: #f8fafc;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #cbd5e1;
  --border: #e2e8f0;
  --input-bg: #ffffff;
}
html[data-theme="dark"] {
  --bg: #0a0e1f;
  --surface: #131a38;
  --on-surface: #e6e9f5;
  --on-surface-variant: #7a83ab;
  --surface-2: #1a2348;
  --text: #e6e9f5;
  --text-secondary: #aab2d8;
  --text-muted: #7a83ab;
  --text-faint: #56618f;
  --border: #28305a;
  --input-bg: #0f142e;
  --accent: #9db4e8;
  --accent-rgb: 157, 180, 232;
}

/* ========== ОСНОВНЫЕ СТИЛИ ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
background: var(--surface-2);
color: var(--text);
line-height: 1.5;
height: 100vh;
overflow: hidden;
}
.container {
width: 100%;
height: 100vh;
background: var(--surface);
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(--accent-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);
}
.view-toggle {
    display: flex;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(4px);
    border-radius: 30px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    gap: 2px;
}
.view-toggle-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    height: 32px;
    padding: 0 14px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.view-toggle-btn:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.08);
}
.view-toggle-btn.active {
    background: var(--surface);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.view-toggle-btn i { font-size: 0.85rem; }

/* View toggle pills — like status-tab in shifts/requests */
.sd-view-pills {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.sd-view-pill {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    height: 32px;
    padding: 0 14px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.sd-view-pill:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.15); }
.sd-view-pill.active { background: var(--surface); border-color: white; color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,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: var(--surface);
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 var(--border);
display: flex;
flex-direction: column;
gap: 20px;
z-index: 20;
}
.auth-card h2 { text-align: center; color: var(--accent); font-size: 1.5rem; margin-bottom: 6px; font-weight: 700; }
.auth-card .form-group { width: 100%; }
.auth-card label { font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: block; font-size: 0.85rem; }
.auth-card .form-control {
width: 100%;
padding: 12px 16px;
border: 2px solid var(--border);
border-radius: 12px;
font-size: 0.95rem;
background: var(--surface-2);
transition: all 0.2s;
box-sizing: border-box;
}
.auth-card .form-control:focus {
border-color: var(--accent);
box-shadow: 0 0 0 4px rgba(var(--accent-rgb),0.08);
outline: none;
background: var(--surface);
}
.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(--accent-rgb),0.2);
}
.auth-card .btn:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(var(--accent-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: var(--surface);
    border-color: white;
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.filter-chip.active .filter-chip-icon {
    background: rgba(var(--accent-rgb),0.12);
    color: var(--accent);
}
.filter-chip.active .filter-chip-label,
.filter-chip.active .filter-chip-value { color: var(--accent); }
.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: var(--text); background: var(--surface); }
.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: var(--surface);
    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: var(--border); border-radius: 4px; }
/* Last filter in row: align right so items don't overflow screen */
.filters-row > .filter-group:last-child > .filter-dropdown { left: auto; right: 0; }
.filter-option {
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.filter-option:hover {
    background: rgba(var(--accent-rgb),0.08);
    color: var(--accent);
}
.filter-option.active { background: rgba(var(--accent-rgb),0.12); color: var(--accent); font-weight: 600; }
.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    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: var(--text);
    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(--accent);
    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: var(--text); background: var(--surface); }

.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: var(--surface);
color: var(--accent);
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: var(--surface-2); 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: var(--surface);
border-radius: 20px;
border: 1px solid var(--border);
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: var(--surface);
}
.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: var(--surface);
border-radius: 16px;
padding: 16px;
margin-bottom: 10px;
border: 1px solid var(--border);
cursor: pointer;
transition: all 0.2s;
box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.shop-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.08); }
.shop-card.selected { border-left: 4px solid var(--primary); background: var(--surface-2); }
.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: var(--text-muted); margin-bottom: 8px; display: flex; gap: 4px; }
.shop-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--surface-2); padding: 4px 10px; border-radius: 16px; font-size: 0.7rem; font-weight: 500; color: var(--text-secondary); }
.map-container {
flex: 1;
display: flex;
flex-direction: column;
border-radius: 20px;
overflow: hidden;
border: 1px solid var(--border);
background: var(--surface-2);
z-index: 5;
position: relative;
}
#map { 
    flex: 1;
    position: relative;
    min-height: 300px;
}
.tariff-table-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 28px 20px 28px;
    overflow: hidden;
    min-height: 0;
}
.tariff-table-wrap {
    flex: 1;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    overflow: auto;
}
.tariff-table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.tariff-table-wrap::-webkit-scrollbar-track { background: var(--surface-2); }
.tariff-table-wrap::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 4px; }
.tariff-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
}
.tariff-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}
.tariff-table thead tr th {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 10px;
    text-align: center;
    vertical-align: middle;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
}
.tariff-table thead tr th:hover {
    background: var(--primary-dark);
}
.tariff-table thead tr th { cursor: pointer; user-select: none; }
.tariff-table thead tr th.sorted-asc::after,
.tariff-table thead tr th.sorted-desc::after {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border: 4px solid transparent;
}
.tariff-table thead tr th.sorted-asc::after {
    border-top-color: #fff;
    border-bottom: none;
}
.tariff-table thead tr th.sorted-desc::after {
    border-bottom-color: #fff;
    border-top: none;
}
.tariff-table thead tr th:first-child {
    border-radius: 16px 0 0 0;
    padding-left: 16px;
    text-align: left;
}
.tariff-table thead tr th:last-child {
    border-radius: 0 16px 0 0;
    padding-right: 16px;
}
.tariff-table tbody tr {
    transition: background 0.12s;
}
.tariff-table tbody tr td {
    padding: 11px 14px;
    vertical-align: middle;
    color: var(--text);
    background: var(--surface);
    border-bottom: 1px solid var(--surface-2);
}
.tariff-table tbody tr:last-child td {
    border-bottom: none;
}
.tariff-table tbody tr:nth-child(even) td {
    background: var(--surface-2);
}
.tariff-table tbody tr td:first-child {
    padding-left: 18px;
    border-left: 3px solid transparent;
}
.tariff-table tbody tr td:last-child {
    padding-right: 18px;
}
.tariff-table tbody tr:hover td {
    background: rgba(239,68,68,0.07) !important;
}
.tariff-table tbody tr:hover td:first-child {
    border-left-color: var(--accent);
}
.tariff-shop-cell {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tariff-shop-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tariff-shop-name .shop-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.tariff-pos-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tariff-pos-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 6px;
    background: var(--surface-2);
    border-radius: 5px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.tariff-pos-chip i {
    color: #6366f1;
    font-size: 0.6rem;
}
.tariff-pos-chip .pos-rate {
    color: var(--text-muted);
    margin-left: 2px;
}
.tariff-pos-chip .pos-daily {
    font-weight: 700;
    color: var(--accent);
    margin-left: 2px;
}
.tariff-pos-chip .pos-daily::after {
    content: ' \20BD';
    font-weight: 500;
    font-size: 0.65rem;
    color: var(--text-muted);
}
.tariff-table-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.tariff-table-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.tariff-table-empty p {
    font-size: 1rem;
    font-weight: 500;
}
.table-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 20px;
}
.table-loader .spinner {
    width: 70px;
    height: 70px;
    border: 6px solid var(--surface-2);
    border-top: 6px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.table-loader span {
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tariff-tt-badge {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid;
}
.tariff-address {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.3;
}
.tariff-contacts {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.tariff-contact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.tariff-contact-row:not(:last-child)::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: var(--surface-2);
    margin: 2px 0;
}
.tariff-contact-name {
    font-weight: 600;
    color: var(--text);
}
.tariff-contact-phone {
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 500;
}
.tariff-contact-phone i {
    font-size: 0.6rem;
}
.tariff-contact-pos {
    color: var(--text-muted);
    font-size: 0.67rem;
}
.tariff-cell-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}
.tariff-cell-value {
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 500;
}
.tariff-no-data {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-style: italic;
}

.route-bar {
padding: 12px 16px;
background: var(--surface);
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: var(--surface-2);
border: 1px solid var(--border);
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: var(--surface);
border: 1px solid var(--border);
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: var(--surface);
border: 1px solid var(--border);
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: var(--text);
background: var(--surface);
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: var(--surface-2);
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: 0;
transform: translateX(-340px);
max-width: 300px;
box-shadow: 8px 0 40px rgba(0,0,0,0.15);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
background: var(--surface);
will-change: transform;
display: flex;
flex-direction: column;
z-index: 5000;
}
.nav-sidebar.open { transform: translateX(0); }
.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: var(--surface-2); }

/* ========== NAV MINIBAR (LEFT) ========== */
.nav-minibar {
    position: fixed;
    top: 0;
    left: 0;
    width: 54px;
    height: 100vh;
    background: var(--primary);
    border-right: none;
    z-index: 5001;
    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: var(--text-secondary);
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: var(--surface-2);
color: var(--text);
}
.nav-link.active {
background: var(--primary);
color: white;
box-shadow: 0 2px 8px rgba(var(--accent-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: var(--surface-2);
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(--accent-rgb),0.2);
}
.user-info-sidebar .user-details {
flex: 1;
min-width: 0;
}
.user-info-sidebar .user-name {
font-weight: 700;
color: var(--text);
font-size: 0.85rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-info-sidebar .user-role {
font-size: 0.7rem;
color: var(--text-muted);
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 var(--border);
}
.sidebar-settings-link {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
color: var(--text-secondary);
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: var(--border);
color: var(--accent);
}
.sidebar-settings-link.active {
color: var(--accent);
}
.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: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 16px;
margin-bottom: 16px;
}
.contact-editor-card .remove-item {
background: rgba(239,68,68,0.10);
color: #991b1b;
border: 1px solid rgba(239,68,68,0.18);
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: rgba(239,68,68,0.18);
transform: translateY(-1px);
}

/* ========== CONTACTS LIST ========== */
.contacts-list {
display: flex;
flex-direction: column;
gap: 12px;
}
.contact-item {
background: var(--surface-2);
border: 1px solid rgba(239,68,68,0.10);
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(--accent);
font-size: 0.95rem;
}
.contact-phone {
font-size: 0.9rem;
color: var(--text);
}
.contact-position {
font-size: 0.85rem;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.no-contacts {
color: var(--text-muted);
font-size: 0.9rem;
padding: 12px;
text-align: center;
}

/* ========== FIELD GROUPS ========== */
.field-group {
background: var(--surface);
border-radius: 16px;
padding: 20px;
margin-bottom: 16px;
border: 1px solid var(--border);
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: var(--border);
transform: translateY(-1px);
}
.field-group h4 {
font-size: 0.78rem;
font-weight: 700;
margin-bottom: 16px;
color: var(--text);
text-transform: uppercase;
letter-spacing: 0.8px;
padding-bottom: 10px;
border-bottom: 2px solid var(--border);
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: var(--text-muted); margin-bottom: 6px; display: block; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.field-value {
font-weight: 500;
color: var(--text);
word-break: break-word;
background: var(--surface-2);
padding: 10px 14px;
border-radius: 10px;
font-size: 0.88rem;
border: 1px solid var(--border);
}
.tariff-row {
display: flex;
justify-content: space-between;
padding: 6px 0;
border-bottom: 1px solid var(--border);
font-size: 0.8rem;
}
.tariff-daily {
font-weight: bold;
color: var(--accent);
}

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

/* ========== LOADING & NOTIFICATIONS ========== */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: color-mix(in srgb, var(--surface) 92%, transparent);
display: flex;
align-items: center;
justify-content: center;
z-index: 2000;
}
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top: 4px solid var(--accent); 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: var(--surface);
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: var(--text);
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: var(--text-muted);
margin-bottom: 6px;
}
.form-field input, .form-field select {
width: 100%;
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: 12px;
font-size: 0.85rem;
background: var(--surface);
transition: 0.2s;
}
.form-field input:focus, .form-field select:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 2px rgba(var(--accent-rgb),0.1);
}

/* ========== PREVIEW LIST ========== */
.preview-list {
background: var(--surface-2);
border: 1px solid var(--border);
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: var(--border);
padding: 4px 10px;
border-radius: 30px;
font-size: 0.7rem;
color: var(--text-secondary);
}

/* ========== DYNAMIC ITEMS ========== */
.dynamic-item, .contact-editor-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 16px;
margin-bottom: 16px;
transition: all 0.2s ease;
}
.dynamic-item:hover, .contact-editor-card:hover {
border-color: var(--accent);
}
.remove-item, .remove-contact-btn {
background: rgba(239,68,68,0.10);
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: rgba(239,68,68,0.18); }
.daily-rate-preview {
font-size: 0.7rem;
color: #2c6e2c;
margin-top: 6px;
display: flex;
justify-content: space-between;
align-items: center;
background: var(--surface-2);
padding: 5px 10px;
border-radius: 10px;
}
.add-item-btn {
background: var(--surface-2);
border: 1px dashed var(--primary);
color: var(--accent);
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: var(--surface);
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 var(--border);
border-radius: 12px;
background: var(--surface);
font-size: 0.85rem;
}
.select-with-option input {
flex: 1;
padding: 10px 12px;
border: 1px solid var(--border);
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: var(--surface);
    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 var(--surface-2);
}
.admin-notif-dropdown-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}
.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: var(--surface-2); }
.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: rgba(239,68,68,0.07); }
.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: var(--text-faint);
    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: rgba(239,68,68,0.10); color: #ef4444; }
.admin-notif-dropdown-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 400px;
}
.admin-notif-empty {
    text-align: center;
    color: var(--text-muted);
    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: var(--surface-2); }
.admin-notif-item.unread { background: var(--surface-2); }
.admin-notif-item.unread:hover { background: var(--surface-2); }
.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: var(--text);
    margin-bottom: 2px;
}
.admin-notif-item-text {
    font-size: 0.73rem;
    color: var(--text-muted);
    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: var(--text-muted);
    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;
    overflow: hidden;
}
.app-loader::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(120,100,200,0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, color-mix(in srgb, var(--primary) 10%, transparent) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--primary) 6%, transparent) 0%, transparent 60%);
    pointer-events: none;
}
.app-loader::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 280px; height: 280px;
    margin: -140px 0 0 -140px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary) 6%, transparent) 0%, transparent 70%);
    animation: ldPulse 3s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ldPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}
.app-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* Canvas for particle network */
#loaderCanvas {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Animated lines under the letters */
.loader-lines {
    position: relative;
    width: 60%;
    height: 0;
    margin: -6px auto 0;
    pointer-events: none;
    overflow: visible;
}
.loader-line {
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 50%, rgba(255,255,255,0.4)), transparent);
    animation: ldLineSweep 2.8s ease-in-out infinite;
    opacity: 0.3;
}
.loader-line:nth-child(2) {
    top: 5px;
    animation-delay: -1.4s;
    opacity: 0.15;
}
@keyframes ldLineSweep {
    0%   { transform: scaleX(0); opacity: 0; }
    30%  { transform: scaleX(1); opacity: 0.3; }
    70%  { transform: scaleX(1); opacity: 0.3; }
    100% { transform: scaleX(0); opacity: 0; }
}

.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: 36px;
    position: relative;
}
.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;
    text-shadow: 0 0 20px rgba(255,255,255,0.06);
}
.loader-letter:nth-child(7) {
    color: color-mix(in srgb, var(--primary) 85%, white);
    text-shadow: 0 0 30px color-mix(in srgb, var(--primary) 30%, transparent);
}
.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: 220px; height: 2px;
    background: rgba(255,255,255,0.06);
    margin: 0 auto; overflow: hidden; position: relative;
    border-radius: 2px;
}
.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;
    border-radius: 2px;
    box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 30%, transparent);
}

/* ==================== SHOP DETAIL OVERLAY ==================== */
.shop-detail {
    position: fixed; top: 0; left: 54px; right: 0; bottom: 0;
    z-index: 4000;
    background: var(--surface-2);
    display: flex; flex-direction: column;
    animation: sdSlideIn 0.3s cubic-bezier(0.22,0.61,0.36,1);
}
.nav-open .shop-detail { left: 0; }
@keyframes sdSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.sd-hero {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(var(--accent-rgb),0.25);
    position: relative; z-index: 5;
}
.sd-hero-avatar {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.3rem;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
}
.sd-hero-info { flex: 1; min-width: 0; }
.sd-hero-info h2 {
    margin: 0; font-size: 1.15rem; font-weight: 800;
    color: white; letter-spacing: 0.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sd-hero-meta {
    font-size: 0.75rem; color: rgba(255,255,255,0.7);
    display: flex; align-items: center; gap: 8px; margin-top: 2px;
}
.sd-hero-actions { display: flex; gap: 6px; flex-shrink: 0; }
.sd-btn-back {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 9999px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    font-size: 0.8rem; font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}
.sd-btn-back:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-1px);
}
.sd-btn-back.editing {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.4);
    color: #fca5a5;
}
.sd-btn-back.editing:hover {
    background: rgba(239,68,68,0.35);
    color: white;
}
.sd-tariff-edit-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--surface-2);
}
.sd-tariff-edit-card select,
.sd-tariff-edit-card input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.78rem;
    background: var(--surface);
}
.sd-tariff-edit-card select:focus,
.sd-tariff-edit-card input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.sd-tabs-wrap {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    flex-shrink: 0;
    display: flex;
}
.sd-tabs {
    display: flex; gap: 4px; padding: 10px 0;
}
.sd-tab {
    background: none; border: none;
    padding: 8px 16px;
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 9999px;
    display: flex; align-items: center; gap: 7px;
    transition: all 0.2s;
    white-space: nowrap;
}
.sd-tab:hover { background: var(--surface-2); color: var(--text); }
.sd-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.2);
}
.sd-tab i { font-size: 0.85rem; }
.sd-content {
    flex: 1; overflow-y: auto;
    padding: 20px 24px;
}
.sd-content::-webkit-scrollbar { width: 6px; }
.sd-content::-webkit-scrollbar-track { background: transparent; }
.sd-content::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 3px; }
.sd-panel { display: none; }
.sd-panel.active { display: block; }

/* ==================== INFO TAB: STATS ROW ==================== */
.sd-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.sd-stat-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.sd-stat-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}
.sd-stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.sd-stat-icon.blue { background: rgba(59,130,246,0.12); color: #2563eb; }
.sd-stat-icon.green { background: rgba(34,197,94,0.14); color: #16a34a; }
.sd-stat-icon.purple { background: rgba(168,85,247,0.10); color: #9333ea; }
.sd-stat-icon.orange { background: #ffedd5; color: #ea580c; }
.sd-stat-icon.red { background: rgba(239,68,68,0.10); color: #dc2626; }
.sd-stat-info { flex: 1; min-width: 0; }
.sd-stat-label {
    font-size: 0.65rem; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}
.sd-stat-value {
    font-size: 1.05rem; font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== INFO TAB: INFO STRIP ==================== */
.sd-info-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface));
    border-radius: 14px;
    border: 1px solid var(--border);
}
.sd-info-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}
.sd-info-chip i { font-size: 0.75rem; color: var(--text-muted); }

/* ==================== INFO TAB: SECTION (collapsible) ==================== */
.sd-section {
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.sd-section:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.sd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
}
.sd-section-header:hover { background: var(--surface-2); }
.sd-section-header.open { border-bottom-color: var(--border); }
.sd-section-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sd-section-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}
.sd-section-icon.blue { background: rgba(59,130,246,0.12); color: #2563eb; }
.sd-section-icon.green { background: rgba(34,197,94,0.14); color: #16a34a; }
.sd-section-icon.purple { background: rgba(168,85,247,0.10); color: #9333ea; }
.sd-section-icon.orange { background: #ffedd5; color: #ea580c; }
.sd-section-icon.red { background: rgba(239,68,68,0.10); color: #dc2626; }
.sd-section-icon.teal { background: rgba(20,184,166,0.14); color: #0d9488; }
.sd-section-title {
    font-size: 0.78rem; font-weight: 700;
    color: var(--text-secondary);
}
.sd-section-chevron {
    color: var(--text-muted); font-size: 0.7rem;
    transition: transform 0.2s;
}
.sd-section-header.open .sd-section-chevron {
    transform: rotate(180deg);
}
.sd-section-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.72rem; padding: 4px 6px;
    border-radius: 6px; transition: all 0.15s;
    display: inline-flex; align-items: center;
}
.sd-section-btn:hover { background: var(--surface-2); color: var(--text-secondary); }
.sd-section-body {
    padding: 16px 20px;
}
.sd-section-body.collapsed { display: none; }

/* ==================== INFO TAB: FIELD GRID ==================== */
.sd-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}
.sd-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sd-field.full { grid-column: span 2; }
.sd-field-label {
    font-size: 0.65rem; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex; align-items: center; gap: 4px;
}
.sd-field-value {
    font-size: 0.88rem; font-weight: 500;
    color: var(--text);
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 10px;
    border: 1px solid var(--surface-2);
    word-break: break-word;
    transition: border-color 0.2s, background 0.2s;
    line-height: 1.4;
    min-height: 24px;
}
.sd-field-value:hover { border-color: var(--border); background: var(--surface); }
.sd-field-value.sd-empty {
    color: var(--text-faint);
    font-style: italic;
    font-weight: 400;
}

/* ==================== INFO TAB: CONTACTS ==================== */
.sd-contact-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: var(--surface-2);
    border-radius: 12px;
    border: 1px solid var(--surface-2);
    margin-bottom: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sd-contact-item:last-child { margin-bottom: 0; }
.sd-contact-item:hover {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sd-contact-avatar {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, #000) 100%);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.sd-contact-info { flex: 1; min-width: 0; }
.sd-contact-name {
    font-size: 0.85rem; font-weight: 700; color: var(--text);
}
.sd-contact-detail {
    font-size: 0.72rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px; margin-top: 2px;
}
.sd-contact-detail i { font-size: 0.65rem; color: var(--text-muted); }
.sd-contact-detail a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.sd-contact-detail a:hover { text-decoration: underline; }

/* ==================== INFO TAB: TARIFFS ==================== */
.sd-tariff-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    background: var(--surface-2);
    border-radius: 12px;
    border: 1px solid var(--surface-2);
    margin-bottom: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.sd-tariff-item:last-child { margin-bottom: 0; }
.sd-tariff-item:hover {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sd-tariff-left { flex: 1; }
.sd-tariff-name {
    font-size: 0.88rem; font-weight: 700; color: var(--text);
}
.sd-tariff-lunch {
    font-size: 0.68rem; color: var(--text-muted); margin-top: 2px;
    display: flex; align-items: center; gap: 4px;
}
.sd-tariff-right { text-align: right; }
.sd-tariff-hourly {
    font-size: 1rem; font-weight: 800;
    color: var(--accent);
}
.sd-tariff-daily {
    font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;
}

/* ==================== INFO TAB: LUNCH RULES ==================== */
.sd-lunch-card {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(245,158,11,0.08) 0%, rgba(245,158,11,0.08) 100%);
    border-radius: 12px;
    border: 1px solid #fed7aa;
    font-size: 0.78rem;
    color: #78350f;
    line-height: 1.7;
}
.sd-lunch-card strong {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px;
    font-size: 0.82rem;
}
.sd-lunch-rule {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0;
}
.sd-lunch-rule .sd-lunch-hours {
    min-width: 90px;
    font-weight: 700;
    color: #92400e;
}
.sd-lunch-rule .sd-lunch-deduct {
    color: #a16207;
}
.sd-lunch-note {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(217,119,6,0.15);
    font-size: 0.7rem;
    color: #a16207;
}

/* ==================== CHARTS ==================== */
.sd-chart-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sd-chart-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.sd-chart-header i {
    color: var(--accent);
    font-size: 0.85rem;
}
.sd-chart-header .sd-chart-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.sd-chart-header .sd-chart-total {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    padding: 4px 12px;
    border-radius: 9999px;
}
.sd-chart-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--surface-2);
}
.sd-chart-row:last-child { border-bottom: none; }
.sd-chart-row-label {
    width: 110px;
    min-width: 110px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sd-chart-row-bar-wrap {
    flex: 1;
    height: 26px;
    background: var(--surface-2);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.sd-chart-row-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.22,0.61,0.36,1);
    min-width: 3px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}
.sd-chart-row-bar span {
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.sd-chart-row-value {
    width: 60px;
    min-width: 60px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
    text-align: right;
}
.sd-chart-empty {
    color: var(--text-faint);
    font-style: italic;
    font-size: 0.82rem;
    padding: 30px 0;
    text-align: center;
}

/* ==================== EMPLOYEES TAB ==================== */
.sd-emp-group {
    margin-bottom: 16px;
}
.sd-emp-group-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    margin-bottom: 6px;
}
.sd-emp-group-header:hover { background: var(--surface-2); border-color: var(--border); }
.sd-emp-group-left {
    display: flex; align-items: center; gap: 8px;
    flex: 1; font-size: 0.8rem; font-weight: 700; color: var(--text);
}
.sd-emp-group-left i { font-size: 0.8rem; }
.sd-emp-group-count-badge {
    font-size: 0.62rem; font-weight: 700;
    color: var(--text-muted);
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: 9999px;
}
.sd-emp-group-chevron {
    font-size: 0.65rem; color: var(--text-muted);
    transition: transform 0.2s;
}
.sd-emp-group-header.open .sd-emp-group-chevron {
    transform: rotate(180deg);
}
.sd-emp-group-body { overflow: hidden; }
.sd-emp-group-body.sd-emp-group-collapsed { display: none; }

.sd-emp-subgroup {
    margin: 0 0 6px 12px;
}
.sd-emp-subgroup-header {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
    transition: background 0.15s;
}
.sd-emp-subgroup-header:hover { background: var(--surface-2); }
.sd-emp-subgroup-header i { font-size: 0.7rem; }
.sd-emp-subgroup-header .sd-emp-group-count-badge {
    font-size: 0.58rem; padding: 1px 6px;
}
.sd-emp-subgroup-header .sd-emp-group-chevron {
    margin-left: auto;
}
.sd-emp-subgroup-header.open .sd-emp-group-chevron {
    transform: rotate(180deg);
}

.sd-emp-card {
    background: var(--surface);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border: 1px solid var(--surface-2);
    display: flex;
    gap: 10px;
    transition: all 0.15s;
    align-items: flex-start;
}
.sd-emp-card:hover {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sd-emp-avatar {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 800;
    flex-shrink: 0;
    color: white;
    letter-spacing: 0.5px;
}
.sd-emp-avatar-0 { background: linear-gradient(135deg, #6366f1, #818cf8); }
.sd-emp-avatar-1 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.sd-emp-avatar-2 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.sd-emp-avatar-3 { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }
.sd-emp-avatar-4 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.sd-emp-card-body { flex: 1; min-width: 0; }
.sd-emp-card-top {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.sd-emp-name {
    font-size: 0.8rem; font-weight: 700; color: var(--text);
}
.sd-emp-badges {
    display: flex; gap: 3px; flex-wrap: wrap;
}
.sd-emp-badge {
    display: inline-flex;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.sd-emp-badge-green { background: rgba(34,197,94,0.14); color: #166534; }
.sd-emp-badge-yellow { background: rgba(250,204,21,0.14); color: #854d0e; }
.sd-emp-badge-red { background: rgba(239,68,68,0.10); color: #991b1b; }
.sd-emp-badge-gray { background: var(--surface-2); color: var(--text-muted); }
.sd-emp-badge-blue { background: rgba(59,130,246,0.12); color: #1e40af; }

.sd-emp-meta {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 2px;
    margin-top: 3px;
}
.sd-emp-meta-item {
    font-size: 0.68rem; color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 3px;
}
.sd-emp-meta-item i { color: var(--text-muted); font-size: 0.58rem; }
.sd-emp-meta-dot {
    color: var(--text-faint); font-size: 0.6rem; margin: 0 3px;
}

.sd-emp-stats {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 4px;
    margin-top: 4px;
}
.sd-emp-stat {
    font-size: 0.65rem; font-weight: 600; color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    background: var(--surface-2);
    border-radius: 4px;
    border: 1px solid var(--surface-2);
}
.sd-emp-stat i { color: var(--text-muted); font-size: 0.58rem; }
.sd-emp-stats-dot {
    color: var(--text-faint); font-size: 0.55rem;
}

.sd-emp-empty {
    font-size: 0.75rem; color: var(--text-faint); font-style: italic;
    text-align: center; padding: 14px;
}

/* ==================== SHIFTS TAB ==================== */

/* -- Filter panel (matches sd-info-strip) -- */
.sd-shift-filter {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--primary);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.sd-shift-filter-row {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
/* Styling for filters inside the shift-filter card */
.sd-shift-filter .search-group { flex: 1 1 180px; min-width: 150px; }
.sd-shift-filter .filter-chip select,
.sd-shift-filter .filter-chip input[type="date"] {
    border: none; background: none; color: white;
    font-size: 12px; outline: none; cursor: pointer;
}
.sd-shift-filter .filter-chip select { min-width: 80px; }
.sd-shift-filter .filter-chip select option { color: var(--text); background: var(--surface); }
.sd-shift-filter .filter-chip input[type="date"] { width: 110px; }
.sd-shift-filter .filter-chip input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer; filter: invert(1); opacity: 0.5;
}
.sd-shift-toggle-group {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 9999px; height: 34px; padding: 0 14px;
    cursor: pointer; color: rgba(255,255,255,0.7); font-size: 0.72rem;
    font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.15s; white-space: nowrap;
}
.sd-shift-toggle-group:hover { background: rgba(255,255,255,0.2); color: white; }
.sd-shift-toggle-group.active { background: rgba(255,255,255,0.25); color: white; }

/* -- Summary info panel (primary color scheme) -- */
.sd-shift-summary {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--primary);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    align-items: center;
}
.sd-shift-summary-item {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 12px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.9);
    white-space: nowrap;
}
.sd-shift-summary-icon-sm {
    width: 22px; height: 22px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.55rem;
    flex-shrink: 0;
}
.sd-shift-summary-lbl { color: rgba(255,255,255,0.55); font-weight: 700; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.3px; }
.sd-shift-summary-val-sm { font-weight: 700; font-size: 0.72rem; color: white; }

/* -- Day group (matches sd-emp-group) -- */
.sd-sc-day { margin-bottom: 16px; }
.sd-sc-day-title {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    margin-bottom: 6px;
}
.sd-sc-day-title:hover { background: var(--surface-2); border-color: var(--border); }
.sd-sc-day-title.has-diff { background: rgba(250,204,21,0.14); border-color: #eab308; }
.sd-sc-day-title.has-diff:hover { background: rgba(250,204,21,0.25); }
.sd-sc-day-title.has-orphan { background: rgba(239,68,68,0.10); border-color: #fca5a5; }
.sd-sc-day-title.has-orphan:hover { background: rgba(239,68,68,0.18); }
.sd-sc-day-title::before {
    content: '';
    display: none;
}
.sd-sc-day-date {
    font-size: 0.8rem; font-weight: 700; color: var(--text);
}
.sd-sc-day-dow {
    font-size: 0.68rem; font-weight: 600; color: var(--text-muted);
    margin-right: 4px;
}
.sd-sc-day-stats {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.8rem; font-weight: 500;
}
.sd-sc-day-stat-req { color: #2563eb; }
.sd-sc-day-stat-shift { color: #990000; }
.sd-sc-day-stat-h { font-size: 0.78rem; font-weight: 800; }
.sd-sc-day-stat-h-req { color: #2563eb; }
.sd-sc-day-stat-h-shift { color: #990000; }
.sd-sc-day-stat-sep { color: var(--text-faint); font-weight: 400; }
.sd-sc-day-diff {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 800;
}
.sd-sc-day-chevron {
    font-size: 0.65rem; color: var(--text-muted);
    transition: transform 0.2s;
}
.sd-sc-day.sd-sc-day-collapsed .sd-sc-day-chevron { transform: rotate(180deg); }

/* Day body — collapsible */
.sd-sc-day-body { overflow: hidden; }
.sd-sc-day.sd-sc-day-collapsed .sd-sc-day-body { display: none; }

/* -- Employee cards (matches sd-emp-card) -- */
.sd-sc-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--surface);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border: 1px solid var(--surface-2);
    transition: all 0.15s;
}
.sd-sc-card:hover {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sd-sc-card:last-child { margin-bottom: 0; }

.sd-sc-card-ok          { border-left: 3px solid #16a34a; }
.sd-sc-card-no          { border-left: 3px solid #dc2626; }
.sd-sc-card-only-req    { border-left: 3px solid #3b82f6; }
.sd-sc-card-only-shift  { border-left: 3px solid #990000; }

/* Status icon */
.sd-sc-card-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
}
.sd-sc-icon-ok   { background: rgba(34,197,94,0.14); color: #16a34a; }
.sd-sc-icon-no   { background: rgba(239,68,68,0.10); color: #dc2626; }
.sd-sc-icon-only-req { background: rgba(59,130,246,0.12); color: #2563eb; }
.sd-sc-icon-only-shift { background: rgba(239,68,68,0.07); color: #990000; }

/* Card body */
.sd-sc-card-body { flex: 1; min-width: 0; }

/* Top row: name + position */
.sd-sc-card-top {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.sd-sc-card-name { font-weight: 700; font-size: 0.8rem; color: var(--text); }
.sd-sc-card-pos {
    font-size: 0.65rem; font-weight: 600; color: var(--text-muted);
    margin-left: auto; white-space: nowrap;
}

/* -- Data lines (request / shift) -- */
.sd-sc-card-line {
    display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap;
    font-size: 0.68rem;
    color: var(--text-secondary);
    padding: 4px 8px;
    line-height: 1.4;
    border-radius: 6px;
    margin-top: 4px;
}
.sd-sc-card-line:first-of-type { margin-top: 0; }

/* Request line — blue */
.sd-sc-card-line-req {
    background: var(--surface-2);
    border-left: 2px solid #3b82f6;
}
.sd-sc-card-line-req .sd-sc-card-tag { background: #3b82f6; color: #fff; }

/* Shift line — red (990000) */
.sd-sc-card-line-shift {
    background: rgba(239,68,68,0.07);
    border-left: 2px solid #990000;
}
.sd-sc-card-line-shift .sd-sc-card-tag { background: #990000; color: #fff; }

/* Tag badge */
.sd-sc-card-tag {
    font-size: 0.55rem; font-weight: 700;
    padding: 1px 7px; border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 3px;
}

/* LKK ID */
.sd-sc-lkk {
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 0.6rem; font-weight: 600;
    color: #0e7490;
    background: #cffafe;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #a5f3fc;
}

/* Comment */
.sd-sc-comment {
    font-style: italic;
    font-size: 0.6rem;
    color: var(--text-muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Missing */
.sd-sc-missing { color: var(--text-faint); font-style: italic; font-size: 0.68rem; }

/* Shift status badge (same as shifts module) */
.sd-sc-shift-status {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 8px;
    font-size: 0.62rem; font-weight: 600;
}
.sd-sc-shift-status.paid { background: rgba(34,197,94,0.14); color: #166534; }
.sd-sc-shift-status.unpaid { background: #fce4ec; color: #b71c1c; }
.sd-sc-shift-status.waiting { background: rgba(250,204,21,0.14); color: #854d0e; }

/* Payment type badge (same as shifts module) */
.sd-sc-pay {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 8px;
    font-size: 0.62rem; font-weight: 600;
}
.sd-sc-pay.jf { background: #2563eb; color: #fff; }
.sd-sc-pay.card { background: #7c3aed; color: #fff; }
.sd-sc-pay.gph { background: #059669; color: #fff; }
.sd-sc-pay.cash { background: #d97706; color: #fff; }
.sd-sc-pay.self { background: #0891b2; color: #fff; }

/* Hours */
.sd-sc-hours-total { font-weight: 600; color: var(--text-muted); }
.sd-sc-lunch { font-weight: 500; color: #d97706; }
.sd-sc-hours-req { font-weight: 700; color: #2563eb; }
.sd-sc-hours-shift { font-weight: 700; color: #990000; }

/* Dot separator */
.sd-sc-dot { color: var(--border); font-size: 0.4rem; }

/* Empty state */
.sd-shift-empty {
    text-align: center; padding: 48px 16px;
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    color: var(--text-muted); font-size: 0.82rem;
}
.sd-shift-empty i {
    display: block; font-size: 2rem; margin-bottom: 12px; color: var(--text-faint);
}
.sd-shift-empty-sub {
    font-size: 0.68rem; color: var(--text-faint); margin-top: 6px;
}

/* ========== ТЁМНАЯ ТЕМА: читаемость статусных цветов ========== */
html[data-theme="dark"] {
  color-scheme: dark;
}
html[data-theme="dark"] .btn-secondary { background: var(--surface-2); color: var(--text-secondary); border-color: var(--border); }
html[data-theme="dark"] .btn-secondary:hover { background: var(--surface); }
html[data-theme="dark"] .sd-stat-icon.green, html[data-theme="dark"] .sd-section-icon.green, html[data-theme="dark"] .ed-section-icon.green { color: #4ade80; }
html[data-theme="dark"] .sd-stat-icon.blue, html[data-theme="dark"] .sd-section-icon.blue, html[data-theme="dark"] .ed-section-icon.blue { color: #60a5fa; }
html[data-theme="dark"] .sd-stat-icon.orange, html[data-theme="dark"] .sd-section-icon.orange, html[data-theme="dark"] .ed-section-icon.orange { color: #fb923c; }
html[data-theme="dark"] .sd-stat-icon.red, html[data-theme="dark"] .sd-section-icon.red, html[data-theme="dark"] .ed-section-icon.red { color: #f87171; }
html[data-theme="dark"] .sd-stat-icon.teal, html[data-theme="dark"] .sd-section-icon.teal, html[data-theme="dark"] .ed-section-icon.teal { color: #2dd4bf; }
html[data-theme="dark"] .sd-stat-icon.purple, html[data-theme="dark"] .sd-section-icon.purple { color: #c4b5fd; }
html[data-theme="dark"] .sd-emp-badge-green, html[data-theme="dark"] .ed-chip-green { color: #86efac; background: rgba(34,197,94,0.14); }
html[data-theme="dark"] .sd-emp-badge-yellow, html[data-theme="dark"] .ed-chip-yellow { color: #fde68a; background: rgba(245,158,11,0.14); }
html[data-theme="dark"] .sd-emp-badge-red, html[data-theme="dark"] .ed-chip-red { color: #fca5a5; background: rgba(239,68,68,0.14); }
html[data-theme="dark"] .sd-emp-badge-blue, html[data-theme="dark"] .ed-chip-blue { color: #93c5fd; background: rgba(59,130,246,0.14); }
html[data-theme="dark"] .badge-goodt-added, html[data-theme="dark"] .badge-consent-received, html[data-theme="dark"] .badge-medbook-active, html[data-theme="dark"] .badge-account-active, html[data-theme="dark"] .btn-doc-folder, html[data-theme="dark"] .doc-card .review-btn-ok { color: #86efac; background: rgba(34,197,94,0.14); }
html[data-theme="dark"] .badge-goodt-error, html[data-theme="dark"] .badge-consent-no, html[data-theme="dark"] .badge-medbook-missing, html[data-theme="dark"] .badge-account-disabled { color: #fda4af; background: rgba(239,68,68,0.14); }
html[data-theme="dark"] .badge-goodt-waiting, html[data-theme="dark"] .badge-status-cash, html[data-theme="dark"] .badge-consent-sent, html[data-theme="dark"] .badge-medbook-expired, html[data-theme="dark"] .step-icon.profile { color: #fb923c; background: rgba(245,158,11,0.14); }
html[data-theme="dark"] .badge-status-gph { color: #60a5fa; background: rgba(59,130,246,0.14); }
html[data-theme="dark"] .badge-status-self, html[data-theme="dark"] .badge-account-registration { color: #fde68a; background: rgba(250,204,21,0.14); }
html[data-theme="dark"] .badge-status-contract { color: #86efac; background: rgba(132,204,22,0.14); }
html[data-theme="dark"] .badge-status-notwork { color: #f9a8d4; background: rgba(236,72,153,0.14); }
html[data-theme="dark"] .badge-status-noshift { color: #c4b5fd; background: rgba(168,85,247,0.14); }
html[data-theme="dark"] .badge-status-forbid { color: #94a3b8; background: rgba(100,116,139,0.18); }
html[data-theme="dark"] .ed-comment-category.cat-problem, html[data-theme="dark"] .doc-card .review-btn-no { color: #fca5a5; background: rgba(239,68,68,0.12); }
html[data-theme="dark"] .ed-comment-category.cat-feature { color: #93c5fd; background: rgba(59,130,246,0.12); }
html[data-theme="dark"] .ed-comment-category.cat-warning { color: #fde68a; background: rgba(245,158,11,0.12); }
html[data-theme="dark"] .sd-sc-shift-status.paid, html[data-theme="dark"] .ed-s-status.paid { color: #86efac; background: rgba(34,197,94,0.14); }
html[data-theme="dark"] .sd-sc-shift-status.waiting, html[data-theme="dark"] .ed-s-status.waiting { color: #fde68a; background: rgba(245,158,11,0.14); }
html[data-theme="dark"] .ed-s-status.unpaid { color: #fca5a5; background: rgba(239,68,68,0.12); }
html[data-theme="dark"] .shop-badge-gm, html[data-theme="dark"] .pay-jf, html[data-theme="dark"] .pay-card { color: #93c5fd; background: rgba(59,130,246,0.14); }
html[data-theme="dark"] .pay-cash { color: #fde68a; background: rgba(245,158,11,0.14); }
html[data-theme="dark"] .pay-gph { color: #86efac; background: rgba(34,197,94,0.16); }
html[data-theme="dark"] .pay-self { color: #67e8f9; background: rgba(8,145,178,0.16); }
html[data-theme="dark"] .shop-badge-mm { color: #86efac; background: rgba(34,197,94,0.14); }
html[data-theme="dark"] .dfr-btn:hover { color: inherit; }
html[data-theme="dark"] .ms-bonus-btn:hover { color: #86efac; }
html[data-theme="dark"] .ms-fine-btn:hover { color: #fda4af; }
html[data-theme="dark"] .comment-orange { color: #fdba74; background: rgba(245,158,11,0.12); }
html[data-theme="dark"] .excel-result-section-title.success { color: #4ade80; }
html[data-theme="dark"] .excel-result-section-title.error, html[data-theme="dark"] #exportNotification.error { color: #fca5a5; }
html[data-theme="dark"] .notification.success { color: #86efac; background: rgba(34,197,94,0.16); border-color: rgba(34,197,94,0.3); }
html[data-theme="dark"] .notification.error, html[data-theme="dark"] .reg-notification.error { color: #fca5a5; background: rgba(239,68,68,0.16); border-color: rgba(239,68,68,0.3); }
html[data-theme="dark"] .notification.info { color: #93c5fd; background: rgba(59,130,246,0.14); border-color: rgba(59,130,246,0.3); }
html[data-theme="dark"] .ed-chip-purple { color: #c4b5fd; background: rgba(168,85,247,0.14); border-color: rgba(168,85,247,0.3); }
html[data-theme="dark"] .ed-chip-purple i { color: #c4b5fd; }
html[data-theme="dark"] .badge-status-forbid { color: #94a3b8; background: rgba(100,116,139,0.18); }
html[data-theme="dark"] select option { background: var(--surface); color: var(--text); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="number"], html[data-theme="dark"] input[type="date"], html[data-theme="dark"] input[type="password"], html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: var(--input-bg); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .form-control::placeholder, html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: var(--text-faint); }