:root {
    --primary-color: #a50034;
    --primary-dark: #8a002b;
    --primary-light: #c41a50;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;

    /* Override Bootstrap's blue primary with brand crimson */
    --bs-primary: #a50034;
    --bs-primary-rgb: 165, 0, 52;
    --bs-primary-text-emphasis: #8a002b;
    --bs-primary-bg-subtle: rgba(165, 0, 52, 0.1);
    --bs-primary-border-subtle: rgba(165, 0, 52, 0.3);
    --bs-link-color: #a50034;
    --bs-link-color-rgb: 165, 0, 52;
    --bs-link-hover-color: #8a002b;
    --bs-link-hover-color-rgb: 138, 0, 43;
    --bs-focus-ring-color: rgba(165, 0, 52, 0.25);

    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);

    --navbar-bg: var(--primary-color);
    --card-bg: var(--bg-primary);
    --input-bg: var(--bg-primary);
}

[data-theme="dark"] {
    --bg-primary: #1a1d23;
    --bg-secondary: #12151a;
    --bg-tertiary: #2d3139;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --border-color: #3d4450;
    --shadow: rgba(0, 0, 0, 0.3);

    --card-bg: #2d3139;
    --input-bg: #1a1d23;
    --bs-secondary-color: #adb5bd;

    /* Lighten primary for legibility on dark backgrounds */
    --primary-color: #e8305a;
    --primary-dark: #c41a50;
    --primary-light: #ff5577;
    /* Keep navbar the original deep crimson — it's a solid bg, contrast isn't an issue */
    --navbar-bg: #a50034;

    /* Bootstrap primary overrides for dark mode */
    --bs-primary: #e8305a;
    --bs-primary-rgb: 232, 48, 90;
    --bs-primary-text-emphasis: #ff5577;
    --bs-primary-bg-subtle: rgba(232, 48, 90, 0.15);
    --bs-primary-border-subtle: rgba(232, 48, 90, 0.3);
    --bs-link-color: #e8305a;
    --bs-link-color-rgb: 232, 48, 90;
    --bs-link-hover-color: #ff5577;
    --bs-link-hover-color-rgb: 255, 85, 119;
    --bs-focus-ring-color: rgba(232, 48, 90, 0.25);
}

html {
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.875rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

/* Nav pills */
.nav-pills .nav-link.active {
    background-color: var(--primary-color);
}

.nav-pills .nav-link:not(.active) {
    color: var(--primary-color);
}

/* Brand outline buttons */
.btn-outline-primary {
    --bs-btn-color: #a50034;
    --bs-btn-border-color: #a50034;
    --bs-btn-hover-bg: #a50034;
    --bs-btn-hover-border-color: #a50034;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #8a002c;
    --bs-btn-active-border-color: #8a002c;
    --bs-btn-active-color: #fff;
}

.btn-outline-secondary {
    --bs-btn-color: #a50034;
    --bs-btn-border-color: #a50034;
    --bs-btn-hover-bg: #a50034;
    --bs-btn-hover-border-color: #a50034;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #8a002c;
    --bs-btn-active-border-color: #8a002c;
    --bs-btn-active-color: #fff;
}

/* Text selection */
::selection {
    background-color: rgba(165, 0, 52, 0.25);
    color: inherit;
}

/* Brand checkboxes */
.form-check-input:checked {
    background-color: #a50034;
    border-color: #a50034;
}

.form-check-input:focus {
    border-color: #a50034;
    box-shadow: 0 0 0 0.25rem rgba(165, 0, 52, 0.25);
}

/* Navbar */
.navbar {
    background-color: var(--navbar-bg);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand img {
    height: 60px;
    filter: brightness(0) invert(1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.25);
}

.nav-avatar {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    transition: border-color 0.2s ease;
}
.nav-avatar:hover {
    border-color: rgba(255,255,255,0.7);
}

.logout-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* Notification bell */
.notif-wrapper {
    position: relative;
}

.notif-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    padding: 0;
}

.notif-btn:hover {
    background: rgba(255,255,255,0.25);
}

.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    width: 340px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 9999;
    overflow: hidden;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-primary);
}

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

.notif-item:hover {
    background: var(--bg-secondary);
}

.notif-item.unread {
    background: rgba(165, 0, 52, 0.05);
}

.notif-item.unread:hover {
    background: rgba(165, 0, 52, 0.09);
}

.notif-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.notif-icon.shift     { background: rgba(23,162,184,0.15); color: #17a2b8; }
.notif-icon.leave     { background: rgba(40,167,69,0.15);  color: #28a745; }
.notif-icon.leave-denied { background: rgba(220,53,69,0.15); color: #dc3545; }
.notif-icon.notice    { background: rgba(255,193,7,0.15);  color: #d39e00; }
.notif-icon.default   { background: rgba(108,117,125,0.15); color: #6c757d; }

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

.notif-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-msg {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.notif-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    align-self: center;
    margin-left: 2px;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:focus,
.btn-primary:focus-visible {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 0.2rem rgba(165, 0, 52, 0.25);
}

.btn-primary:active,
.btn-primary.active,
.btn-primary:first-child:active,
:not(.btn-check) + .btn-primary:active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Cards */
.card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
    transition: background-color 0.3s ease;
}

.card-header {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Forms */
.form-control, .form-select {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(165, 0, 52, 0.25);
}

.input-group-text {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Modals */
.modal-content {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

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

/* Lists */
.list-group-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.list-group-item-action:hover {
    background-color: var(--bg-tertiary);
}

.list-group-item-action.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Tables */
.table {
    color: var(--text-primary);
}

.table > thead {
    background-color: var(--bg-tertiary);
}

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

.table-bordered {
    border-color: var(--border-color);
}

.table-bordered > :not(caption) > * > * {
    border-color: var(--border-color);
}

/* Tabs */
.nav-tabs {
    border-bottom-color: var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
}

.nav-tabs .nav-link:hover {
    border-color: var(--bg-tertiary) var(--bg-tertiary) var(--border-color);
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    background-color: var(--card-bg);
    border-color: var(--border-color) var(--border-color) var(--card-bg);
    color: var(--primary-color);
    font-weight: 600;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.login-logo-container {
    background-color: var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 0 auto 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-logo {
    display: block;
    max-width: 270px;
    filter: brightness(0) invert(1);
}

/* Stat cards */
.stat-card {
    padding: 1.25rem;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 4px var(--shadow);
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 1rem;
}


.stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(165, 0, 52, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(165, 0, 52, 0.25);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 0.3rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

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

.schedule-header {
    background-color: var(--bg-tertiary);
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.schedule-cell {
    background-color: var(--card-bg);
    padding: 0.25rem;
    min-height: 60px;
    font-size: 0.75rem;
}

.schedule-name {
    background-color: var(--bg-tertiary);
    padding: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.avatar-upload-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    overflow: hidden;
    width: 100px;
    height: 100px;
}
.avatar-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.avatar-upload-wrapper:hover .avatar-upload-overlay {
    opacity: 1;
}

a.profile-link {
    color: var(--primary-color);
    text-decoration: none;
}
a.profile-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.shift-block {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    margin: 1px 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.shift-block:hover {
    opacity: 0.85;
}

.overtime-block {
}

/* Absence block */
.absence-block {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: #6f42c1;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    margin: 1px 0;
}

/* Leave block */
.leave-block {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: #0d6efd;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    margin: 1px 0;
}

.leave-block.leave-pending {
    opacity: 0.6;
    border: 1px dashed rgba(255, 255, 255, 0.5);
}

/* Non-Working Day block */
.nwd-block {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    margin: 1px 0;
}

.nwd-block:hover {
    opacity: 0.7;
}

.nwd-block.nwd-pending {
    background-color: rgba(255, 193, 7, 0.15);
    border-color: #ffc107;
    color: #856404;
}

[data-bs-theme="dark"] .nwd-block.nwd-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.nwd-block.nwd-denied {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #842029;
    text-decoration: line-through;
}

[data-bs-theme="dark"] .nwd-block.nwd-denied {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* Schedule cell context menu */
.schedule-cell-menu {
    z-index: 9999;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--shadow);
    padding: 0.25rem 0;
    min-width: 180px;
    white-space: nowrap;
}


.schedule-cell-menu .dropdown-item {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    display: block;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    color: var(--text-primary);
}

.schedule-cell-menu .dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

.schedule-cell {
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.schedule-cell-empty {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-add-icon {
    opacity: 0.6;
    transition: opacity 0.15s, transform 0.15s;
}

.schedule-add-ot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s, transform 0.15s;
}

.schedule-add-ot:hover {
    opacity: 1;
    transform: scale(1.3);
}

.schedule-cell-empty:hover .schedule-add-icon {
    opacity: 1;
    transform: scale(1.3);
}

/* Personal schedule view */
.personal-schedule {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.personal-day {
    display: flex;
    align-items: stretch;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.personal-day-today {
    border-color: var(--border-color);
    background: rgba(165, 0, 52, 0.08);
    box-shadow: 0 0 12px rgba(165, 0, 52, 0.25);
}

.personal-day-header {
    width: 160px;
    min-width: 160px;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.personal-day-today .personal-day-header {
    color: var(--brand-color);
}

.personal-day-content {
    flex: 1;
    padding: 0.4rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.personal-day-content .shift-block,
.personal-day-content .nwd-block,
.personal-day-content .leave-block {
    margin: 0;
}

.leave-block {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Small nav pills for schedule mode */
.nav-pills-sm .nav-link {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

@media (max-width: 576px) {
    .personal-day {
        flex-direction: column;
    }
    .personal-day-header {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0.4rem 0.5rem;
    }
}

/* Leave calendar */
.leave-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Notice cards */
.notice-card {
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.notice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.notice-card.priority-urgent {
    border-left-color: var(--danger-color);
}

.notice-card.priority-high {
    border-left-color: var(--warning-color);
}

.notice-card.priority-normal {
    border-left-color: var(--primary-color);
}

.notice-card.priority-low {
    border-left-color: var(--info-color);
}

.notice-card.unread {
    background-color: rgba(165, 0, 52, 0.03);
}

.notice-card.notice-needs-ack {
    background-color: rgba(165, 0, 52, 0.06);
    border-left-width: 5px;
}

[data-theme="dark"] .table {
    --bs-table-bg: var(--card-bg);
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: var(--text-primary);
}

[data-theme="dark"] .table thead {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .stat-icon {
    background: rgba(232, 48, 90, 0.15);
    border-color: rgba(232, 48, 90, 0.5);
}

[data-theme="dark"] .notice-card.unread {
    background-color: rgba(165, 0, 52, 0.1);
}

[data-theme="dark"] .card-body,
[data-theme="dark"] .card-body p,
[data-theme="dark"] .card-body h6 {
    color: var(--text-primary);
}

.notice-pinned {
    position: relative;
}

.notice-pinned::before {
    content: '\F5F7';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--primary-color);
}

@keyframes noticeHighlight {
    0%   { box-shadow: 0 0 0 3px rgba(165, 0, 52, 0.6); }
    100% { box-shadow: 0 0 0 3px rgba(165, 0, 52, 0); }
}

.notice-highlight {
    animation: noticeHighlight 2s ease-out forwards;
}

/* Priority badges */
.badge-urgent { background-color: var(--danger-color); }
.badge-high { background-color: var(--warning-color); color: #212529; }
.badge-normal { background-color: var(--primary-color); }
.badge-low { background-color: var(--info-color); }

/* Status badges */
.badge-pending { background-color: var(--warning-color); color: #212529; }
.badge-approved { background-color: var(--success-color); }
.badge-denied { background-color: var(--danger-color); }
.badge-cancelled { background-color: var(--secondary-color); }

/* Payroll table */
.payroll-summary {
    background-color: var(--bg-tertiary);
    font-weight: 600;
}

/* Dashboard widgets */
.widget-card {
    border: none;
    box-shadow: 0 2px 8px var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.widget-card .card-header {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.widget-card .card-header.bg-success { background-color: var(--success-color) !important; }
.widget-card .card-header.bg-warning { background-color: var(--warning-color) !important; color: #212529; }
.widget-card .card-header.bg-info { background-color: var(--info-color) !important; }

/* Pagination */
.page-link {
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dropdown */
.dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

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

.dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

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

/* Footer */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.site-footer a {
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--primary-color) !important;
}

/* View sections */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* Org Chart */
.org-chart-wrapper {
    overflow-x: auto;
    padding: 1rem 0;
}

.org-chart {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.org-node {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 6px var(--shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    min-width: 180px;
}

.org-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

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

.org-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.org-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.org-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.org-dept {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.org-children {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    position: relative;
}

/* Connector lines */
.org-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 1.5rem;
    border-left: 2px solid var(--border-color);
    transform: translateX(-50%);
}

.org-children > .org-node {
    position: relative;
}

.org-children > .org-node::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    width: 0;
    height: 1.5rem;
    border-left: 2px solid var(--border-color);
    transform: translateX(-50%);
}

/* Horizontal connector between siblings */
.org-children > .org-node:not(:only-child)::after {
    content: '';
    position: absolute;
    top: -1.5rem;
    height: 0;
    border-top: 2px solid var(--border-color);
}

.org-children > .org-node:first-child:not(:only-child)::after {
    left: 50%;
    right: 0;
    width: calc(50% + 0.5rem);
}

.org-children > .org-node:last-child:not(:only-child)::after {
    right: 50%;
    left: 0;
    width: calc(50% + 0.5rem);
}

.org-children > .org-node:not(:first-child):not(:last-child)::after {
    left: -0.5rem;
    right: -0.5rem;
    width: calc(100% + 1rem);
}

/* Loading spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border {
    color: var(--primary-color);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 10000;
}

/* Responsive */
@media (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: 80px repeat(7, 1fr);
    }

    .stat-card {
        min-width: auto;
    }

    .navbar-brand img {
        height: 35px;
    }
}

@media (max-width: 576px) {
    .schedule-grid {
        overflow-x: auto;
    }
}

/* Print styles for payroll */
@media print {
    .navbar, .nav-tabs, .btn, .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}
