/* ========== CSS VARIABLES & THEMES ========== */
:root {
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-sidebar: #0a1628;
    --bg-sidebar-hover: #1a2d4a;
    --bg-sidebar-active: #1e40af;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --info: #0ea5e9;
    --info-bg: #e0f2fe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --day-bg: #fffbeb;
    --night-bg: #0f172a;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --transition: all 0.2s ease;
}

html[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --border-light: #1e293b;
    --primary-light: rgba(37, 99, 235, 0.2);
    --success-bg: rgba(22, 163, 74, 0.2);
    --danger-bg: rgba(220, 38, 38, 0.2);
    --warning-bg: rgba(217, 119, 6, 0.2);
    --info-bg: rgba(14, 165, 233, 0.2);
    --purple-light: rgba(124, 58, 237, 0.2);
    --day-bg: rgba(255, 251, 235, 0.1);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo>div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.logo-text {
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.logo-sub {
    color: var(--text-sidebar);
    font-size: 12px;
    margin-top: 4px;
    padding-left: 46px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: white;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex: 1;
}

.user-info:hover {
    background: var(--bg-sidebar-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    color: var(--text-sidebar);
    font-size: 11px;
}

.logout-btn {
    color: var(--text-sidebar);
}

.logout-btn:hover {
    color: var(--danger);
}

/* ========== MAIN ========== */
.main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== HEADER ========== */
.header {
    background: var(--bg-surface);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-left .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.date-selector {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    gap: 8px;
}

.date-selector svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.date-arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.date-arrow:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.date-arrow svg {
    width: 16px;
    height: 16px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-outline {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--border-light);
    border-color: var(--text-secondary);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    background: none;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ========== STATS ========== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    padding: 20px 28px 0;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-icon.orange {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.purple {
    background: var(--purple-light);
    color: var(--purple);
}

.stat-icon.teal {
    background: #ccfbf1;
    color: #0d9488;
}

.stat-icon.gray {
    background: var(--border-light);
    color: var(--text-secondary);
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-unit {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ========== CONTENT & SECTIONS ========== */
.content {
    padding: 20px 28px 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.info-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: help;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.view-toggle button {
    padding: 6px 10px;
    background: var(--bg-surface);
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.view-toggle button.active {
    background: var(--primary);
    color: white;
}

.view-toggle button svg {
    width: 16px;
    height: 16px;
}

/* ========== DUTY TEAMS ========== */
.duty-teams {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.duty-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    overflow: hidden;
    transition: var(--transition);
}

.duty-card:hover {
    box-shadow: var(--shadow-md);
}

.duty-card.active .supervisor-badge {
    background: var(--success-bg);
    color: var(--success);
}

.duty-card.inactive {
    opacity: 0.65;
}

.duty-card.inactive .duty-card-number {
    background: var(--text-secondary);
}

.duty-card.inactive .duty-card-number::after {
    border-left-color: var(--text-secondary);
}

.duty-card.inactive .supervisor-badge {
    background: var(--border-light);
    color: var(--text-secondary);
}

.duty-card-number {
    width: 48px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
}

.duty-card-number::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 10px solid var(--primary);
}

.duty-card-body {
    flex: 1;
    display: flex;
    padding: 14px 16px;
    gap: 16px;
}

.duty-supervisor {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}

.supervisor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.supervisor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.supervisor-info {
    flex: 1;
    min-width: 0;
}

.supervisor-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.supervisor-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
}

.supervisor-badge svg {
    width: 12px;
    height: 12px;
}

.shifts-container {
    flex: 1;
    display: flex;
    gap: 12px;
}

.shift-block {
    flex: 1;
    border-radius: var(--radius-sm);
    padding: 12px;
}

.shift-block.day {
    background: var(--day-bg);
    border: 1px solid #fde68a;
}

.shift-block.night {
    background: var(--night-bg);
    border: 1px solid #1e293b;
}

.shift-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.shift-icon {
    font-size: 16px;
}

.shift-title {
    font-size: 12px;
    font-weight: 600;
}

.shift-block.day .shift-title {
    color: var(--text-primary);
}

.shift-block.night .shift-title {
    color: #e2e8f0;
}

.shift-time {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
}

.shift-count {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.shift-block.day .shift-count {
    color: var(--text-primary);
}

.shift-block.night .shift-count {
    color: white;
}

.shift-count .count-label {
    font-size: 12px;
    font-weight: 500;
}

.shift-members {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shift-member {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.shift-block.day .shift-member {
    color: var(--text-secondary);
}

.shift-block.night .shift-member {
    color: #94a3b8;
}

.member-avatar-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.shift-block.night .member-avatar-small {
    background: rgba(255, 255, 255, 0.1);
}

.member-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shift-empty {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.duty-actions-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 8px;
}

/* ========== RAMP TABLE ========== */
.ramp-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.ramp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 12px;
}

.ramp-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.ramp-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--border-light);
    width: 200px;
    transition: var(--transition);
}

.search-input:focus-within {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-input input {
    border: none;
    background: none;
    outline: none;
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
}

.search-input input::placeholder {
    color: var(--text-secondary);
}

.filter-select {
    padding: 7px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-surface);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--text-secondary);
}

.filter-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ramp-table {
    width: 100%;
    border-collapse: collapse;
}

.ramp-table thead th {
    padding: 10px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
    background: var(--border-light);
}

.ramp-table tbody tr {
    transition: var(--transition);
    cursor: pointer;
}

.ramp-table tbody tr:hover {
    background: var(--border-light);
}

.ramp-table tbody td {
    padding: 12px 20px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table-employee {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.table-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.table-emp-info .emp-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.table-emp-info .emp-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.table-assignment {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-assignment .assign-type {
    font-weight: 500;
    color: var(--text-primary);
}

.table-assignment .assign-detail {
    font-size: 11px;
    color: var(--text-secondary);
}

.table-group {
    font-size: 13px;
    color: var(--text-secondary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.active {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.by-flights {
    background: var(--info-bg);
    color: var(--info);
}

.table-actions {
    display: flex;
    gap: 4px;
}

.table-more {
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-more:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.table-more svg {
    width: 16px;
    height: 16px;
}

.table-footer {
    padding: 12px 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
}

/* ========== INFO BAR ========== */
.info-bar {
    padding: 0 28px 24px;
    display: flex;
    gap: 16px;
}

.info-card {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    flex: 1;
}

.info-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-card-icon.blue {
    background: var(--primary-light);
}

.info-card-icon.yellow {
    background: var(--warning-bg);
}

.info-card-icon.dark {
    background: var(--border-light);
}

.info-card-icon svg {
    width: 18px;
    height: 18px;
}

.info-card-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.info-card-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========== КАЛЕНДАРЬ (ГОРИЗОНТАЛЬНЫЙ) ========== */
.calendar-container {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    overflow-x: auto;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Горизонтальная сетка календаря */
.calendar-grid-horizontal {
    display: grid;
    min-width: 1200px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.calendar-grid-horizontal .cal-header-row {
    display: contents;
}

.calendar-grid-horizontal .cal-header-cell {
    background: var(--border-light);
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

.calendar-grid-horizontal .cal-header-cell.weekend {
    background: #fef2f2;
    color: var(--danger);
}

.calendar-grid-horizontal .cal-header-cell.today-col {
    background: var(--primary-light);
    color: var(--primary);
}

.calendar-grid-horizontal .cal-header-cell .day-num {
    font-size: 14px;
    font-weight: 700;
    display: block;
}

.calendar-grid-horizontal .cal-header-cell .day-week {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.calendar-grid-horizontal .cal-employee-row {
    display: contents;
}

.calendar-grid-horizontal .cal-emp-name {
    background: var(--bg-surface);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
    border-right: 2px solid var(--border-color);
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 200px;
}

.calendar-grid-horizontal .cal-emp-name img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.calendar-grid-horizontal .cal-emp-name .emp-info {
    flex: 1;
    min-width: 0;
}

.calendar-grid-horizontal .cal-emp-name .emp-info .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-grid-horizontal .cal-emp-name .emp-info .role {
    font-size: 11px;
    color: var(--text-secondary);
}

.calendar-grid-horizontal .cal-cell {
    padding: 4px;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.calendar-grid-horizontal .cal-cell:hover {
    background: var(--primary-light);
}

.calendar-grid-horizontal .cal-cell.drag-over {
    background: rgba(37, 99, 235, 0.2) !important;
    border: 2px dashed var(--primary) !important;
}

.calendar-grid-horizontal .cal-cell.weekend {
    background: var(--border-light);
}

.calendar-grid-horizontal .cal-cell.today-col {
    background: rgba(37, 99, 235, 0.05);
}

.calendar-grid-horizontal .cal-cell.shift-day {
    background: var(--warning-bg);
}

.calendar-grid-horizontal .cal-cell.shift-night {
    background: var(--night-bg);
}

.calendar-grid-horizontal .cal-cell.shift-day-night {
    background: linear-gradient(135deg, var(--warning-bg) 50%, var(--night-bg) 50%);
}

.calendar-grid-horizontal .cal-cell.shift-24h {
    background: var(--primary-light);
}

.calendar-grid-horizontal .cal-cell.shift-vacation {
    background: var(--success-bg);
}

.calendar-grid-horizontal .cal-cell.shift-sick {
    background: var(--danger-bg);
}

.calendar-grid-horizontal .cal-cell .shift-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-grid-horizontal .cal-cell.shift-night .shift-label {
    color: white;
}

.calendar-grid-horizontal .cal-cell.shift-day-night .shift-label {
    color: var(--text-primary);
}

.calendar-grid-horizontal .cal-cell.shift-vacation .shift-label {
    color: var(--success);
}

.calendar-grid-horizontal .cal-cell.shift-sick .shift-label {
    color: var(--danger);
}

.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-badge {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.legend-badge.day {
    background: var(--warning-bg);
    color: var(--warning);
}

.legend-badge.night {
    background: var(--night-bg);
    color: white;
}

.legend-badge.full {
    background: var(--primary-light);
    color: var(--primary);
}

.legend-badge.vacation {
    background: var(--success-bg);
    color: var(--success);
}

.legend-badge.sick {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ========== EMPLOYEES GRID ========== */
.employees-container {
    padding: 20px 28px;
}

.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.employee-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}

.employee-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.employee-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.employee-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.employee-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-card-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.employee-card-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.employee-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.employee-card-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.employee-card-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.employee-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* ========== TIMESHEET ========== */
.timesheet-container {
    padding: 20px 28px;
}

.timesheet-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.timesheet-stat-card {
    background: var(--bg-surface);
    padding: 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    text-align: center;
}

.timesheet-stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.timesheet-stat-card .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.timesheet-table-wrapper {
    background: var(--bg-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.timesheet-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.timesheet-table th,
.timesheet-table td {
    padding: 10px 12px;
    text-align: center;
    font-size: 12px;
    border: 1px solid var(--border-light);
}

.timesheet-table th {
    background: var(--border-light);
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.timesheet-table th:first-child,
.timesheet-table td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--bg-surface);
    z-index: 11;
    font-weight: 500;
}

.timesheet-table td.day-cell {
    cursor: pointer;
    transition: background 0.1s;
}

.timesheet-table td.day-cell:hover {
    background: var(--primary-light);
}

.timesheet-table td.day-cell.shift-day {
    background: var(--warning-bg);
    color: var(--warning);
    font-weight: 600;
}

.timesheet-table td.day-cell.shift-night {
    background: var(--night-bg);
    color: white;
    font-weight: 600;
}

.timesheet-table td.day-cell.shift-day-night {
    background: linear-gradient(135deg, var(--warning-bg) 50%, var(--night-bg) 50%);
    color: var(--text-primary);
    font-weight: 600;
}

.timesheet-table td.day-cell.shift-24h {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.timesheet-table td.day-cell.weekend {
    background: var(--border-light);
}

.timesheet-table td.total-cell {
    font-weight: 700;
    background: var(--border-light);
}

/* ========== HOLIDAYS & SWAPS ========== */
.holidays-container,
.swaps-container,
.reports-container,
.settings-container {
    padding: 20px 28px;
}

.holidays-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.holidays-section,
.settings-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.holidays-section h3,
.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.holiday-item,
.vacation-item,
.sick-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
}

.holiday-item:hover,
.vacation-item:hover,
.sick-item:hover {
    background: var(--border-light);
}

.holiday-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.holiday-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.swaps-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.tab-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.swaps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.swap-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.swap-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.swap-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.swap-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.swap-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.swap-status.pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.swap-status.approved {
    background: var(--success-bg);
    color: var(--success);
}

.swap-status.rejected {
    background: var(--danger-bg);
    color: var(--danger);
}

.swap-actions {
    display: flex;
    gap: 8px;
}

/* ========== REPORTS ========== */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.report-card {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.report-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.report-card canvas {
    width: 100% !important;
    height: 250px !important;
}

.kpi-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.kpi-item .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.kpi-item .value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

/* ========== SETTINGS ========== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.settings-section.danger {
    border-color: var(--danger);
}

.settings-section.danger h3 {
    color: var(--danger);
}

.settings-section p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.toggle input {
    display: none;
}

.toggle-slider {
    width: 40px;
    height: 22px;
    background: var(--border-color);
    border-radius: 11px;
    position: relative;
    transition: var(--transition);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.toggle input:checked+.toggle-slider {
    background: var(--primary);
}

.toggle input:checked+.toggle-slider::after {
    transform: translateX(18px);
}

/* ========== MODALS ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal {
    background: var(--bg-surface);
    border-radius: var(--radius);
    width: auto;  /* убираем фиксированную ширину */
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

/* Модификаторы размеров */
.modal.modal-sm {
    width: 400px;
    max-width: 90vw;
}

.modal.modal-md {
    width: 480px;
    max-width: 90vw;
}

.modal.modal-lg {
    width: 720px;
    max-width: 95vw;
}

.modal.modal-xl {
    width: 1200px;
    max-width: 98vw;
    max-height: 92vh;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    border: none;
    background: var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.shift-modal-header {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.shift-modal-content {
    max-height: 60vh;
    overflow-y: auto;
}

.shift-assignment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
}

.shift-assignment-item:hover {
    background: var(--border-light);
}

.shift-emp-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shift-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 180px;
    background: var(--bg-surface);
}

.shift-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========== TOASTS ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: var(--text-primary);
    color: var(--bg-surface);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    min-width: 280px;
}

.toast.success {
    background: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ========== DROPDOWN ========== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 160px;
    display: none;
    z-index: 50;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--border-light);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: var(--danger-bg);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ========== SHORTCUTS HELP ========== */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.shortcut-item span {
    color: var(--text-primary);
}

kbd {
    background: var(--border-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-primary);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .stats-bar {
        grid-template-columns: repeat(3, 1fr);
    }

    .content {
        grid-template-columns: 1fr;
    }

    .timesheet-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main {
        margin-left: 0;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    #menuToggle {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }

    .shifts-container {
        flex-direction: column;
    }

    .info-bar {
        flex-direction: column;
    }

    .duty-card-body {
        flex-direction: column;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        min-height: 60px;
        padding: 4px;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

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


/* Стили для отпусков и больничных в табеле */
.timesheet-table td.day-cell.shift-vacation {
    background: var(--success-bg);
    color: var(--success);
    font-weight: 600;
}

.timesheet-table td.day-cell.shift-sick {
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 600;
}


/* ========== МОДАЛКА ДНЯ (ORG CHART) ========== */

.day-tree-header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.day-tree-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.day-tree-nav > div {
    min-width: 280px;
}

.day-tree-nav .day-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.day-tree-nav .day-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.day-tree-header .btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border-light);
}

.day-tree-header .btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.day-tree-content {
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px 10px;
}

/* Стили org-chart */
.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 700px;
}

.org-level {
    display: flex;
    justify-content: center;
    gap: 24px;
    position: relative;
    padding: 20px 0;
}

.org-level.duty-level {
    padding-bottom: 40px;
}

.org-level.sub-level {
    padding-top: 40px;
    flex-wrap: wrap;
}

/* Вертикальная линия от DUTY к подчинённым */
.org-connector {
    position: absolute;
    left: 50%;
    top: 100%;
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, var(--primary), var(--border-color));
    transform: translateX(-50%);
}

.org-connector::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

/* Карточка сотрудника */
.org-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 300px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.org-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.org-card.duty-card {
    border-left: 4px solid var(--primary);
    min-width: 380px;
}

.org-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    border: 3px solid var(--border-light);
}

.org-card.duty-card .org-card-avatar {
    border-color: var(--primary-light);
}

.org-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-card-avatar .status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--bg-surface);
}

.org-card-info {
    flex: 1;
    min-width: 0;
}

.org-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.org-card-role {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.org-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.org-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.org-badge.duty {
    background: var(--primary-light);
    color: var(--primary);
}

.org-badge.day {
    background: var(--warning-bg);
    color: var(--warning);
}

.org-badge.night {
    background: var(--night-bg);
    color: white;
}

.org-badge.group {
    background: var(--border-light);
    color: var(--text-secondary);
}

.org-badge.vacation {
    background: var(--success-bg);
    color: var(--success);
}

.org-badge.sick {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Группа ролей */
.org-role-group {
    margin: 20px 0;
    width: 100%;
}

.org-role-group-title {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.org-role-group-title::before,
.org-role-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
    max-width: 100px;
}

/* Разделитель смен */
.shift-divider {
    width: 100%;
    text-align: center;
    margin: 30px 0 20px;
    position: relative;
}

.shift-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.shift-divider span {
    position: relative;
    background: var(--bg-surface);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

.shift-divider.day-divider span {
    color: var(--warning);
    border-color: #fde68a;
    background: var(--warning-bg);
}

.shift-divider.night-divider span {
    color: white;
    background: var(--night-bg);
    border-color: #1e293b;
}

/* Пустое состояние */
.tree-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.tree-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Статистика */
.day-tree-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.day-stat {
    text-align: center;
    padding: 12px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
}

.day-stat .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.day-stat .label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .org-card {
        min-width: 220px;
    }
    .org-card.duty-card {
        min-width: 260px;
    }
    .day-tree-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Управление DUTY */
.duty-management-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

/* LOGIN SCREEN */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #1e293b;
}

[data-theme="dark"] .login-card {
    background: rgba(30, 41, 59, 0.95);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.login-logo-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.login-logo {
    max-width: 260px;
    height: auto;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.login-card .input-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.login-card .input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: inherit;
}

.login-card .input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-card .input-group input:focus {
    outline: none;
    border-color: #0284c7;
}

[data-theme="dark"] .login-card .input-group input {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
}

.btn-block {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    margin-top: 1.5rem;
    cursor: pointer;
}

.login-error-msg {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 1rem;
    font-weight: 500;
}

/* Shift management modal layout */
.shift-management-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}
.edit-shift-col {
    flex: 1 1 250px;
    min-width: 250px;
    border-right: 1px solid var(--border-color);
    padding-right: 24px;
}
.swap-shift-col {
    flex: 1 1 250px;
    min-width: 250px;
}
@media (max-width: 600px) {
    .edit-shift-col {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 24px;
    }
}
.delete-vacation-btn {
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
}
.delete-vacation-btn:hover {
    color: var(--danger) !important;
    background-color: var(--danger-bg);
}