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

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --border-color: #dee2e6;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --navbar-height: 64px;
    --surface-bg: #ffffff;
    --surface-muted: #f8f9fa;
    --input-bg: #ffffff;
    --hover-bg: #f1f4f8;
    --muted-text: #666666;
    --subtle-text: #999999;
    --icon-button-bg: transparent;
    --icon-button-hover-bg: #eef3f8;
    --toggle-track-bg: #cfd7e3;
    --toggle-thumb-bg: #ffffff;
}

:root[data-theme="dark"] {
    --primary-color: #72b2ff;
    --secondary-color: #a3afc2;
    --success-color: #55c271;
    --danger-color: #ff7a7f;
    --warning-color: #f5c561;
    --light-bg: #0f1722;
    --dark-text: #edf3ff;
    --border-color: #263448;
    --shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
    --surface-bg: #162130;
    --surface-muted: #101927;
    --input-bg: #0d1522;
    --hover-bg: #1c2a3c;
    --muted-text: #b6c2d4;
    --subtle-text: #8c98aa;
    --icon-button-bg: rgba(255, 255, 255, 0.02);
    --icon-button-hover-bg: rgba(114, 178, 255, 0.14);
    --toggle-track-bg: #37506c;
    --toggle-thumb-bg: #edf3ff;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
}

.spinner-circle {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--secondary-color);
    white-space: nowrap;
}

.btn-spinner::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.loading-spinner p {
    color: white;
    font-size: 16px;
    margin: 20px 0 0 0;
    font-weight: 500;
}

/* Error screen */
.error-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.error-container {
    background: var(--surface-bg);
    border-radius: 8px;
    padding: 3rem;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.error-container h1 {
    font-size: 2rem;
    color: var(--dark-text);
    margin-bottom: 1rem;
}

.error-message {
    color: var(--muted-text);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.error-subtext {
    color: var(--subtle-text);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-style: italic;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.5;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#app,
.page {
    width: 100%;
    min-height: 100vh;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    color: white;
}

.login-container h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-container .subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

#login-form {
    background: var(--surface-bg);
    color: var(--dark-text);
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.request-dates-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.request-dates-label-row #request-day-count {
    margin-top: 0;
    margin-bottom: 0.5rem;
    margin-left: auto;
    text-align: right;
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--dark-text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-result {
    margin-top: 10px;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.form-result.is-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.form-result.is-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.form-result.is-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    padding: 0.75rem 1.5rem;
    border: 1px solid #b91c1c;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-danger:hover:not(:disabled) {
    background-color: #b91c1c;
    border-color: #991b1b;
}

.btn-danger:disabled {
    background-color: #fca5a5;
    border-color: #fca5a5;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-success {
    background-color: #16a34a;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-success:disabled {
    background-color: #86efac;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Date rows for vacation request */
.request-date-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.request-date-row input[type="date"] {
    flex: 1;
}

.btn-icon.btn-remove-date {
    background: none;
    border: none;
    color: var(--danger-color, #dc3545);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    line-height: 1;
    border-radius: 4px;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-remove-date:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* Error Message */
.error-message {
    background-color: var(--danger-color);
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

/* Email sync form */
.email-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.sync-email-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.sync-email-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.btn-remove-email {
    padding: 0.7rem 1rem;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.btn-remove-email:hover {
    background-color: #c82333;
}

.add-email-section {
    margin-top: 15px;
    margin-bottom: 20px;
}

.btn-add-email {
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-add-email:hover {
    background-color: #5a6268;
}

/* Banners */
.banner {
    padding: 0.9rem 1rem;
    border-radius: 6px;
    margin: 0 0 1rem 0;
    font-weight: 600;
    border: 1px solid transparent;
}

.banner-warning {
    background-color: #fff5cc;
    color: #5c4500;
    border-color: #f1d27a;
}

/* Navigation Bar */
.navbar {
    background-color: var(--surface-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--navbar-height);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Notification Bell */
.notification-bell,
.settings-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--icon-button-bg);
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: background-color 0.2s, transform 0.2s ease;
}

.notification-bell:hover,
.settings-button:hover {
    background-color: var(--icon-button-hover-bg);
}

.notification-bell:active,
.settings-button:active {
    transform: scale(0.97);
}

.bell-icon {
    display: block;
    width: 22px;
    height: 22px;
    background-color: var(--dark-text);
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M18%208A6%206%200%200%200%206%208c0%207-3%209-3%209h18s-3-2-3-9%22%2F%3E%3Cpath%20d%3D%22M13.73%2021a2%202%200%200%201-3.46%200%22%2F%3E%3C%2Fsvg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M18%208A6%206%200%200%200%206%208c0%207-3%209-3%209h18s-3-2-3-9%22%2F%3E%3Cpath%20d%3D%22M13.73%2021a2%202%200%200%201-3.46%200%22%2F%3E%3C%2Fsvg%3E") no-repeat center / contain;
}

.settings-icon {
    display: block;
    width: 22px;
    height: 22px;
    background-color: var(--dark-text);
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M19.4%2015a1.65%201.65%200%200%200%20.33%201.82l.06.06a2%202%200%201%201-2.83%202.83l-.06-.06a1.65%201.65%200%200%200-1.82-.33%201.65%201.65%200%200%200-1%201.51V21a2%202%200%201%201-4%200v-.09a1.65%201.65%200%200%200-1-1.51%201.65%201.65%200%200%200-1.82.33l-.06.06a2%202%200%201%201-2.83-2.83l.06-.06a1.65%201.65%200%200%200%20.33-1.82%201.65%201.65%200%200%200-1.51-1H3a2%202%200%201%201%200-4h.09a1.65%201.65%200%200%200%201.51-1%201.65%201.65%200%200%200-.33-1.82l-.06-.06a2%202%200%201%201%202.83-2.83l.06.06a1.65%201.65%200%200%200%201.82.33H9a1.65%201.65%200%200%200%201-1.51V3a2%202%200%201%201%204%200v.09a1.65%201.65%200%200%200%201%201.51%201.65%201.65%200%200%200%201.82-.33l.06-.06a2%202%200%201%201%202.83%202.83l-.06.06a1.65%201.65%200%200%200-.33%201.82V9a1.65%201.65%200%200%200%201.51%201H21a2%202%200%201%201%200%204h-.09a1.65%201.65%200%200%200-1.51%201z%22%2F%3E%3C%2Fsvg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M19.4%2015a1.65%201.65%200%200%200%20.33%201.82l.06.06a2%202%200%201%201-2.83%202.83l-.06-.06a1.65%201.65%200%200%200-1.82-.33%201.65%201.65%200%200%200-1%201.51V21a2%202%200%201%201-4%200v-.09a1.65%201.65%200%200%200-1-1.51%201.65%201.65%200%200%200-1.82.33l-.06.06a2%202%200%201%201-2.83-2.83l.06-.06a1.65%201.65%200%200%200%20.33-1.82%201.65%201.65%200%200%200-1.51-1H3a2%202%200%201%201%200-4h.09a1.65%201.65%200%200%200%201.51-1%201.65%201.65%200%200%200-.33-1.82l-.06-.06a2%202%200%201%201%202.83-2.83l.06.06a1.65%201.65%200%200%200%201.82.33H9a1.65%201.65%200%200%200%201-1.51V3a2%202%200%201%201%204%200v.09a1.65%201.65%200%200%200%201%201.51%201.65%201.65%200%200%200%201.82-.33l.06-.06a2%202%200%201%201%202.83%202.83l-.06.06a1.65%201.65%200%200%200-.33%201.82V9a1.65%201.65%200%200%200%201.51%201H21a2%202%200%201%201%200%204h-.09a1.65%201.65%200%200%200-1.51%201z%22%2F%3E%3C%2Fsvg%3E") no-repeat center / contain;
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: white;
    background-color: #e53935;
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Form messages */
.form-message {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}
.form-message.success {
    display: block;
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}
.form-message.error {
    display: block;
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.user-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: #f0f0f0;
}

.navbar-user-name {
    display: none;
    font-weight: 600;
    color: var(--dark-text);
}

.navbar-toggle {
    display: none;
    border: 1px solid var(--border-color);
    background: var(--surface-bg);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.navbar-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--dark-text);
    margin: 4px 0;
}

/* Container & Layout */
.container {
    display: flex;
    margin: 0;
    height: calc(100vh - var(--navbar-height));
}

.main-content {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 200px;
    background-color: var(--surface-bg);
    border-right: 1px solid var(--border-color);
    padding: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    width: 100%;
}

.manager-only {
    display: none;
}

.admin-only {
    display: none;
}

.nav-divider {
    position: relative;
    margin: 1.25rem 0 0.25rem;
    border: none;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
}

.nav-divider::before {
    content: 'MANAGER';
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--secondary-color);
    opacity: 0.6;
    white-space: nowrap;
    padding-right: 0.5rem;
    line-height: 1;
    flex: 0 0 auto;
}

.nav-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background-color: var(--border-color);
}

.nav-divider.admin-only::before {
    content: 'ADMIN';
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask: var(--nav-icon) no-repeat center / contain;
    mask: var(--nav-icon) no-repeat center / contain;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.nav-dashboard .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%2F%3E%3C%2Fsvg%3E");
}

.nav-request .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%222%22%20x2%3D%2216%22%20y2%3D%226%22%2F%3E%3Cline%20x1%3D%228%22%20y1%3D%222%22%20x2%3D%228%22%20y2%3D%226%22%2F%3E%3Cline%20x1%3D%223%22%20y1%3D%2210%22%20x2%3D%2221%22%20y2%3D%2210%22%2F%3E%3C%2Fsvg%3E");
}

.nav-calloff .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M22%2016.92v2a2%202%200%200%201-2.18%202%2019.79%2019.79%200%200%201-8.63-3.07%2019.5%2019.5%200%200%201-6-6A19.79%2019.79%200%200%201%203.08%204.18%202%202%200%200%201%205.06%202h2a2%202%200%200%201%202%201.72c.12.81.31%201.6.57%202.36a2%202%200%200%201-.45%202.11L8%209a16%2016%200%200%200%206%206l.81-.18a2%202%200%200%201%202.11-.45c.76.26%201.55.45%202.36.57A2%202%200%200%201%2022%2016.92z%22%2F%3E%3C%2Fsvg%3E");
}

.nav-late .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpolyline%20points%3D%2212%207%2012%2012%2015%2014%22%2F%3E%3C%2Fsvg%3E");
}

.nav-approvals .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%3Cpath%20d%3D%22M7%2012l3%203%207-7%22%2F%3E%3C%2Fsvg%3E");
}

.nav-daily-attendance .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%202v4M16%202v4M3%2010h18%22%2F%3E%3Cpath%20d%3D%22M8%2015h8M8%2018h5%22%2F%3E%3C%2Fsvg%3E");
}

.nav-hierarchy .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%226%22%20height%3D%226%22%2F%3E%3Crect%20x%3D%2215%22%20y%3D%223%22%20width%3D%226%22%20height%3D%226%22%2F%3E%3Crect%20x%3D%229%22%20y%3D%2215%22%20width%3D%226%22%20height%3D%226%22%2F%3E%3Cpath%20d%3D%22M6%209v3h12V9%22%2F%3E%3Cpath%20d%3D%22M12%2012v3%22%2F%3E%3C%2Fsvg%3E");
}

.nav-sync .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M23%204v6h-6%22%2F%3E%3Cpath%20d%3D%22M1%2020v-6h6%22%2F%3E%3Cpath%20d%3D%22M3.51%209a9%209%200%200%201%2014.85-3.36M20.49%2015a9%209%200%200%201-14.85%203.36%22%2F%3E%3C%2Fsvg%3E");
}

.nav-employees .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%226%22%20cy%3D%227%22%20r%3D%222.5%22%2F%3E%3Ccircle%20cx%3D%2218%22%20cy%3D%227%22%20r%3D%222.5%22%2F%3E%3Cpath%20d%3D%22M2%2020v-1a3.5%203.5%200%200%201%203.5-3.5h1a3.5%203.5%200%200%201%203.5%203.5v1%22%2F%3E%3Cpath%20d%3D%22M14%2020v-1a3.5%203.5%200%200%201%203.5-3.5h1a3.5%203.5%200%200%201%203.5%203.5v1%22%2F%3E%3C%2Fsvg%3E");
}

.nav-add-user .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M16%2021v-2a4%204%200%200%200-4-4H5a4%204%200%200%200-4%204v2%22%2F%3E%3Ccircle%20cx%3D%228.5%22%20cy%3D%227%22%20r%3D%224%22%2F%3E%3Cline%20x1%3D%2220%22%20y1%3D%228%22%20x2%3D%2220%22%20y2%3D%2214%22%2F%3E%3Cline%20x1%3D%2223%22%20y1%3D%2211%22%20x2%3D%2217%22%20y2%3D%2211%22%2F%3E%3C%2Fsvg%3E");
}

.nav-admin-setup .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%224%22%20y1%3D%226%22%20x2%3D%2220%22%20y2%3D%226%22%2F%3E%3Cline%20x1%3D%224%22%20y1%3D%2212%22%20x2%3D%2220%22%20y2%3D%2212%22%2F%3E%3Cline%20x1%3D%224%22%20y1%3D%2218%22%20x2%3D%2220%22%20y2%3D%2218%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%226%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2212%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%2218%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E");
}

.nav-admin-migration .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%207h8M8%2012h5M15%2016h1%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M10%2016l-2%202%202%202%22%2F%3E%3Cpath%20d%3D%22M14%2016l2%202-2%202%22%2F%3E%3C%2Fsvg%3E");
}

.nav-view-as .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M1%2012s4-8%2011-8%2011%208%2011%208-4%208-11%208-11-8-11-8z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%2F%3E%3C%2Fsvg%3E");
}

.nav-email-admin .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%222%22%20y%3D%224%22%20width%3D%2220%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpolyline%20points%3D%222%2C4%2012%2C13%2022%2C4%22%2F%3E%3C%2Fsvg%3E");
}

.nav-adjustment .nav-icon,
.nav-manager-adjustment .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cline%20x1%3D%224%22%20y1%3D%2221%22%20x2%3D%224%22%20y2%3D%2214%22%2F%3E%3Cline%20x1%3D%224%22%20y1%3D%2210%22%20x2%3D%224%22%20y2%3D%223%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%2221%22%20x2%3D%2212%22%20y2%3D%2212%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%228%22%20x2%3D%2212%22%20y2%3D%223%22%2F%3E%3Cline%20x1%3D%2220%22%20y1%3D%2221%22%20x2%3D%2220%22%20y2%3D%2216%22%2F%3E%3Cline%20x1%3D%2220%22%20y1%3D%2212%22%20x2%3D%2220%22%20y2%3D%223%22%2F%3E%3Cline%20x1%3D%221%22%20y1%3D%2214%22%20x2%3D%227%22%20y2%3D%2214%22%2F%3E%3Cline%20x1%3D%229%22%20y1%3D%228%22%20x2%3D%2215%22%20y2%3D%228%22%2F%3E%3Cline%20x1%3D%2217%22%20y1%3D%2216%22%20x2%3D%2223%22%20y2%3D%2216%22%2F%3E%3C%2Fsvg%3E");
}

.nav-approved-vacation .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%3Cline%20x1%3D%228%22%20y1%3D%222%22%20x2%3D%228%22%20y2%3D%226%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%222%22%20x2%3D%2216%22%20y2%3D%226%22%2F%3E%3Cline%20x1%3D%223%22%20y1%3D%2210%22%20x2%3D%2221%22%20y2%3D%2210%22%2F%3E%3Cpath%20d%3D%22M8%2015l2.4%202.4L16.5%2012%22%2F%3E%3C%2Fsvg%3E");
}

.nav-db-viewer .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cline%20x1%3D%223%22%20y1%3D%229%22%20x2%3D%2221%22%20y2%3D%229%22%2F%3E%3Cline%20x1%3D%223%22%20y1%3D%2215%22%20x2%3D%2221%22%20y2%3D%2215%22%2F%3E%3Cline%20x1%3D%229%22%20y1%3D%223%22%20x2%3D%229%22%20y2%3D%2221%22%2F%3E%3Cline%20x1%3D%2215%22%20y1%3D%223%22%20x2%3D%2215%22%20y2%3D%2221%22%2F%3E%3C%2Fsvg%3E");
}

.nav-logout-item .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%2021H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h4%22%2F%3E%3Cpolyline%20points%3D%2216%2017%2021%2012%2016%207%22%2F%3E%3Cline%20x1%3D%2221%22%20y1%3D%2212%22%20x2%3D%229%22%20y2%3D%2212%22%2F%3E%3C%2Fsvg%3E");
}

.nav-upcoming-vacation .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%3Cline%20x1%3D%228%22%20y1%3D%222%22%20x2%3D%228%22%20y2%3D%226%22%2F%3E%3Cline%20x1%3D%2216%22%20y1%3D%222%22%20x2%3D%2216%22%20y2%3D%226%22%2F%3E%3Cline%20x1%3D%223%22%20y1%3D%2210%22%20x2%3D%2221%22%20y2%3D%2210%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%2215%22%20r%3D%221%22%20fill%3D%22black%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2215%22%20r%3D%221%22%20fill%3D%22black%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2215%22%20r%3D%221%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");
}

.nav-guide .nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2210%22%2F%3E%3Cpath%20d%3D%22M9.09%209a3%203%200%200%201%205.83%201c0%202-3%203-3%203%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%2217%22%20x2%3D%2212.01%22%20y2%3D%2217%22%2F%3E%3C%2Fsvg%3E");
}

/* ── User Guide ─────────────────────────────────────────────────── */
#user-guide-section {
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.guide-layout {
    display: flex;
    gap: 0;
    height: 100%;
    min-height: 0;
}

.guide-toc {
    width: 196px;
    min-width: 160px;
    flex-shrink: 0;
    padding: 1.25rem 0.75rem 1.5rem 1.25rem;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

.guide-toc-group {
    margin-bottom: 1.25rem;
}

.guide-toc-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-color);
    opacity: 0.6;
    margin-bottom: 0.35rem;
    padding-left: 0.3rem;
}

.guide-toc-link {
    display: block;
    font-size: 0.84rem;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.26rem 0.5rem;
    border-radius: 4px;
    border-left: 2px solid transparent;
    margin-bottom: 0.05rem;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.guide-toc-link:hover {
    background: var(--hover-bg, rgba(0,0,0,0.05));
}

.guide-toc-link.toc-active {
    color: var(--primary-color, #2563eb);
    border-left-color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.07);
    font-weight: 500;
}

.guide-content {
    flex: 1;
    padding: 1.5rem 2rem 4rem 1.75rem;
    min-width: 0;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

.guide-section {
    margin-bottom: 3rem;
    scroll-margin-top: 0.5rem;
}

.guide-section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.guide-section p {
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.guide-section ul {
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--secondary-color);
    padding-left: 1.2rem;
    margin: 0.25rem 0 0.5rem;
}

.guide-section ul li {
    margin-bottom: 0.2rem;
}

.guide-screenshot {
    margin: 0.9rem 0 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    line-height: 0;
}

.guide-screenshot svg,
.guide-screenshot img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-in;
}

.guide-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 1.5rem;
    box-sizing: border-box;
    animation: guide-lightbox-in 0.15s ease;
}

@keyframes guide-lightbox-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.guide-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    cursor: default;
    display: block;
}

.guide-lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}
.guide-lightbox-close:hover { opacity: 1; }

.guide-role-badge {
    display: inline-block;
    font-size: 0.69rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    margin-bottom: 0.4rem;
}

.guide-role-badge.badge-all   { background: #e0f2fe; color: #0369a1; }
.guide-role-badge.badge-mgr   { background: #fef3c7; color: #92400e; }
.guide-role-badge.badge-adj   { background: #ede9fe; color: #5b21b6; }
.guide-role-badge.badge-admin { background: #fce7f3; color: #9d174d; }

@media (max-width: 768px) {
    .guide-layout { flex-direction: column; height: auto; }
    .guide-toc { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid var(--border-color); height: auto; }
    .guide-content { height: auto; }
}

.nav-label {
    display: inline-block;
}

/* View As Banner */
.view-as-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 20px;
    padding: 0.3rem 0.75rem 0.3rem 0.9rem;
    font-size: 0.82rem;
    color: #856404;
    white-space: nowrap;
    overflow: hidden;
    max-width: 320px;
    flex-shrink: 1;
    min-width: 0;
}

.view-as-banner-text {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.btn-sm {
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
}

/* View As User Picker */
.va-search-wrap {
    margin-bottom: 1rem;
}

.va-search {
    width: 100%;
    max-width: 420px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.va-user-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 560px;
}

.va-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
}

.va-user-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0,122,255,0.12);
}

.va-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.va-user-avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.va-user-info {
    flex: 1 1 auto;
    min-width: 0;
}

.va-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark-text);
}

.va-user-meta {
    font-size: 0.78rem;
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item.nav-logout {
    background: none;
    border: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.nav-item:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

.nav-item.active {
    background-color: var(--hover-bg);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* Main Area */
.main-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.content-section h2 {
    margin-bottom: 1.5rem;
    color: var(--dark-text);
}

.entity-id {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin: 0;
    flex-shrink: 0;
}

.name-id-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-icon {
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    -webkit-mask: var(--card-icon) no-repeat center / contain;
    mask: var(--card-icon) no-repeat center / contain;
    flex: 0 0 auto;
}

.card-icon-vacation {
    --card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2019c2.5-2%205.5-2%208-2s5.5%200%208%202%22%2F%3E%3Cpath%20d%3D%22M11%206c1.3%202%201.3%205%201.3%208%22%2F%3E%3Cpath%20d%3D%22M13%206c1.3%202%201.3%205%201.3%208%22%2F%3E%3Cpath%20d%3D%22M12%206c-2%200-4%201-5.5%202.5%22%2F%3E%3Cpath%20d%3D%22M12%206c2.5%200%205%201%206.5%202.5%22%2F%3E%3Cpath%20d%3D%22M12%206c-1.5-1.5-3.5-2.5-5.5-3%22%2F%3E%3Cpath%20d%3D%22M12%206c1.5-1.5%203.5-2.5%205.5-3%22%2F%3E%3C%2Fsvg%3E");
}

.card-icon-sick {
    --card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%2014.5V5a2%202%200%200%200-4%200v9.5a4%204%200%201%200%204%200Z%22%2F%3E%3Cline%20x1%3D%2212%22%20y1%3D%228%22%20x2%3D%2212%22%20y2%3D%2214%22%2F%3E%3C%2Fsvg%3E");
}

.card-icon-employment {
    --card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%227%22%20width%3D%2218%22%20height%3D%2213%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%207V5a3%203%200%200%201%206%200v2%22%2F%3E%3Cpath%20d%3D%22M3%2013h18%22%2F%3E%3C%2Fsvg%3E");
}

.card-icon-requests {
    --card-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M16%202v4M8%202v4M3%2010h18%22%2F%3E%3C%2Fsvg%3E");
}

/* Dashboard — Upcoming Requests card */
#dashboard-requests-card {
    max-height: 300px;
    overflow-y: auto;
}

.dash-req-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
    margin: 0.75rem 0 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.dash-req-section-title:first-child {
    margin-top: 0;
}

.dash-req-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    gap: 0.5rem;
}

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

.dash-req-date {
    font-weight: 500;
    color: var(--dark-text);
    white-space: nowrap;
}

.dash-req-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--secondary-color);
    font-size: 0.8rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dash-req-empty {
    font-size: 0.85rem;
    color: var(--secondary-color);
    padding: 0.25rem 0;
}

.card h3 {
    margin-bottom: 0;
    color: var(--dark-text);
}

.stat-large {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.stat-subtext {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.stat-breakdown {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.stat-label-small {
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.stat-value-small {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.stat-value-small.stat-value-date {
    font-size: 1.2rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.info-item .label {
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.info-item .value {
    font-weight: 600;
    color: var(--dark-text);
}

.info-item .label-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.info-item .label-group .label {
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.info-item .label-group .helper-text {
    font-weight: 400;
    color: var(--tertiary-color, #999);
    font-size: 0.8rem;
}

.card-metric-rows .info-list {
    margin-top: 1rem;
    padding-top: 0;
    border-top: none;
    gap: 0;
}

.card-metric-rows .info-item .value {
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
}

.card-metric-rows .stat-inline-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    margin-bottom: 0.75rem;
}

.card-metric-rows .stat-inline-header .stat-large {
    margin-bottom: 0;
}

.card-metric-rows .stat-inline-header .stat-label {
    margin-left: auto;
    margin-bottom: 0;
    text-align: right;
    white-space: nowrap;
}

.card-employment-info .info-item .value {
    color: var(--primary-color);
}

/* Form Standard */
.form-standard {
    background: var(--surface-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 600px;
}

/* Form + Sidebar Layout */
.form-sidebar-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.form-sidebar-main {
    flex: 1 1 320px;
    min-width: 0;
    max-width: 600px;
}

.form-sidebar-card {
    flex: 1 1 auto;
    min-width: 240px;
    max-width: 420px;
    background: var(--surface-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

#request-time-sidebar,
#calloff-sidebar,
#late-sidebar {
    max-height: 500px;
    overflow-y: auto;
}

.form-sidebar-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.form-sidebar-card h4 + h4 {
    margin-top: 1rem;
}

.form-sidebar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.form-sidebar-table th {
    text-align: left;
    color: var(--secondary-color);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.form-sidebar-table td {
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--dark-text);
    vertical-align: top;
}

.form-sidebar-table tbody tr:last-child td {
    border-bottom: none;
}

.form-sidebar-table td.fst-reason {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-sidebar-empty {
    color: var(--secondary-color);
    font-size: 0.85rem;
    padding: 0.25rem 0;
}

.form-sidebar-loading {
    color: var(--secondary-color);
    font-size: 0.85rem;
}

@media (max-width: 1100px) {
    .form-sidebar-layout {
        flex-direction: column;
    }
    .form-sidebar-main {
        width: 100%;
        max-width: 100%;
    }
    .form-standard {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .form-sidebar-card {
        max-width: 100%;
        width: 100%;
    }
}

.info-text {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.table-card {
    background: var(--surface-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table thead {
    background-color: var(--surface-muted);
}

.table th,
.table td {
    text-align: left;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table th {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table tbody tr:hover {
    background-color: var(--hover-bg);
}

.table-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e4e8f1;
    color: #3b4a67;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.table-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.table-name {
    font-weight: 600;
    color: var(--dark-text);
}

.table-subtext {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.table-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
}

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 6px;
    white-space: nowrap;
}

.empty-card {
    background: var(--surface-bg);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    color: var(--secondary-color);
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.empty-text {
    font-size: 0.95rem;
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.employee-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.employee-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #e6ebf5;
    color: #2f3a57;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.employee-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.employee-name {
    font-weight: 600;
    color: var(--dark-text);
}

.employee-meta {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.employee-hire-date {
    font-size: 0.78rem;
    color: var(--secondary-color);
    opacity: 0.75;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .navbar-user-name {
        display: none;
    }

    .navbar {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.75rem;
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: hidden;
    }

    .navbar-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
    }

    .navbar-user {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-left: auto;
        flex: 0 0 auto;
        max-width: 55vw;
        min-width: 0;
    }

    .navbar-user #logout-btn {
        display: none;
    }

    .navbar-user .user-photo {
        order: 2;
    }

    .navbar-user .notification-bell {
        order: 1;
    }

    .navbar-user .settings-button {
        order: 2;
    }

    .navbar-user #user-name {
        order: 4;
        display: inline-flex;
        align-items: center;
        font-weight: 600;
        color: var(--dark-text);
        max-width: 140px;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .navbar-brand {
        flex: 1 1 auto;
        text-align: left;
        max-width: 35vw;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .view-as-banner {
        max-width: 38vw;
        padding: 0.25rem 0.5rem 0.25rem 0.65rem;
        font-size: 0.75rem;
        gap: 0.35rem;
    }

    .navbar-toggle {
        flex: 0 0 auto;
    }

    .sidebar {
        display: none;
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        width: 80vw;
        max-width: 280px;
        height: calc(100vh - var(--navbar-height));
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        background: var(--surface-bg);
        overflow-y: auto;
        z-index: 20;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .navbar.is-open + .container .sidebar {
        display: block;
    }

    .sidebar-nav {
        flex-direction: column;
    }

    .nav-item {
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }

    .container {
        height: auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow-x: hidden;
    }

    .main-content {
        height: auto;
        width: 100%;
        overflow-x: hidden;
    }

    .main-area {
        height: auto;
        padding: 1rem;
        width: 100%;
        overflow-x: hidden;
    }

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

    .login-container h1 {
        font-size: 2rem;
    }

    #login-form {
        max-width: 90%;
    }

    .navbar {
        padding: 1rem;
    }

    .settings-option {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-meta {
        align-items: stretch;
    }
}

@media (min-width: 769px) {
    .nav-item.nav-logout {
        display: none;
    }
}

@media (max-width: 480px) {
    .navbar-user {
        flex-direction: row;
        align-items: center;
    }

    .settings-button,
    .notification-bell {
        width: 40px;
        height: 40px;
    }

    #logout-btn {
        width: 100%;
    }
}
/* Employee List Styles */
.employee-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.employee-list .employee-card {
    border-bottom: none;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
}

.employee-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: var(--depth-indent, 0);
}

.employee-list .employee-card {
    border-bottom: none;
}

.employee-card:hover {
    background-color: var(--light-bg);
}

.employee-card.employee-card-off {
    background-color: #fff8e8;
    border-color: #f0d9a5;
}

.employee-card.employee-card-off:hover {
    background-color: #fff3d7;
}

.employee-card[data-depth="0"] { --depth-indent: 0; }
.employee-card[data-depth="1"] { --depth-indent: 2rem; }
.employee-card[data-depth="2"] { --depth-indent: 4rem; }
.employee-card[data-depth="3"] { --depth-indent: 6rem; }
.employee-card[data-depth="4"] { --depth-indent: 8rem; }

.employee-avatar-img {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.employee-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.employee-body {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.employee-name {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 0.1rem;
}

.employee-name-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.employee-tag-off {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #fff1d6;
    border: 1px solid #f3cb7f;
    color: #8a5b00;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.employee-meta {
    font-size: 0.875rem;
    color: var(--secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.employee-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.employee-stat-value {
    font-weight: 600;
    color: var(--dark-text);
}

.employee-stat-label {
    font-size: 0.75rem;
    color: var(--secondary-color);
}

/* Drag Preview Tooltip */
.drag-preview {
    position: fixed;
    background: rgba(220, 53, 69, 0.95);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}

/* Hierarchy Editor Styles */
.hierarchy-tree {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    min-height: 200px;
    padding: 0.5rem;
    /* lines extend into gap, so allow overflow */
    overflow: visible;
}

.hierarchy-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s;
    margin-left: var(--depth-indent, 0);
    position: relative;
    overflow: visible;
}

/* Vertical guide line for each ancestor depth level */
.hierarchy-depth-line {
    position: absolute;
    top: -0.375rem;   /* extend halfway into the 0.75rem tree gap above */
    bottom: -0.375rem; /* extend halfway into the 0.75rem tree gap below */
    width: 0;
    border-left: 1px dashed rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 0;
}

.hierarchy-card:hover {
    background-color: var(--light-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hierarchy-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    z-index: 10;
}

.hierarchy-card.drag-error {
    border: 2px solid #dc3545;
    background-color: #fff5f5;
}

/* Placeholder card shown during drag */
.hierarchy-card-placeholder {
    position: relative;
    background: transparent;
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    min-height: 80px;
    opacity: 0.7;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: margin-left 0.2s ease;
}

.hierarchy-placeholder-label {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
}

.hierarchy-disabled-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%);
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
}

.hierarchy-disabled-section.drag-over {
    background: linear-gradient(135deg, #ffcccc 0%, #ff9999 100%);
    border-color: #cc0000;
    box-shadow: inset 0 0 10px rgba(255, 107, 107, 0.3);
}

.hierarchy-disabled-header {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.hierarchy-disabled-header h3 {
    margin: 0 0 0.5rem 0;
    color: #cc0000;
    font-size: 1rem;
    font-weight: 700;
}

.hierarchy-disabled-header p {
    margin: 0;
    color: #990000;
    font-size: 0.875rem;
    font-weight: 500;
}

.hierarchy-disabled-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 80px;
}

.hierarchy-disabled-list.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 107, 107, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.4);
    color: #990000;
    font-style: italic;
}

.hierarchy-disabled-list .hierarchy-card {
    opacity: 0.6;
    filter: grayscale(30%);
    margin-left: 0;
}

.hierarchy-disabled-list .hierarchy-card:hover {
    opacity: 0.8;
}

.hierarchy-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.hierarchy-message {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.hierarchy-message.error {
    color: #dc3545;
}

.hierarchy-message.success {
    color: #28a745;
}

.employee-role-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
}

.hierarchy-card .name-id-row {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.hierarchy-card .employee-role-tags {
    margin-top: 0;
}

.hierarchy-card .employee-meta.inline {
    font-size: 0.82rem;
    white-space: nowrap;
    max-width: 24rem;
}

.hier-role-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.hier-role-tag.admin {
    background: #fde8e8;
    color: #b42318;
    border-color: #f6c7c7;
}

.hier-role-tag.manager {
    background: #e6f4ea;
    color: #166534;
    border-color: #b7e1c2;
}

/* Employee Detail Page */
.employee-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.employee-off-alert {
    margin-top: -1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #f3cb7f;
    background: #fff7e5;
    color: #8a5b00;
    font-weight: 600;
}

.employee-detail-header h2 {
    margin: 0;
    line-height: 1.2;
}

.detail-avatar-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.detail-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.btn-back {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.2s;
}

.btn-back:hover {
    color: #0056b3;
}

.employee-detail-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: var(--surface-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.detail-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.detail-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.detail-tab:hover {
    color: var(--dark-text);
}

.detail-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.detail-tab-content {
    display: none;
}

.detail-tab-content.active {
    display: block;
}

.detail-tab-content h3 {
    color: var(--dark-text);
    margin-bottom: 1rem;
    margin-top: 0;
    font-size: 1.25rem;
}

/* On-behalf inline form in employee detail tabs */
.emp-action-bar {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.emp-form-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--dark-text);
}

.emp-inline-form {
    max-width: 480px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 0.75rem;
}

.emp-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.employee-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.info-group {
    display: flex;
    flex-direction: column;
}

.info-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.info-group p {
    font-size: 1.125rem;
    color: var(--dark-text);
    font-weight: 500;
}

.detail-balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.balance-item {
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 120px;
}

.balance-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    font-weight: 500;
    min-height: 2.7em;
}

.balance-label-sub {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.72rem;
    color: var(--secondary-color);
    opacity: 0.85;
    font-weight: 500;
    line-height: 1.2;
}

.balance-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: auto;
    white-space: nowrap;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
}

.history-item-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
}

.history-item-value {
    font-size: 0.95rem;
    color: var(--dark-text);
}

.history-item-status {
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-item-status.approved {
    background-color: #d4edda;
    color: #155724;
}

.history-item-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.history-item-status.denied {
    background-color: #f8d7da;
    color: #721c24;
}

.history-pagination {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.empty-history {
    padding: 2rem;
    text-align: center;
    color: var(--secondary-color);
}

/* ── Sortable / Searchable Table (shared by all history tabs) ─────────────── */

.stbl-toolbar {
    padding: 0.625rem 0 0.625rem;
    display: flex;
    align-items: center;
}

.stbl-search {
    width: 100%;
    max-width: 320px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    font-size: 0.875rem;
    outline: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 0.6rem center;
    padding-left: 2rem;
}

.stbl-search:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .15);
}

.stbl-wrap {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.stbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.stbl thead tr {
    background: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.stbl th {
    padding: 0.625rem 0.875rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    white-space: nowrap;
}

.stbl-th {
    cursor: pointer;
    user-select: none;
}

.stbl-th:hover {
    background: #eef2ff;
    color: var(--primary-color);
}

.stbl-sort-icon::after {
    content: ' ⇅';
    margin-left: 0.2em;
    font-size: 1.2em;
    opacity: 0.35;
}

.stbl-sort-asc .stbl-sort-icon::after {
    content: ' ▲';
    opacity: 1;
    color: var(--primary-color);
}

.stbl-sort-asc {
    color: var(--primary-color);
}

.stbl-sort-desc .stbl-sort-icon::after {
    content: ' ▼';
    opacity: 1;
    color: var(--primary-color);
}

.stbl-sort-desc {
    color: var(--primary-color);
}

.stbl tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.1s;
}

.stbl tbody tr:last-child {
    border-bottom: none;
}

.stbl tbody tr:hover {
    background: #f0f4ff;
}

.stbl td {
    padding: 0.5rem 0.875rem;
    vertical-align: middle;
    color: var(--dark-text);
}

.stbl-empty {
    text-align: center;
    color: var(--secondary-color);
    padding: 2rem !important;
}

.stbl-reason {
    color: var(--secondary-color);
    font-size: 0.8rem;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stbl-submitter {
    font-size: 0.82rem;
    color: var(--primary-color);
    font-weight: 500;
}

.stbl-self {
    font-size: 0.82rem;
    color: var(--secondary-color);
}

/* Type badges */
.atlog-type-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 0.9rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.atlog-type-accrual  { background: #d4edda; color: #155724; }
.atlog-type-vacation { background: #cce5ff; color: #004085; }
.atlog-type-sick     { background: #fff3cd; color: #856404; }
.atlog-type-calloff  { background: #ffe5cc; color: #7a3800; }
.atlog-type-late     { background: #e2e3e5; color: #383d41; }
.atlog-type-setup    { background: #e8d5f5; color: #5a1a8a; }
.atlog-type-adjustment { background: #fde8d0; color: #7c3200; }

.atlog-anniversary-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 0.9rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    background: #e8d5f5;
    color: #5a1a8a;
    vertical-align: middle;
    margin-left: 0.35rem;
}

/* Amount column */
.atlog-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.atlog-amount-up      { color: var(--success-color); }
.atlog-amount-down    { color: var(--danger-color);  }
.atlog-amount-neutral { color: var(--secondary-color); }

/* Before / After balance columns */
.atlog-bal {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.atlog-bal-up      { color: var(--success-color); font-weight: 600; }
.atlog-bal-down    { color: var(--danger-color);  font-weight: 600; }
.atlog-bal-neutral { color: var(--dark-text); }

/* Sync Section Styles */
.section-subtitle {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.section-submeta {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-top: -0.8rem;
    margin-bottom: 1rem;
}

.daily-attendance-note {
    margin-top: 0.85rem;
    color: var(--secondary-color);
    font-size: 0.86rem;
}

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

.card-body ul {
    margin: 0.5rem 0 0 1.5rem;
    color: var(--dark-text);
}

.card-body ul li {
    margin: 0.5rem 0;
}

#sync-result {
    padding: 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: var(--surface-bg);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 700px);
}

.settings-card {
    padding: 0;
    overflow: hidden;
}

.settings-list {
    display: flex;
    flex-direction: column;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

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

.settings-option-copy h4 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    color: var(--dark-text);
}

.settings-option-copy p {
    margin: 0;
    color: var(--secondary-color);
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.theme-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-toggle-track {
    position: relative;
    display: inline-flex;
    width: 64px;
    height: 36px;
    border-radius: 999px;
    background: var(--toggle-track-bg);
    transition: background-color 0.2s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.theme-toggle-track::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--toggle-thumb-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.theme-toggle input:checked + .theme-toggle-track {
    background: var(--primary-color);
}

.theme-toggle input:checked + .theme-toggle-track::after {
    transform: translateX(28px);
}

.theme-toggle input:focus-visible + .theme-toggle-track {
    outline: 3px solid rgba(114, 178, 255, 0.35);
    outline-offset: 3px;
}

.btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#sync-status {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

#sync-details {
    font-size: 0.9em;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .employee-card {
        flex-direction: row;
        align-items: center;
        padding: 0.6rem 0.75rem;
        gap: 0.6rem;
    }

    .employee-avatar,
    .employee-avatar-img {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 0.75rem;
        border-radius: 50%;
    }

    .employee-body {
        flex: 1 1 0;
        min-width: 0;
    }

    .employee-name {
        font-size: 0.875rem;
        margin-bottom: 0.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .employee-meta {
        font-size: 0.72rem;
        line-height: 1.35;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .employee-stats {
        flex-direction: row;
        gap: 0.6rem;
        margin-top: 0;
        flex-shrink: 0;
        align-items: center;
        justify-content: flex-end;
    }

    .employee-stat {
        align-items: center;
        gap: 0;
    }

    .employee-stat-value {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .employee-stat-label {
        font-size: 0.62rem;
        color: var(--secondary-color);
    }

    .employee-card[data-depth="0"] { --depth-indent: 0; }
    .employee-card[data-depth="1"] { --depth-indent: 1rem; }
    .employee-card[data-depth="2"] { --depth-indent: 2rem; }
    .employee-card[data-depth="3"] { --depth-indent: 3rem; }
    .employee-card[data-depth="4"] { --depth-indent: 4rem; }

    .employee-stats {
        width: auto;
    }

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

    .history-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .detail-tabs {
        gap: 0.5rem;
    }

    .detail-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* -------------------------------------------------------------------------
   Admin Setup Page
   ------------------------------------------------------------------------- */

.section-header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.section-header-actions h2 {
    margin: 0;
}

.section-header-controls {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
    padding-top: 0.25rem;
    margin-left: auto;
}

.section-header-controls .btn-primary,
.section-header-controls .btn-secondary,
.section-header-controls .btn-success {
    white-space: nowrap;
    width: auto;
}

:root[data-theme="dark"] .form-sidebar-card,
:root[data-theme="dark"] .employee-detail-container,
:root[data-theme="dark"] .hierarchy-card,
:root[data-theme="dark"] .va-user-item {
    background: var(--surface-bg);
}

:root[data-theme="dark"] .info-text,
:root[data-theme="dark"] .table thead,
:root[data-theme="dark"] .settings-pill {
    background: var(--surface-muted);
}

:root[data-theme="dark"] .form-group input,
:root[data-theme="dark"] .form-group textarea,
:root[data-theme="dark"] .form-group select,
:root[data-theme="dark"] .va-search {
    background: var(--input-bg);
    color: var(--dark-text);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .view-as-banner {
    background: rgba(245, 197, 97, 0.12);
    border-color: rgba(245, 197, 97, 0.45);
    color: #f5d998;
}

:root[data-theme="dark"] .table-avatar,
:root[data-theme="dark"] .employee-avatar {
    background: #21344c;
    color: #dce8f7;
}

:root[data-theme="dark"] .table tbody tr:hover,
:root[data-theme="dark"] .hierarchy-card:hover,
:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .nav-item.active {
    background-color: var(--hover-bg);
}

:root[data-theme="dark"] .hierarchy-depth-line {
    border-left-color: rgba(237, 243, 255, 0.12);
}

/* ── Dark mode: grey / secondary buttons ─────────────────────────────────── */
:root[data-theme="dark"] .btn-secondary {
    background-color: #2e4257;
    color: #c8d9ee;
    border: 1px solid #3d5470;
}

:root[data-theme="dark"] .btn-secondary:hover {
    background-color: #3a5269;
    color: #eaf2ff;
    border-color: #4e6a86;
}

:root[data-theme="dark"] .btn-secondary:disabled {
    opacity: 0.45;
}

/* ── Dark mode: sortable-table / history-tab surfaces ─────────────────────── */
:root[data-theme="dark"] .stbl-wrap {
    background: var(--surface-bg);
}

:root[data-theme="dark"] .stbl thead tr {
    background: var(--surface-muted);
}

:root[data-theme="dark"] .stbl-th:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

:root[data-theme="dark"] .stbl tbody tr:hover {
    background: var(--hover-bg);
}

:root[data-theme="dark"] .stbl td,
:root[data-theme="dark"] .stbl th {
    color: var(--dark-text);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .stbl tbody tr {
    border-color: var(--border-color);
}

/* ── Dark mode: sortable-table search input ──────────────────────────────── */
:root[data-theme="dark"] .stbl-search {
    background-color: var(--input-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a3afc2' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.6rem center;
    color: var(--dark-text);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .stbl-search:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(114, 178, 255, 0.18);
}

/* ── Dark mode: employee card rows (default state) ───────────────────────── */
:root[data-theme="dark"] .employee-card {
    background: var(--surface-bg);
}

:root[data-theme="dark"] .employee-list .employee-card {
    background: var(--surface-bg);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .employee-card:hover {
    background-color: var(--hover-bg);
}

:root[data-theme="dark"] .employee-card.employee-card-off {
    background-color: rgba(245, 197, 97, 0.09);
    border-color: rgba(245, 197, 97, 0.35);
}

:root[data-theme="dark"] .employee-card.employee-card-off:hover {
    background-color: rgba(245, 197, 97, 0.16);
}

/* ── Dark mode: off-today alert banner (employee detail) ─────────────────── */
:root[data-theme="dark"] .employee-off-alert {
    background: rgba(245, 197, 97, 0.1);
    border-color: rgba(245, 197, 97, 0.38);
    color: #f5d998;
}

/* ── Dark mode: hierarchy disabled / drop-zone ───────────────────────────── */
:root[data-theme="dark"] .hierarchy-disabled-section {
    background: linear-gradient(135deg, rgba(220, 50, 50, 0.12) 0%, rgba(180, 30, 30, 0.18) 100%);
    border-color: rgba(220, 60, 60, 0.55);
}

:root[data-theme="dark"] .hierarchy-disabled-section.drag-over {
    background: linear-gradient(135deg, rgba(220, 50, 50, 0.22) 0%, rgba(180, 30, 30, 0.32) 100%);
    border-color: rgba(220, 60, 60, 0.85);
    box-shadow: inset 0 0 10px rgba(220, 60, 60, 0.2);
}

:root[data-theme="dark"] .hierarchy-disabled-header h3 {
    color: #ff8080;
}

:root[data-theme="dark"] .hierarchy-disabled-header p {
    color: #cc8888;
}

/* ── Dark mode: admin setup table rows ───────────────────────────────────── */
:root[data-theme="dark"] #admin-setup-table-container .table-card {
    background: var(--surface-bg);
}

:root[data-theme="dark"] #admin-setup-table-container table thead {
    background: var(--surface-muted);
}

:root[data-theme="dark"] #admin-setup-table-container .setup-table thead tr {
    background: #232f3e !important;
    border-bottom: 2px solid var(--border-color) !important;
}

:root[data-theme="dark"] #admin-setup-table-container .setup-table th {
    color: var(--secondary-color) !important;
    background: #232f3e !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 1px 0 var(--border-color);
}


:root[data-theme="dark"] #admin-setup-table-container table tbody tr {
    background: var(--surface-bg);
}

:root[data-theme="dark"] #admin-setup-table-container table tbody tr:hover {
    background: var(--hover-bg);
}

:root[data-theme="dark"] #admin-setup-table-container table th,
:root[data-theme="dark"] #admin-setup-table-container table td,
:root[data-theme="dark"] #admin-setup-table-container table {
    border-color: var(--border-color);
    color: var(--dark-text);
}

:root[data-theme="dark"] #admin-setup-manager-emails {
    background: var(--input-bg);
    color: var(--dark-text);
    border-color: var(--border-color);
}

#admin-setup-manager-emails {
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 6px;
    padding: 0.5rem 0.625rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: inherit;
    background: var(--card-bg, #fff);
}

#admin-setup-manager-emails:focus {
    outline: none;
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.admin-setup-manager-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-setup-manager-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

#admin-setup-table-container {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.setup-table-scroll {
    position: relative;
    height: 100%;
    overflow: auto;
    max-height: none;
}

/* Admin setup table */
.setup-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    background: var(--card-bg, #fff);
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.setup-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.setup-table thead tr {
    background: var(--table-header-bg, #f5f7fa);
}

.setup-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--table-header-bg, #f5f7fa);
}

.setup-table th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    white-space: nowrap;
}

.setup-table th.num-col,
.setup-table td.num-col {
    text-align: right;
}

.setup-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    vertical-align: middle;
}

.setup-table tbody tr:last-child td {
    border-bottom: none;
}

.setup-table tbody tr:hover {
    background: var(--hover-bg, #f9fafb);
}

/* Inline inputs inside the setup table */
.setup-table input[type="date"],
.setup-table input[type="number"],
.setup-table input[type="email"] {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    padding: 0.25rem 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: inherit;
    width: 100%;
    min-width: 0;
    transition: border-color 0.15s, background 0.15s;
}

.setup-table input[type="date"] { max-width: 140px; }
.setup-table input[type="number"] { max-width: 80px; text-align: right; }
.setup-table input[type="email"] { max-width: 200px; }

.setup-table input[type="date"]:focus,
.setup-table input[type="number"]:focus,
.setup-table input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color, #4f46e5);
    background: #fff;
}

:root[data-theme="dark"] .setup-table input[type="date"],
:root[data-theme="dark"] .setup-table input[type="number"],
:root[data-theme="dark"] .setup-table input[type="email"] {
    background: var(--input-bg, #1f2a38);
    color: var(--dark-text);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .setup-table input[type="date"]:focus,
:root[data-theme="dark"] .setup-table input[type="number"]:focus,
:root[data-theme="dark"] .setup-table input[type="email"]:focus {
    background: var(--input-bg, #1f2a38);
    color: var(--dark-text);
    border-color: var(--primary-color, #4f46e5);
}

/* Dirty row indicator */
.setup-row-dirty {
    background: #fffbeb !important;
    border-left: 3px solid #f59e0b;
}

:root[data-theme="dark"] .setup-row-dirty {
    background: #2b3441 !important;
    color: var(--dark-text);
}

.setup-row-dirty td:first-child {
    padding-left: calc(0.75rem - 3px);
}

/* Offset value coloring */
.offset-negative {
    color: var(--danger-color, #dc3545);
    font-weight: 600;
}

.offset-positive {
    color: var(--success-color, #16a34a);
    font-weight: 600;
}

/* User name/email in cells */
.su-unconfigured-icon {
    color: #d97706;
    font-size: 0.85rem;
    cursor: help;
    vertical-align: middle;
}

.su-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.su-email-text {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    margin-top: 0.1rem;
}

/* Muted read-only cells */
.setup-table td.muted {
    color: var(--text-muted, #9ca3af);
    font-size: 0.8rem;
}

/* Active/Inactive badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-active {
    background: #dcfce7;
    color: #15803d;
}

.badge-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

@media (max-width: 900px) {
    .setup-table th.num-col,
    .setup-table td.num-col {
        display: none;
    }

    .setup-table th.num-col:nth-child(5),
    .setup-table td.num-col:nth-child(5),
    .setup-table th.num-col:nth-child(8),
    .setup-table td.num-col:nth-child(8) {
        display: table-cell;
    }

    .section-header-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Admin migration page */
.admin-migration-card {
    max-width: 920px;
}

.admin-migration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.admin-migration-note {
    display: block;
    margin-top: 0.35rem;
    color: var(--secondary-color);
    font-size: 0.8rem;
}

.admin-migration-actions {
    display: flex;
    justify-content: flex-end;
}

#admin-migration-summary strong {
    color: var(--dark-text);
}

/* ===== Upcoming Vacation Calendar ===== */

.upcoming-vacation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.upcoming-vacation-header h2 {
    margin: 0;
}

.upcoming-vacation-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.upcoming-vacation-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.uv-month-label {
    font-weight: 600;
    font-size: 1rem;
    min-width: 9rem;
    text-align: center;
    color: var(--dark-text);
}

.uv-view-toggle {
    display: flex;
    gap: 0.375rem;
}

.uv-toggle-btn {
    transition: background 0.15s, color 0.15s;
}

/* Calendar grid */
.uv-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.uv-dow-header {
    background: var(--surface-muted);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--secondary-color);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.uv-dow-header:last-of-type {
    border-right: none;
}

.uv-calendar-body {
    display: contents;
}

.uv-day-cell {
    background: var(--surface-bg);
    aspect-ratio: 1;
    padding: 0.3rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    min-width: 0;
    /* Remove right border on Saturday (col 7) — managed by JS adding uv-col-7 */
}

.uv-day-cell.uv-col-7 {
    border-right: none;
}

.uv-day-cell.uv-other-month {
    background: var(--surface-muted);
    opacity: 0.55;
}

.uv-day-cell.uv-today {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.uv-day-cell.uv-cvm-start {
    background: #fffbeb;
}

:root[data-theme="dark"] .uv-day-cell.uv-cvm-start {
    background: #231a09;
    box-shadow: inset 0 0 0 1px #7c5a16;
}

.uv-cvm-start-badge {
    display: inline-block;
    background: #f59e0b;
    color: #1c1400;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 5px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uv-cvm-start-row td {
    background: #fffbeb;
    font-weight: 600;
}

:root[data-theme="dark"] .uv-cvm-start-row td {
    background: #231a09;
}

.uv-day-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1;
    align-self: flex-start;
    margin-bottom: 2px;
}

.uv-today .uv-day-num {
    color: var(--primary-color);
}

.uv-event {
    display: block;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    /* background and color set via inline style per-person */
}

.uv-anniversaries {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.uv-anniversary {
    display: block;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    background: #fef3c7;
    color: #92400e;
}

:root[data-theme="dark"] .uv-anniversary {
    background: #3b2a00;
    color: #fde68a;
}

@media (max-width: 768px) {
    .upcoming-vacation-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .uv-day-cell {
        min-height: 60px;
        padding: 0.2rem;
    }

    .uv-event {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
}
}