:root {
    --bg-primary: #0a0618;
    --bg-secondary: #120d24;
    --bg-card: rgba(18, 13, 36, 0.85);
    --bg-hover: #2a1a4a;
    --text-primary: #f2e8d0;
    --text-secondary: #c4b0d8;
    --orange: #f07a3a;
    --orange-dark: #d06020;
    --orange-light: #f89a5a;
    --yellow: #f5d042;
    --yellow-dark: #dbb030;
    --purple: #9b7bd0;
    --purple-dark: #7a5aaa;
    --purple-light: #b89ae8;
    --border-color: #3a2a5a;
    --table-bg: rgba(230, 240, 250, 0.1);
    --table-hover: rgba(230, 240, 250, 0.2);
    --danger: #f87171;
    --success: #4ade80;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    background-image: radial-gradient(circle at 10% 20%, rgba(240, 122, 58, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(155, 123, 208, 0.06) 0%, transparent 35%);
    background-attachment: fixed;
}

/* Сайдбар и топбар по умолчанию скрыты — показываются только после входа
   (класс .authenticated на body), чтобы на экране входа не мелькала пустая
   боковая панель и форма входа была по центру всей страницы. */
.sidebar {
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #120d24 0%, #0a0618 100%);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    padding: 1.2rem 0.8rem;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    transition: transform var(--transition);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
}

body.authenticated .sidebar {
    display: flex;
}

body.authenticated .sidebar.open {
    transform: translateX(0);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1rem 1.8rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.6rem;
    font-weight: 700;
}

.sidebar-brand span {
    color: var(--text-primary);
}

.sidebar-brand span span {
    background: linear-gradient(135deg, var(--orange), var(--yellow), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 0.7rem 1rem;
    border-radius: 12px;
    margin: 4px 0;
    transition: all var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.sidebar .nav-link i {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
    color: var(--purple-light);
    transition: color 0.3s;
}

.sidebar .nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.sidebar .nav-link:hover i {
    color: var(--yellow);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(240, 122, 58, 0.2), rgba(155, 123, 208, 0.15));
    color: var(--yellow);
    border-right: 3px solid var(--orange);
}

.sidebar .nav-link.active i {
    color: var(--orange);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.2rem 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer .btn-outline-light {
    border-color: var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition);
    border-radius: 30px;
}

.sidebar-footer .btn-outline-light:hover {
    background: linear-gradient(135deg, var(--orange), var(--purple));
    color: #fff;
    border-color: var(--orange);
    box-shadow: 0 0 20px rgba(240, 122, 58, 0.3);
}

.main-content {
    margin-left: 0;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.authenticated .main-content {
    margin-left: 260px;
}

.topbar {
    height: 64px;
    background: rgba(18, 13, 36, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1040;
}

body.authenticated .topbar {
    display: flex;
}

.topbar h5 {
    color: var(--text-primary);
    font-weight: 600;
    background: linear-gradient(135deg, var(--orange), var(--yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 6px 14px 6px 10px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
}

.topbar-right .user-info .username {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.topbar-right .user-info .role {
    font-size: 0.7rem;
    background: linear-gradient(135deg, var(--orange), var(--purple));
    color: #fff;
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.6rem;
}

.page-content {
    padding: 2rem;
    flex: 1;
    animation: fadeIn 0.6s ease;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-6px);
    border-color: var(--orange);
    box-shadow: 0 12px 40px rgba(240, 122, 58, 0.15);
}

.stat-card .icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: linear-gradient(135deg, rgba(240, 122, 58, 0.15), rgba(155, 123, 208, 0.15));
    color: var(--yellow);
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--orange), var(--yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .text-muted {
    color: var(--text-secondary) !important;
}

.dept-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dept-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--dept-color, #9b7bd0), transparent 60%);
    opacity: 0.08;
    transition: opacity 0.4s;
    pointer-events: none;
}

.dept-card:hover::after {
    opacity: 0.15;
}

.dept-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--dept-color, #9b7bd0);
}

.dept-card .dept-header {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.dept-card .dept-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 16px var(--dept-color, #9b7bd0);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dept-card .dept-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.dept-card .badge {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.dept-card .text-muted {
    color: var(--text-secondary) !important;
    font-weight: 300;
}

.table-container {
    background: rgba(230, 240, 250, 0.11);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.2rem;
    overflow-x: auto;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.table {
    color: var(--text-primary);
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 6px;
    width: 100%;
}

.table th {
    color: var(--yellow);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
    padding: 0.8rem 0.5rem;
    background: rgba(230, 240, 250, 0.15);
}

.table td {
    background: rgba(230, 240, 250, 0.05);
    border-bottom: 1px solid rgba(230, 240, 250, 0.1);
    padding: 0.8rem 0.5rem;
    vertical-align: middle;
    transition: background 0.2s;
    color: var(--text-primary);
}

.table tr:hover td {
    background: rgba(230, 240, 250, 0.15);
}

.table-department td {
    background: rgba(230, 240, 250, 0.05);
}

.table-department tr:hover td {
    background: rgba(230, 240, 250, 0.15);
}

.employee-expand {
    cursor: pointer;
}

.employee-details {
    background: rgba(230, 240, 250, 0.1);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* === Подробная таблица карт (вместо одних значков) === */
.card-detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.card-detail-table th {
    color: var(--yellow);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0.4rem 0.6rem;
    font-weight: 700;
}

.card-detail-table td {
    background: rgba(230, 240, 250, 0.09);
    padding: 0.55rem 0.6rem;
    vertical-align: middle;
    font-size: 0.85rem;
}

.card-detail-table tr td:first-child {
    border-radius: 8px 0 0 8px;
}

.card-detail-table tr td:last-child {
    border-radius: 0 8px 8px 0;
}

.card-name-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.card-name-chip .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dept-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.8rem;
}

.avatar-list {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

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

.card-square {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #fff;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
    margin: 2px;
}

.card-square:hover {
    transform: scale(1.15);
}

/* === Личный кабинет / профиль сотрудника === */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    transition: all var(--transition);
}

.profile-card:hover {
    border-color: var(--orange);
    box-shadow: 0 0 30px rgba(240, 122, 58, 0.05);
}

.profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--orange);
    box-shadow: 0 0 20px rgba(240, 122, 58, 0.2);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.profile-header h4 {
    font-weight: 700;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.profile-section {
    margin-bottom: 1.4rem;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--yellow);
    font-weight: 700;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-section-body {
    background: rgba(230, 240, 250, 0.09);
    border: 1px solid rgba(230, 240, 250, 0.16);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.1rem;
    color: var(--text-primary);
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.profile-info .info-item {
    background: rgba(230, 240, 250, 0.05);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border-left: 3px solid var(--orange);
}

.profile-info .label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.2rem;
}

.profile-info .value {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(230, 240, 250, 0.08);
    font-size: 0.85rem;
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item .time {
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 0.75rem;
    min-width: 110px;
}

.badge-event {
    background: var(--bg-hover) !important;
    color: var(--purple-light) !important;
    margin-right: 6px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.8rem;
}

.status-badge.expelled {
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.status-badge.pending {
    background: rgba(245, 208, 66, 0.12);
    color: var(--yellow);
    border: 1px solid rgba(245, 208, 66, 0.35);
}

.dept-structure-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 10px;
    border: 1px solid rgba(230, 240, 250, 0.12);
    background: rgba(230, 240, 250, 0.03);
    transition: background 0.2s;
}

.dept-structure-item:hover {
    background: rgba(230, 240, 250, 0.07);
}

.dept-structure-item .color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dept-structure-item .item-name {
    color: var(--text-primary);
    flex: 1;
}

.dept-structure-item .item-actions {
    display: flex;
    gap: 6px;
}

.degree-badge-1 {
    background: #01998b;
    color: #fff;
}

.degree-badge-2 {
    background: #00ac9c;
    color: #fff;
}

.degree-badge-3 {
    background: #01bbaa;
    color: #fff;
}

.degree-badge-4 {
    background: #00c9b8;
    color: #fff;
}

.degree-badge-5 {
    background: #01e4d1;
    color: #fff;
}

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, #0a0618 0%, #1a1035 50%, #0a0618 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(240, 122, 58, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(155, 123, 208, 0.08) 0%, transparent 40%);
    animation: rotateGlow 30s linear infinite;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.auth-card {
    background: rgba(18, 13, 36, 0.85);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(240, 122, 58, 0.2);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 60px rgba(240, 122, 58, 0.05);
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-card:hover {
    border-color: rgba(245, 200, 66, 0.3);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 80px rgba(240, 122, 58, 0.08);
}

.auth-logo {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-logo span {
    background: linear-gradient(135deg, var(--orange), var(--yellow), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--orange), var(--yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card .form-control,
.auth-card .form-select {
    background: rgba(10, 6, 24, 0.8);
    border: 1px solid rgba(58, 42, 90, 0.8);
    color: var(--text-primary);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(240, 122, 58, 0.1);
}

.auth-card .btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--purple-dark));
    border: none;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 14px;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(240, 122, 58, 0.2);
}

.auth-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 122, 58, 0.3);
    background: linear-gradient(135deg, var(--orange-light), var(--purple));
}

.auth-toggle {
    color: var(--yellow);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.auth-toggle:hover {
    color: var(--orange);
    text-shadow: 0 0 12px rgba(240, 122, 58, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--purple-dark));
    border: none;
    color: #fff;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: 0 4px 15px rgba(240, 122, 58, 0.2);
    border-radius: 30px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 122, 58, 0.3);
    color: #fff;
    background: linear-gradient(135deg, var(--orange-light), var(--purple));
}

.btn-outline-primary {
    color: var(--orange);
    border-color: var(--orange);
    border-radius: 30px;
}

.btn-outline-primary:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    border-radius: 30px;
}

.btn-danger {
    background: linear-gradient(135deg, #f87171, #dc2626);
    border: none;
    border-radius: 30px;
}

.btn-warning {
    background: linear-gradient(135deg, var(--yellow), var(--orange));
    border: none;
    color: #0a0618;
    border-radius: 30px;
}

.badge {
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 30px;
}

.color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.balance-positive {
    color: #4ade80;
    font-weight: 700;
}

.balance-negative {
    color: #f87171;
    font-weight: 700;
}

/* === Модальные окна (панели ввода данных) === */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(240, 122, 58, 0.1), rgba(155, 123, 208, 0.1));
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header .modal-title {
    color: var(--yellow);
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .form-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.modal-body .form-control,
.modal-body .form-select,
.modal-body textarea {
    background: rgba(10, 6, 24, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    transition: all 0.25s;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus,
.modal-body textarea:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(240, 122, 58, 0.12);
    background: rgba(10, 6, 24, 0.8);
    color: var(--text-primary);
}

.modal-body .form-control::placeholder,
.modal-body textarea::placeholder {
    color: rgba(196, 176, 216, 0.35);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 30px;
}

.modal-footer .btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.move-modal .form-control {
    background: rgba(10, 6, 24, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.6rem 1rem;
}

.move-modal .form-control:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(240, 122, 58, 0.1);
}

.move-modal-subject {
    background: rgba(230, 240, 250, 0.05);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card-count-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* === Раздел "Персонал" === */
.employees-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.2rem;
}

.employees-toolbar .search-box {
    flex: 2;
    min-width: 220px;
    position: relative;
}

.employees-toolbar .search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.employees-toolbar .search-box input {
    padding-left: 38px;
}

.employees-toolbar select {
    flex: 1;
    min-width: 180px;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--orange);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--yellow);
}

@media (max-width: 768px) {
    body.authenticated .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    body.authenticated .sidebar.open {
        transform: translateX(0);
    }

    body.authenticated .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block !important;
    }

    .topbar {
        padding: 0 1rem;
    }

    .topbar-right .user-info .username {
        display: none;
    }

    .page-content {
        padding: 1rem;
    }

    .profile-info {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}
/* =====================================================================
   Дополнения версии 2.0
   ===================================================================== */

/* Цветовые акценты карточек статистики */
.stat-card .icon.blue { color: #7db9ff; }
.stat-card .icon.green { color: var(--success); }
.stat-card .icon.gold { color: var(--yellow); }
.stat-card .icon.purple { color: var(--purple-light); }
.stat-card .icon.red { color: var(--danger); }

/* Значок количества заявок в боковом меню */
.nav-badge {
    margin-left: auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--orange);
    color: #1a1024;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

/* Значок роли */
.role-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
}

.role-badge.role-C { background: rgba(196, 176, 216, 0.15); color: var(--text-secondary); border-color: rgba(196, 176, 216, 0.3); }
.role-badge.role-B { background: rgba(125, 185, 255, 0.15); color: #7db9ff; border-color: rgba(125, 185, 255, 0.35); }
.role-badge.role-A { background: rgba(240, 122, 58, 0.15); color: var(--orange-light); border-color: rgba(240, 122, 58, 0.4); }
.role-badge.role-Aplus { background: linear-gradient(135deg, rgba(245, 208, 66, 0.2), rgba(240, 122, 58, 0.2)); color: var(--yellow); border-color: rgba(245, 208, 66, 0.5); }

/* Заглушки состояний */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    background: rgba(18, 13, 36, 0.4);
}

.empty-state i {
    display: block;
    font-size: 2.4rem;
    margin-bottom: 0.6rem;
    color: var(--purple-light);
    opacity: 0.7;
}

.loading-block {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    color: var(--purple-light);
}

/* Временный пароль нового сотрудника */
.temp-password {
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    background: rgba(240, 122, 58, 0.12);
    border: 1px solid var(--orange);
    color: var(--yellow);
    text-align: center;
    user-select: all;
    word-break: break-all;
}

/* Список собственных заявок в личном кабинете */
.request-row {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

/* Таблица карт помещается на узких экранах */
.card-detail-table { width: 100%; }

.table-responsive { overflow-x: auto; }

/* Строки персонала кликабельны — показываем это курсором */
tr.staff-row { cursor: pointer; }

tr.staff-row:hover { background: var(--table-hover); }

.staff-details-row > td { background: rgba(10, 6, 24, 0.6); }

/* Поле выбора цвета одинакового размера во всех формах */
input[type="color"].form-control-color {
    width: 46px;
    min-width: 46px;
    padding: 3px;
}

/* Модальное окно с прокруткой не должно упираться в края экрана */
.modal-dialog-scrollable .modal-body { max-height: 72vh; }

@media (max-width: 768px) {
    .employees-toolbar .search-box,
    .employees-toolbar select { flex: 1 1 100%; }
}
