/* ════════════════════════════════════════════════
   Электронная очередь — ОКБ — Design System (Light + Dark)
   ════════════════════════════════════════════════ */

:root {
    --primary:        #1565c0;
    --primary-dark:   #0d47a1;
    --primary-light:  #1976d2;
    --accent:         #0288d1;
    --accent-light:   #29b6f6;

    --success:        #2e7d32;
    --success-light:  #43a047;
    --warning:        #e65100;
    --warning-light:  #f57c00;
    --danger:         #c62828;
    --danger-light:   #e53935;
    --info:           #006064;
    --info-light:     #0097a7;

    --bg:             #f0f4f8;
    --surface:        #ffffff;
    --surface-2:      #f8fafc;
    --surface-3:      #f1f5f9;

    --text-primary:   #1a2942;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;

    --border:         #e2e8f0;
    --border-focus:   var(--primary);

    --shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
    --shadow-lg:      0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl:      0 20px 50px rgba(0,0,0,0.12);

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;

    --transition: 0.2s ease;

    --sidebar-bg-start: #0a3d6b;
    --sidebar-bg-end:   #1565c0;
    --header-bg-start:  var(--primary);
    --header-bg-end:    var(--accent);
}

[data-theme="dark"] {
    --bg:             #0f172a;
    --surface:        #1e293b;
    --surface-2:      #233148;
    --surface-3:      #2c3a52;

    --text-primary:   #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted:     #94a3b8;

    --border:         #334155;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:      0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
    --shadow-lg:      0 10px 30px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.3);

    --sidebar-bg-start: #06182d;
    --sidebar-bg-end:   #0e2a4d;
    --header-bg-start:  #0d47a1;
    --header-bg-end:    #00796b;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
    transition: background-color 0.25s ease, color 0.25s ease;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Сайдбар ── */
.sidebar {
    position: fixed; top: 0; left: 0;
    height: 100vh; width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    z-index: 1000;
    overflow-y: auto;
    transition: transform var(--transition);
    display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.sidebar.collapsed { transform: translateX(-260px); }

.sidebar-header {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}
.sidebar-header:hover {
    background: rgba(255,255,255,0.04);
    color: inherit;
}
a.sidebar-header, a.sidebar-header:hover, a.sidebar-header:focus {
    color: inherit;
    text-decoration: none;
}
.sidebar-logo {
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: white; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
}
.sidebar-brand { flex: 1; min-width: 0; }
.sidebar-brand h4 { margin: 0; font-size: 1rem; font-weight: 700; color: white; line-height: 1.2; }
.sidebar-brand small {
    font-size: 0.72rem; color: rgba(255,255,255,0.55);
    letter-spacing: 0.4px; text-transform: uppercase;
}

.sidebar-menu { list-style: none; padding: 0.75rem 0; margin: 0; flex: 1; }
.sidebar-section-label {
    padding: 1rem 1.25rem 0.35rem;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: rgba(255,255,255,0.4);
}
.sidebar-menu li { padding: 0 0.6rem; margin: 1px 0; }
.sidebar-menu a {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 0.9rem; color: rgba(255,255,255,0.8);
    border-radius: var(--radius-md); transition: all var(--transition);
    font-size: 0.875rem; font-weight: 500; position: relative;
}
.sidebar-menu a:hover { background: rgba(255,255,255,0.1); color: white; transform: translateX(2px); }
.sidebar-menu a.active {
    background: rgba(255,255,255,0.18); color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.sidebar-menu a.active::before {
    content: ''; position: absolute; left: -0.6rem;
    top: 25%; bottom: 25%; width: 3px; background: white;
    border-radius: 0 2px 2px 0;
}
.sidebar-menu a i { font-size: 1.1rem; width: 22px; flex-shrink: 0; opacity: 0.85; }
.sidebar-menu a.active i, .sidebar-menu a:hover i { opacity: 1; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 0.5rem 1.25rem; }
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1); flex-shrink: 0;
}

/* ── Контент ── */
.content-with-sidebar {
    margin-left: 260px;
    transition: margin-left var(--transition);
    min-height: 100vh;
    display: flex; flex-direction: column;
}
.content-with-sidebar.no-sidebar { margin-left: 0; }

/* ── Шапка ── */
.main-header {
    background: linear-gradient(135deg, var(--header-bg-start) 0%, var(--header-bg-end) 100%);
    box-shadow: 0 2px 12px rgba(21,101,192,0.25);
    padding: 0.875rem 1.75rem;
    color: white; position: sticky; top: 0; z-index: 999;
    display: flex; align-items: center;
}
.main-header .header-title {
    font-size: 1rem; font-weight: 600; color: white;
    display: flex; align-items: center; gap: 0.5rem;
    text-decoration: none;
    transition: opacity var(--transition);
}
.main-header a.header-title:hover,
.main-header a.header-title:focus {
    color: white;
    opacity: 0.85;
    text-decoration: none;
}
.search-box { position: relative; max-width: 280px; }
.search-box input {
    padding: 0.45rem 0.875rem 0.45rem 2.5rem;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.12);
    color: white; font-size: 0.85rem;
    transition: all var(--transition);
}
.search-box input:focus {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    outline: none; box-shadow: none;
}
.search-box input::placeholder { color: rgba(255,255,255,0.6); }
.search-box i {
    position: absolute; left: 0.8rem; top: 50%;
    transform: translateY(-50%); color: rgba(255,255,255,0.65); font-size: 0.85rem;
}
.header-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.2); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: white;
    border: 1.5px solid rgba(255,255,255,0.35);
}

/* Переключатель темы */
.theme-toggle {
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.25);
    color: white;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,0.25); transform: rotate(15deg); }

/* ── Карточки ── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    color: var(--text-primary);
    transition: box-shadow var(--transition), transform var(--transition);
    margin-bottom: 1.25rem;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-header {
    font-weight: 600; font-size: 0.9rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 1rem 1.25rem; border-bottom: none;
    display: flex; align-items: center; gap: 0.5rem;
}
.card-header.bg-success { background: linear-gradient(135deg, var(--success-light) 0%, var(--success) 100%) !important; }
.card-header.bg-warning { background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning) 100%) !important; color: white !important; }
.card-header.bg-info    { background: linear-gradient(135deg, var(--info-light) 0%, var(--info) 100%) !important; }
.card-header.bg-danger  { background: linear-gradient(135deg, var(--danger-light) 0%, var(--danger) 100%) !important; }
.card-body { padding: 1.25rem; color: var(--text-primary); }
.card-footer {
    padding: 0.75rem 1.25rem;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.crm-card {
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    background: var(--surface); border: 1px solid var(--border);
    overflow: hidden; transition: all var(--transition);
    margin-bottom: 1.25rem; color: var(--text-primary);
}
.crm-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.crm-card-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; font-weight: 600; font-size: 0.9rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.crm-card-header.bg-success { background: linear-gradient(135deg, var(--success-light) 0%, var(--success) 100%); }
.crm-card-header.bg-warning { background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning) 100%); }
.crm-card-header.bg-info    { background: linear-gradient(135deg, var(--info-light) 0%, var(--info) 100%); }
.crm-card-body { padding: 1.25rem; }

/* ── Stat cards ── */
.stat-card {
    border-radius: var(--radius-lg); background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: all 0.25s ease; overflow: hidden; position: relative;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.primary::before { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success-light), var(--success)); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning-light), var(--warning)); }
.stat-card.info::before    { background: linear-gradient(90deg, var(--info-light), var(--info)); }
.stat-card.danger::before  { background: linear-gradient(90deg, var(--danger-light), var(--danger)); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.stat-card .card-body {
    padding: 1.5rem 1.25rem 1.25rem;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}
[data-theme="dark"] .stat-card.primary .stat-icon { background: rgba(33,150,243,0.15); color: var(--accent-light); }
[data-theme="dark"] .stat-card.success .stat-icon { background: rgba(76,175,80,0.15); color: var(--success-light); }
[data-theme="dark"] .stat-card.warning .stat-icon { background: rgba(255,152,0,0.15); color: var(--warning-light); }
[data-theme="dark"] .stat-card.info .stat-icon    { background: rgba(0,188,212,0.15); color: var(--info-light); }
[data-theme="dark"] .stat-card.danger .stat-icon  { background: rgba(244,67,54,0.15); color: var(--danger-light); }
.stat-card.primary .stat-icon  { background: #e3eeff; color: var(--primary); }
.stat-card.success .stat-icon  { background: #e6f4ea; color: var(--success); }
.stat-card.warning .stat-icon  { background: #fff3e0; color: var(--warning); }
.stat-card.info .stat-icon     { background: #e0f7fa; color: var(--info); }
.stat-card.danger .stat-icon   { background: #ffebee; color: var(--danger); }

.stat-info { flex: 1; min-width: 0; }
.stat-label {
    font-size: 0.78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--text-muted); margin-bottom: 0.35rem; line-height: 1.2;
}
.stat-value {
    font-size: 2rem; font-weight: 700; line-height: 1;
    color: var(--text-primary); letter-spacing: -0.5px;
}

.widget-stat {
    text-align: center; padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg); background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.widget-stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.widget-stat-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.85; }
.widget-stat-value { font-size: 2.25rem; font-weight: 700; margin: 0.5rem 0; line-height: 1; color: var(--text-primary); }
.widget-stat-label {
    color: var(--text-muted); font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}

/* ── Кнопки ── */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.875rem;
    padding: 0.55rem 1.1rem;
    transition: all var(--transition); border: none;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white; box-shadow: 0 2px 8px rgba(21,101,192,0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-1px); box-shadow: 0 4px 14px rgba(21,101,192,0.35); color: white;
}
.btn-success {
    background: linear-gradient(135deg, var(--success-light) 0%, var(--success) 100%);
    color: white; box-shadow: 0 2px 8px rgba(46,125,50,0.25);
}
.btn-success:hover {
    background: linear-gradient(135deg, var(--success) 0%, #1b5e20 100%);
    transform: translateY(-1px); box-shadow: 0 4px 14px rgba(46,125,50,0.35); color: white;
}
.btn-warning {
    background: linear-gradient(135deg, var(--warning-light) 0%, var(--warning) 100%);
    color: white; box-shadow: 0 2px 8px rgba(230,81,0,0.25);
}
.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning) 0%, #bf360c 100%);
    transform: translateY(-1px); box-shadow: 0 4px 14px rgba(230,81,0,0.35); color: white;
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger-light) 0%, var(--danger) 100%);
    color: white; box-shadow: 0 2px 8px rgba(198,40,40,0.25);
}
.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger) 0%, #b71c1c 100%);
    transform: translateY(-1px); box-shadow: 0 4px 14px rgba(198,40,40,0.35); color: white;
}
.btn-info {
    background: linear-gradient(135deg, var(--info-light) 0%, var(--info) 100%);
    color: white; box-shadow: 0 2px 8px rgba(0,96,100,0.25);
}
.btn-info:hover {
    background: linear-gradient(135deg, var(--info) 0%, #004d40 100%);
    transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,96,100,0.35); color: white;
}
.btn-secondary {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: white;
}
.btn-secondary:hover {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white; transform: translateY(-1px);
}
.btn-outline-primary { border: 1.5px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(21,101,192,0.25); }
.btn-outline-success { border: 1.5px solid var(--success); color: var(--success); background: transparent; }
.btn-outline-success:hover { background: var(--success); color: white; transform: translateY(-1px); }
.btn-outline-info { border: 1.5px solid var(--info-light); color: var(--info-light); background: transparent; }
.btn-outline-info:hover { background: var(--info-light); color: white; transform: translateY(-1px); }
.btn-outline-danger { border: 1.5px solid var(--danger); color: var(--danger); background: transparent; }
.btn-outline-danger:hover { background: var(--danger); color: white; transform: translateY(-1px); }
.btn-outline-secondary { border: 1.5px solid var(--text-muted); color: var(--text-secondary); background: transparent; }
.btn-outline-secondary:hover { background: var(--text-muted); color: white; transform: translateY(-1px); }
.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white; border: none; box-shadow: 0 3px 12px rgba(21,101,192,0.3);
}
.btn-gradient:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(21,101,192,0.4); color: white; }
.btn:active { transform: translateY(0) !important; }
.btn:disabled { opacity: 0.55; transform: none !important; box-shadow: none !important; cursor: not-allowed; }

/* ── Таблицы ── */
.table {
    font-size: 0.875rem; color: var(--text-primary);
    --bs-table-bg: transparent;
}
.table thead th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; font-weight: 600; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.4px;
    padding: 0.75rem 1rem; border: none; white-space: nowrap;
}
.table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.table tbody tr:hover { background: rgba(21,101,192,0.04); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(33,150,243,0.08); }
.table tbody td { padding: 0.7rem 1rem; vertical-align: middle; color: var(--text-primary); }
.table-crm {
    background: var(--surface); border-radius: var(--radius-md);
    overflow: hidden; box-shadow: var(--shadow-sm);
}
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--surface-2); color: var(--text-primary); }

/* ── Формы ── */
.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    padding: 0.6rem 0.875rem;
    font-size: 0.9rem; transition: all var(--transition);
    background: var(--surface-2); color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
    background: var(--surface); outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { font-weight: 600; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
.form-text { color: var(--text-muted); font-size: 0.8rem; }

/* ── Badges ── */
.badge {
    padding: 0.35em 0.7em; border-radius: 20px;
    font-weight: 600; font-size: 0.75rem; letter-spacing: 0.2px;
}
.bg-primary   { background: var(--primary) !important; }
.bg-success   { background: var(--success) !important; }
.bg-warning   { background: var(--warning) !important; color: white !important; }
.bg-danger    { background: var(--danger) !important; }
.bg-info      { background: var(--info-light) !important; }
.bg-secondary { background: #64748b !important; }

/* ── Алерты ── */
.alert {
    border: none; border-radius: var(--radius-md);
    font-size: 0.875rem; padding: 0.875rem 1.1rem;
    border-left: 4px solid;
}
.alert-success { background: #f0fdf4; color: #166534; border-left-color: var(--success); }
.alert-danger  { background: #fff1f0; color: #c0392b; border-left-color: var(--danger); }
.alert-warning { background: #fffbeb; color: #92400e; border-left-color: var(--warning); }
.alert-info    { background: #ecfeff; color: #0e7490; border-left-color: var(--info-light); }
[data-theme="dark"] .alert-success { background: rgba(46,125,50,0.15); color: #6ee7b7; }
[data-theme="dark"] .alert-danger  { background: rgba(198,40,40,0.15); color: #fca5a5; }
[data-theme="dark"] .alert-warning { background: rgba(230,81,0,0.15);  color: #fcd34d; }
[data-theme="dark"] .alert-info    { background: rgba(0,150,170,0.15); color: #7dd3fc; }

/* ── Модальные ── */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-xl); background: var(--surface); color: var(--text-primary); }
.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none; padding: 1rem 1.25rem;
}
.modal-header .btn-close { filter: invert(1); }
.modal-body { padding: 1.5rem 1.25rem; }
.modal-footer { padding: 0.875rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── Toast/Notification ── */
.toast-container {
    position: fixed; top: 80px; right: 1.25rem; z-index: 9999;
    display: flex; flex-direction: column; gap: 0.5rem;
    pointer-events: none;
}
.toast-item {
    pointer-events: auto;
    min-width: 280px; max-width: 380px;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    background: var(--surface); color: var(--text-primary);
    border-left: 4px solid var(--primary);
    font-size: 0.88rem;
    animation: slideInRight 0.3s ease;
    display: flex; align-items: center; gap: 0.6rem;
}
.toast-item.success { border-left-color: var(--success); }
.toast-item.warning { border-left-color: var(--warning); }
.toast-item.danger  { border-left-color: var(--danger); }
.toast-item.info    { border-left-color: var(--info-light); }
.toast-item .toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-item.success .toast-icon { color: var(--success); }
.toast-item.warning .toast-icon { color: var(--warning); }
.toast-item.danger  .toast-icon { color: var(--danger); }
.toast-item.info    .toast-icon { color: var(--info-light); }

@keyframes slideInRight {
    from { transform: translateX(420px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0);     opacity: 1; }
    to   { transform: translateX(420px); opacity: 0; }
}

/* ── Spinner ── */
.loading-spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2.5px solid rgba(21,101,192,0.2);
    border-radius: 50%; border-top-color: var(--primary);
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Быстрые ссылки ── */
.quick-link { text-decoration: none; color: inherit; display: block; transition: transform var(--transition); }
.quick-link:hover { color: inherit; transform: translateY(-3px); }
.quick-link .card { transition: all var(--transition); border: 1.5px solid var(--border); }
.quick-link:hover .card { box-shadow: var(--shadow-md); border-color: var(--primary); }

/* ── Page header ── */
.page-header { margin-bottom: 1.5rem; }
.page-header h2, .page-header h3 {
    font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.3px; margin-bottom: 0.25rem;
}
.page-header .breadcrumb { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.text-muted { color: var(--text-muted) !important; }

/* ── Footer ── */
footer {
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 1rem 1.75rem; text-align: center;
    color: var(--text-muted); font-size: 0.8rem; margin-top: auto;
}

/* ── Печать ── */
@media print {
    .sidebar, .main-header, footer, .no-print { display: none !important; }
    .content-with-sidebar { margin-left: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
    body { background: white !important; color: black !important; }
    main { padding: 0 !important; }
}

/* Печать талона — формат бейджа */
.print-ticket {
    display: none;
}
@media print {
    .print-ticket {
        display: block !important;
        width: 80mm;
        margin: 0 auto;
        padding: 4mm;
        text-align: center;
        color: black;
        font-family: 'Courier New', monospace;
    }
    .print-ticket .pt-title { font-size: 14pt; font-weight: bold; margin-bottom: 4mm; }
    .print-ticket .pt-number { font-size: 48pt; font-weight: 900; line-height: 1; margin: 6mm 0; }
    .print-ticket .pt-service { font-size: 11pt; margin-bottom: 3mm; }
    .print-ticket .pt-room { font-size: 13pt; font-weight: bold; margin-bottom: 4mm; }
    .print-ticket .pt-time { font-size: 9pt; color: #444; }
    .print-ticket .pt-divider { border-top: 1px dashed #000; margin: 4mm 0; }
}

/* ── Адаптив ── */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-260px); }
    .sidebar.show { transform: translateX(0); }
    .content-with-sidebar { margin-left: 0; }
}
@media (max-width: 768px) {
    .stat-value { font-size: 1.6rem; }
    .widget-stat-value { font-size: 1.8rem; }
    .main-header { padding: 0.75rem 1rem; }
    main.container-fluid { padding: 1rem !important; }
}

/* ── Утилиты ── */
.text-primary-custom { color: var(--primary) !important; }
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.rounded-pill-custom { border-radius: 50px !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

/* ── Sidebar submenu ── */
.sidebar-submenu { list-style: none; padding: 0.25rem 0 0.25rem 1rem; margin: 0; }
.sidebar-submenu li a {
    display: flex; align-items: center;
    padding: 0.45rem 1rem 0.45rem 1.25rem;
    color: rgba(255,255,255,0.65); text-decoration: none;
    font-size: 0.82rem; border-radius: 8px;
    transition: all 0.15s; margin-bottom: 2px;
}
.sidebar-submenu li a:hover, .sidebar-submenu li a.active {
    color: white; background: rgba(255,255,255,0.12);
}
.sidebar-chevron { transition: transform 0.2s ease; }
a[aria-expanded="true"] .sidebar-chevron { transform: rotate(-180deg); }

/* Dropdown */
.dropdown-menu {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.dropdown-item {
    color: var(--text-primary);
}
.dropdown-item:hover, .dropdown-item:focus {
    background: var(--surface-2);
    color: var(--text-primary);
}
.dropdown-item-text { color: var(--text-muted); }
.dropdown-divider { border-color: var(--border); }

/* Progress */
.progress { background: var(--surface-3); border-radius: var(--radius-md); }
.progress-bar { background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); }

/* Список */
.list-group { background: var(--surface); }
.list-group-item {
    background: transparent; color: var(--text-primary);
    border-color: var(--border);
}

/* hr */
hr { border-color: var(--border); opacity: 0.3; }
