/* Dark Mode Variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --shadow: rgba(0, 0, 0, 0.1);
    /* Brand Colors */
    --brand-primary: #23413e; /* Primary brand color */
    --brand-secondary: #22c55f88; /* Secondary brand color with 53% opacity */
    --brand-color: #23413e; /* Primary color in light mode */
}

[data-theme="dark"] {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --text-primary: #ffffff;
    --text-secondary: #e5e7eb;
    --text-tertiary: #d1d5db;
    --border-primary: #4b5563;
    --border-secondary: #6b7280;
    --shadow: rgba(0, 0, 0, 0.4);
    /* Brand Colors */
    --brand-primary: #23413e; /* Primary brand color */
    --brand-secondary: #22c55f88; /* Secondary brand color with 53% opacity */
    --brand-color: #22c55f88; /* Secondary color in dark mode */
}

/* Custom Styles */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Brand Color Classes */
.text-brand-color {
    color: var(--brand-color);
}

.bg-brand-color {
    background-color: var(--brand-color);
}

.hover\:bg-brand-color:hover {
    background-color: var(--brand-color);
    opacity: 0.9;
}

.border-brand-color {
    border-color: var(--brand-color);
}

/* Brand Primary Color Classes */
.text-brand-primary {
    color: var(--brand-primary);
}

.bg-brand-primary {
    background-color: var(--brand-primary);
}

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

/* Brand Secondary Color Classes */
.text-brand-secondary {
    color: var(--brand-secondary);
}

.bg-brand-secondary {
    background-color: var(--brand-secondary);
}

.border-brand-secondary {
    border-color: var(--brand-secondary);
}

body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-btn {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

.nav-btn.active {
    color: var(--brand-color);
    background-color: rgba(35, 65, 62, 0.1);
}

/* Dark mode specific overrides */
[data-theme="dark"] .nav-btn.active {
    color: var(--brand-color);
    background-color: rgba(34, 197, 95, 0.15);
}

.form-input, .form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-secondary);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    display: none;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 42rem;
    max-height: 90vh;
    overflow-y: auto;
    margin: 1rem;
    border: 2px solid var(--brand-color);
}

/* Modal header styling with brand colors */
.modal-content .flex.justify-between.items-center {
    border-bottom: 1px solid var(--brand-color);
    padding-bottom: 1rem;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 100px repeat(7, 1fr);
    gap: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--brand-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.time-slot {
    min-height: 60px;
    background-color: var(--bg-primary);
    padding: 0.25rem;
    transition: all 0.15s ease;
    position: relative;
    border-right: 1px solid var(--brand-color);
    border-bottom: 1px solid var(--brand-color);
}

.time-slot:hover {
    background-color: #f8fafc;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.time-slot.drag-over {
    background-color: #dbeafe;
    border: 2px dashed #3b82f6;
}

.employee-card {
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    cursor: move;
    transition: all 0.2s ease;
    user-select: none;
}

.employee-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.employee-card.dragging {
    opacity: 0.5;
}

.shift-card {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.shift-card:hover {
    transform: scale(1.02);
}

.shift-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg) scale(0.95);
}

.shift-card.vacation {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.shift-card.sick {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.shift-card.regular {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.shift-card.holiday {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #22c55e;
}

.day-shift.holiday {
    background-color: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.shift-card.mandatory-vacation {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.day-shift.mandatory-vacation {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.shift-card.training {
    background-color: #e0e7ff;
    color: #3730a3;
    border: 1px solid #6366f1;
}

.schedule-view {
    display: none;
}

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

.view-btn {
    background-color: var(--brand-color);
    color: white;
    transition: all 0.2s ease;
}

.view-btn:hover {
    opacity: 0.9;
}

.view-btn.active {
    background-color: var(--brand-color);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--brand-color);
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--brand-color);
    border: 1px solid var(--brand-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.month-header {
    background-color: var(--brand-color);
    padding: 0.75rem;
    font-weight: 600;
    color: white;
    text-align: center;
    border-bottom: 1px solid var(--brand-color);
    font-size: 0.875rem;
}

/* Dark mode specific overrides for month view */
[data-theme="dark"] .month-header {
    color: white;
}

.month-day {
    min-height: 120px;
    background-color: var(--bg-primary);
    padding: 0.5rem;
    border: 1px solid var(--brand-color);
    position: relative;
    overflow: hidden;
}

.month-day .day-number {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: default !important;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
}

.month-day.other-month {
    background-color: #ffffff;
    opacity: 0.25;
}

.month-day.today {
    background-color: #dbeafe;
    border-color: #3b82f6;
}

/* Week view today highlight */
.day-column.today {
    background-color: #dbeafe;
    border-color: #3b82f6;
}

.month-day.selected-week {
    background-color: #dbeafe;
    border-color: #3b82f6;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.day-number {
    font-weight: 600;
    margin-bottom: 0.25rem;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: default !important;
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
}

.employee-colors {
    --color-1: #dbeafe; /* blue */
    --color-2: #dcfce7; /* green */
    --color-3: #e0e7ff; /* indigo */
    --color-4: #fef3c7; /* yellow */
    --color-5: #fee2e2; /* red */
    --color-6: #f3e8ff; /* purple */
    --color-7: #ecfdf5; /* emerald */
    --color-8: #fdf2f8; /* pink */
}

.color-1 { background-color: var(--color-1); color: #1e40af; }
.color-2 { background-color: var(--color-2); color: #166534; }
.color-3 { background-color: var(--color-3); color: #3730a3; }
.color-4 { background-color: var(--color-4); color: #92400e; }
.color-5 { background-color: var(--color-5); color: #991b1b; }
.color-6 { background-color: var(--color-6); color: #7c3aed; }
.color-7 { background-color: var(--color-7); color: #047857; }
.color-8 { background-color: var(--color-8); color: #be185d; }

.sortable-ghost {
    opacity: 0.4;
}

.sortable-chosen {
    transform: rotate(5deg);
}

.time-header {
    background-color: var(--brand-color);
    padding: 0.375rem 0.25rem;
    font-weight: 500;
    color: white;
    border-right: 1px solid var(--brand-color);
    border-bottom: 1px solid var(--brand-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    min-height: 60px;
}

.day-header {
    background-color: var(--brand-color);
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    color: white;
    text-align: center;
    border-right: 1px solid var(--brand-color);
    border-bottom: 1px solid var(--brand-color);
    font-size: 0.875rem;
}

/* Dark mode specific overrides for week view headers */
[data-theme="dark"] .time-header,
[data-theme="dark"] .day-header {
    color: white;
}

@media (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: 70px repeat(7, minmax(80px, 1fr));
        border: 1px solid var(--brand-color);
    }
    
    .time-header {
        font-size: 0.625rem;
        padding: 0.25rem;
        background-color: var(--brand-color);
        color: white;
        border-right: 1px solid var(--brand-color);
        border-bottom: 1px solid var(--brand-color);
    }
    
    .day-header {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
        background-color: var(--brand-color);
        color: white;
        border-right: 1px solid var(--brand-color);
        border-bottom: 1px solid var(--brand-color);
    }
    
    .time-slot {
        min-height: 50px;
        padding: 0.125rem;
        background-color: var(--bg-primary);
        border-right: 1px solid var(--brand-color);
        border-bottom: 1px solid var(--brand-color);
    }
    
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
        border: 2px solid var(--brand-color);
    }
    
    .flex.flex-wrap {
        flex-direction: column;
        gap: 1rem;
    }
    
    .month-day {
        min-height: 100px;
        padding: 0.25rem;
        background-color: var(--bg-primary);
        border: 1px solid var(--brand-color);
    }
    
    .shift-card {
        font-size: 0.625rem;
        padding: 0.25rem;
        margin-bottom: 0.125rem;
    }
    
    .month-grid {
        border: 1px solid var(--brand-color);
    }
    
    .month-header {
        background-color: var(--brand-color);
        color: white;
        border-bottom: 1px solid var(--brand-color);
    }
    
    /* Dark mode mobile overrides */
    [data-theme="dark"] .time-header,
    [data-theme="dark"] .day-header,
    [data-theme="dark"] .month-header {
        color: white;
    }
    
    [data-theme="dark"] .time-slot,
    [data-theme="dark"] .month-day {
        background-color: var(--bg-primary);
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

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

/* Notification System */
.notification {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #3b82f6;
    max-width: 24rem;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

.notification.info {
    border-left-color: #3b82f6;
}

.notification-content {
    display: flex;
    align-items: flex-start;
}

.notification-icon {
    flex-shrink: 0;
    margin-right: 0.75rem;
    margin-top: 0.125rem;
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.notification-message {
    color: #6b7280;
    font-size: 0.875rem;
}

.notification-close {
    flex-shrink: 0;
    margin-left: 0.75rem;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: #6b7280;
}

/* Day-focused weekly schedule */
.day-schedule {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.day-column {
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.day-column-header {
    background-color: #f8fafc;
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.day-column-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.day-column-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.day-column-content {
    padding: 0.5rem;
    min-height: 200px;
    transition: min-height 0.3s ease;
}

.day-column-content.has-shifts {
    min-height: auto;
}

.day-column-content:empty {
    min-height: 150px;
}

.day-shift {
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #3b82f6;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.day-shift.has-custom-color {
    background-color: rgba(var(--employee-color), 0.1);
    border-left-color: rgb(var(--employee-color));
}

/* Removed decorative dot on shift cards per request */

.day-shift:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
}

.day-shift.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.day-column-content.drag-over,
.month-day.drag-over {
    background-color: #dbeafe;
    border: 2px dashed #3b82f6;
}

.day-shift-employee {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.day-shift-time {
    font-size: 0.6875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.day-shift-position {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Statistics Charts */
.chart-container {
    position: relative;
    height: 16rem;
}

.chart-bar {
    background-color: var(--brand-color);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.chart-bar:hover {
    background-color: var(--brand-color);
    opacity: 0.8;
}

.chart-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    margin-top: 0.5rem;
}

.chart-value {
    font-size: 0.75rem;
    color: #374151;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.25rem;
}

/* Employee Performance Table Header Transparency */
table thead.bg-gray-50 {
    opacity: 1;
}

table thead.bg-gray-50:hover {
    opacity: 1;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .schedule-grid {
        break-inside: avoid;
    }
    
    .shift-card {
        break-inside: avoid;
    }
    
    .notification {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .day-schedule {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .day-column-content {
        min-height: 180px;
    }
    
    .day-column-content.has-shifts {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .day-schedule {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .day-column-content {
        min-height: 150px;
        padding: 0.25rem;
    }
    
    .day-column-content.has-shifts {
        min-height: auto;
    }
    
    .day-shift {
        padding: 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    .day-shift.has-custom-color::before {
        width: 10px;
        height: 10px;
        top: 0.25rem;
        right: 0.25rem;
    }
}

/* Profile Picture Styles */
.profile-pic {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.profile-pic-large {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
}

/* Department Management Styles */
.department-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.department-item:hover {
    background-color: #f3f4f6;
}

.department-name {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.department-actions {
    display: flex;
    gap: 0.5rem;
}

/* Action Button Styles */
.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 0.875rem;
}

.action-btn:hover {
    background-color: #f3f4f6;
}

.action-btn.edit {
    color: #3b82f6;
}

.action-btn.edit:hover {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.action-btn.delete {
    color: #ef4444;
}

.action-btn.delete:hover {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Dark mode action button styles */
[data-theme="dark"] .action-btn:hover {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .action-btn.edit:hover {
    background-color: #1e3a8a !important;
}

[data-theme="dark"] .action-btn.delete:hover {
    background-color: #7f1d1d !important;
}

/* Employee Card with Profile Picture */
.employee-card-with-pic {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: move;
    transition: all 0.2s ease;
    user-select: none;
}

.employee-card-with-pic:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px var(--shadow);
}

/* Custom styled employee cards - these should take precedence */
.employee-card-with-pic.custom-styled-employee-card {
    background-color: transparent !important;
    border-width: 1px !important;
    border-style: solid !important;
    color: #000 !important;
}

[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card {
    color: #fff !important;
}

/* Override all other styles for custom styled cards */
.employee-card-with-pic.custom-styled-employee-card,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card,
.employee-card-with-pic.custom-styled-employee-card.color-1,
.employee-card-with-pic.custom-styled-employee-card.color-2,
.employee-card-with-pic.custom-styled-employee-card.color-3,
.employee-card-with-pic.custom-styled-employee-card.color-4,
.employee-card-with-pic.custom-styled-employee-card.color-5,
.employee-card-with-pic.custom-styled-employee-card.color-6,
.employee-card-with-pic.custom-styled-employee-card.color-7,
.employee-card-with-pic.custom-styled-employee-card.color-8,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-1,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-2,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-3,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-4,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-5,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-6,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-7,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-8 {
    background-color: transparent !important;
    border-width: 1px !important;
    border-style: solid !important;
    color: #000 !important;
}

[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-1,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-2,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-3,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-4,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-5,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-6,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-7,
[data-theme="dark"] .employee-card-with-pic.custom-styled-employee-card.color-8 {
    color: #fff !important;
}

/* Ensure proper text color in both light and dark modes */
.employee-card-with-pic {
    color: #000;
}

[data-theme="dark"] .employee-card-with-pic {
    color: #fff;
}

/* Dark mode specific styles */
[data-theme="dark"] nav {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] header {
    background-color: var(--bg-primary) !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-primary) !important;
}

[data-theme="dark"] .bg-gray-50 {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .bg-gray-100 {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .text-gray-800 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-700 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-600 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-500 {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .border-gray-200 {
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .divide-gray-200 > * + * {
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .shadow {
    box-shadow: 0 1px 3px 0 var(--shadow), 0 1px 2px 0 var(--shadow) !important;
}

[data-theme="dark"] .shadow-sm {
    box-shadow: 0 1px 2px 0 var(--shadow) !important;
}

[data-theme="dark"] .day-column {
    background-color: var(--bg-primary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .day-column-header {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .day-shift {
    background-color: var(--bg-tertiary) !important;
}

/* Fix for employee card colors in dark mode */
[data-theme="dark"] .day-shift.has-custom-color {
    background-color: rgba(var(--employee-color), 0.15) !important;
}

/* Fix for employee list card colors in dark mode */
[data-theme="dark"] .employee-card-with-pic.color-1 {
    background-color: var(--color-1) !important;
    color: #1e40af !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .employee-card-with-pic.color-2 {
    background-color: var(--color-2) !important;
    color: #166534 !important;
    border-color: #22c55e !important;
}

[data-theme="dark"] .employee-card-with-pic.color-3 {
    background-color: var(--color-3) !important;
    color: #3730a3 !important;
    border-color: #6366f1 !important;
}

[data-theme="dark"] .employee-card-with-pic.color-4 {
    background-color: var(--color-4) !important;
    color: #92400e !important;
    border-color: #f59e0b !important;
}

[data-theme="dark"] .employee-card-with-pic.color-5 {
    background-color: var(--color-5) !important;
    color: #991b1b !important;
    border-color: #ef4444 !important;
}

[data-theme="dark"] .employee-card-with-pic.color-6 {
    background-color: var(--color-6) !important;
    color: #7c3aed !important;
    border-color: #8b5cf6 !important;
}

[data-theme="dark"] .employee-card-with-pic.color-7 {
    background-color: var(--color-7) !important;
    color: #047857 !important;
    border-color: #10b981 !important;
}

[data-theme="dark"] .employee-card-with-pic.color-8 {
    background-color: var(--color-8) !important;
    color: #be185d !important;
    border-color: #ec4899 !important;
}

[data-theme="dark"] .shift-card.color-1,
[data-theme="dark"] .day-shift.regular.color-1 {
    background-color: var(--color-1) !important;
    color: #1e40af !important;
}

[data-theme="dark"] .shift-card.color-2,
[data-theme="dark"] .day-shift.regular.color-2 {
    background-color: var(--color-2) !important;
    color: #166534 !important;
}

[data-theme="dark"] .shift-card.color-3,
[data-theme="dark"] .day-shift.regular.color-3 {
    background-color: var(--color-3) !important;
    color: #3730a3 !important;
}

[data-theme="dark"] .shift-card.color-4,
[data-theme="dark"] .day-shift.regular.color-4 {
    background-color: var(--color-4) !important;
    color: #92400e !important;
}

[data-theme="dark"] .shift-card.color-5,
[data-theme="dark"] .day-shift.regular.color-5 {
    background-color: var(--color-5) !important;
    color: #991b1b !important;
}

[data-theme="dark"] .shift-card.color-6,
[data-theme="dark"] .day-shift.regular.color-6 {
    background-color: var(--color-6) !important;
    color: #7c3aed !important;
}

[data-theme="dark"] .shift-card.color-7,
[data-theme="dark"] .day-shift.regular.color-7 {
    background-color: var(--color-7) !important;
    color: #047857 !important;
}

[data-theme="dark"] .shift-card.color-8,
[data-theme="dark"] .day-shift.regular.color-8 {
    background-color: var(--color-8) !important;
    color: #be185d !important;
}

[data-theme="dark"] .month-day {
    background-color: var(--bg-primary) !important;
    border-color: var(--border-primary) !important;
}

/* Dark mode pale cells (days from other months) */
[data-theme="dark"] .month-day.other-month {
    background-color: #374151 !important; /* requested pale color */
    opacity: 0.4 !important; /* lowered opacity for better visibility */
}

[data-theme="dark"] .month-header {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .notification {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .department-item {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .department-item:hover {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .action-btn:hover {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .action-btn.edit:hover {
    background-color: #1e3a8a !important;
}

[data-theme="dark"] .action-btn.delete:hover {
    background-color: #7f1d1d !important;
}

/* Additional dark mode refinements */
[data-theme="dark"] .schedule-grid {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] .time-slot {
    background-color: var(--bg-primary) !important;
    border-right: 1px solid var(--border-primary) !important;
    border-bottom: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .time-slot:hover {
    background-color: var(--bg-tertiary) !important;
    box-shadow: inset 0 0 0 1px var(--border-primary) !important;
}

[data-theme="dark"] .time-slot.drag-over {
    background-color: rgba(96, 165, 250, 0.18) !important; /* blue-400 @ ~18% */
    border: 2px dashed #60a5fa !important; /* blue-400 */
}

[data-theme="dark"] .day-header,
[data-theme="dark"] .time-header {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-right: 1px solid var(--border-primary) !important;
    border-bottom: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .month-day.today {
    background-color: #384965 !important; 
    border-color: #3b82f6 !important;
}

/* Week view today highlight in dark mode */
[data-theme="dark"] .day-column.today {
    background-color: #384965 !important; 
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .month-day.selected-week {
    background-color: #384965 !important; 
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .month-header {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .day-schedule {
    background-color: var(--bg-secondary) !important;
}

/* Dark mode toggle button */
[data-theme="dark"] button[onclick="toggleDarkMode()"] {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] button[onclick="toggleDarkMode()"]:hover {
    color: var(--text-primary) !important;
    background-color: var(--bg-tertiary) !important;
}

/* Comprehensive dark mode text visibility */
[data-theme="dark"] .text-gray-900 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-800 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray-700 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-600 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-500 {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .text-gray-400 {
    color: var(--text-tertiary) !important;
}

/* Dark mode table styles */
[data-theme="dark"] table {
    color: var(--text-primary) !important;
}

[data-theme="dark"] th {
    color: var(--text-secondary) !important;
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] td {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-gray-50 {
    background-color: var(--bg-tertiary) !important;
}

/* Dark mode button styles */
[data-theme="dark"] .bg-gray-100 {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-gray-200 {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .hover\\:bg-gray-200:hover {
    background-color: var(--border-primary) !important;
}

[data-theme="dark"] .hover\\:bg-gray-300:hover {
    background-color: var(--border-primary) !important;
}

/* Dark mode specific component styles */
[data-theme="dark"] .employee-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .employee-position {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .day-shift-employee {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .day-shift-time {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .day-shift-position {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .day-column-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .day-column-date {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .day-number {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .department-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-title {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .notification-message {
    color: var(--text-secondary) !important;
}

/* Dark mode status badges */
[data-theme="dark"] .bg-green-100 {
    background-color: #065f46 !important;
    color: #d1fae5 !important;
}

[data-theme="dark"] .bg-red-100 {
    background-color: #7f1d1d !important;
    color: #fecaca !important;
}

[data-theme="dark"] .text-green-800 {
    color: #d1fae5 !important;
}

[data-theme="dark"] .text-red-800 {
    color: #fecaca !important;
}

/* Dark mode chart styles */
[data-theme="dark"] .chart-label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .chart-value {
    color: var(--text-primary) !important;
}

/* Print styles for schedule */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .schedule-grid, .day-schedule {
        break-inside: avoid;
        background: white !important;
    }
    
    .day-column {
        background: white !important;
        border: 1px solid #000 !important;
    }
    
    .day-shift {
        background: #f3f4f6 !important;
        color: black !important;
        border-left: 4px solid #3b82f6 !important;
    }
    
    .day-shift-employee,
    .day-shift-time,
    .day-shift-position {
        color: black !important;
    }
    
    .day-column-title,
    .day-column-date {
        color: black !important;
    }
    
    .month-day {
        background: white !important;
        border: 1px solid #000 !important;
        color: black !important;
    }
    
    .shift-card {
        background: #f3f4f6 !important;
        color: black !important;
        border: 1px solid #000 !important;
    }
}

/* Holiday Management Modal */
#holidayModal .modal-content {
    height: 80vh;
    max-height: 90vh;
    overflow: hidden;
}

#holidayModal .modal-content > div.flex-1 {
    overflow-y: auto;
    max-height: calc(80vh - 150px);
}

/* Ensure the entire modal content is scrollable */
#holidayModal .modal-content .space-y-6 {
    height: calc(100% - 50px);
    overflow-y: auto;
    padding-right: 10px; /* Space for scrollbar */
}

/* Two-column layout for holidays and mandatory vacations */
#holidayModal .grid-cols-1.md\:grid-cols-2 {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    height: 100%;
}

#holidayModal .grid-cols-1.md\:grid-cols-2 > div {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#holidayModal #holidayList,
#holidayModal #mandatoryVacationList {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

/* Independent scrolling for each column */
#holidayModal .grid-cols-1.md\:grid-cols-2 > div:first-child #holidayList,
#holidayModal .grid-cols-1.md\:grid-cols-2 > div:last-child #mandatoryVacationList {
    max-height: 400px;
    overflow-y: auto;
}

/* Custom scrollbar for holiday lists */
#holidayModal #holidayList::-webkit-scrollbar,
#holidayModal #mandatoryVacationList::-webkit-scrollbar {
    width: 6px;
}

#holidayModal #holidayList::-webkit-scrollbar-track,
#holidayModal #mandatoryVacationList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#holidayModal #holidayList::-webkit-scrollbar-thumb,
#holidayModal #mandatoryVacationList::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#holidayModal #holidayList::-webkit-scrollbar-thumb:hover,
#holidayModal #mandatoryVacationList::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.employee-pic-container {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

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

.employee-name {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-position {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Month view text color adjustments for theme contrast */
/* Ensure employee names in month view are clearly readable: black in light mode, white in dark mode. */
.month-day .shift-card { 
    color: #000; 
    background-color: transparent !important;
    border-width: 1px !important;
    border-style: solid !important;
}

[data-theme="dark"] .month-day .shift-card { 
    color: #fff; 
}

/* Fix for employee card colors in month view in dark mode */
[data-theme="dark"] .month-day .shift-card.color-1 {
    background-color: transparent !important;
    color: #fff !important;
}

[data-theme="dark"] .month-day .shift-card.color-2 {
    background-color: transparent !important;
    color: #fff !important;
}

[data-theme="dark"] .month-day .shift-card.color-3 {
    background-color: transparent !important;
    color: #fff !important;
}

[data-theme="dark"] .month-day .shift-card.color-4 {
    background-color: transparent !important;
    color: #fff !important;
}

[data-theme="dark"] .month-day .shift-card.color-5 {
    background-color: transparent !important;
    color: #fff !important;
}

[data-theme="dark"] .month-day .shift-card.color-6 {
    background-color: transparent !important;
    color: #fff !important;
}

[data-theme="dark"] .month-day .shift-card.color-7 {
    background-color: transparent !important;
    color: #fff !important;
}

[data-theme="dark"] .month-day .shift-card.color-8 {
    background-color: transparent !important;
    color: #fff !important;
}

/* Visual indicator for selectable weeks in month view */
.selectable-week {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.selectable-week::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed #3b82f6;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.selectable-week:hover::before {
    opacity: 0.7;
}

/* Visual indicator for pasteable weeks in month view */
.pasteable-week {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.pasteable-week::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed #10b981;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.pasteable-week:hover::after {
    opacity: 0.7;
}

/* More obvious highlight for selected week */
.highlighted-week {
    background-color: #dbeafe !important;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 0 0 2px #3b82f6;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .highlighted-week {
    background-color: #384965 !important;
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* Statistics View Controls */
.stats-view-btn {
    background-color: var(--brand-color);
    color: white;
    transition: all 0.2s ease;
}

.stats-view-btn:hover {
    opacity: 0.9;
}

.stats-view-btn.active {
    background-color: var(--brand-color);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--brand-color);
}

/* Chart scrolling */
#statsChartsContainer {
    overflow-x: hidden;
}

#statsChartsContainer > div {
    scroll-snap-align: start;
}

/* Holiday list items */
#holidayList .flex.justify-between.items-center,
#mandatoryVacationList .flex.justify-between.items-center {
    min-height: 50px;
}

/* Scrollbar styling for holiday modal */
#holidayModal .modal-content::-webkit-scrollbar,
#holidayModal .modal-content .space-y-6::-webkit-scrollbar,
#holidayList::-webkit-scrollbar,
#mandatoryVacationList::-webkit-scrollbar {
    width: 8px;
}

#holidayModal .modal-content::-webkit-scrollbar-track,
#holidayModal .modal-content .space-y-6::-webkit-scrollbar-track,
#holidayList::-webkit-scrollbar-track,
#mandatoryVacationList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#holidayModal .modal-content::-webkit-scrollbar-thumb,
#holidayModal .modal-content .space-y-6::-webkit-scrollbar-thumb,
#holidayList::-webkit-scrollbar-thumb,
#mandatoryVacationList::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#holidayModal .modal-content::-webkit-scrollbar-thumb:hover,
#holidayModal .modal-content .space-y-6::-webkit-scrollbar-thumb:hover,
#holidayList::-webkit-scrollbar-thumb:hover,
#mandatoryVacationList::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Dark mode statistics controls */
[data-theme="dark"] .stats-view-btn {
    background-color: var(--brand-color);
    color: white;
}

[data-theme="dark"] .stats-view-btn:hover {
    opacity: 0.9;
}

[data-theme="dark"] .stats-view-btn.active {
    background-color: var(--brand-color);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--brand-color);
}

/* Statistics table header */
#statisticsPage thead th {
    background-color: var(--brand-color) !important;
    color: white !important;
    border-bottom: 2px solid var(--brand-color) !important;
}

/* Dark mode statistics table header */
[data-theme="dark"] #statisticsPage thead th {
    color: white !important;
}

/* Month view holiday styles */
.month-day .day-header-container {
    display: flex;
    align-items: center;
    margin-bottom: 1px;
    gap: 1px; /* Reduce gap between day number and holiday name for closer positioning */
}

.month-day .holiday-name {
    font-size: 0.75rem;
    font-weight: bold;
    color: #dc2626;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
    line-height: 1.2; /* Ensure consistent line height with day number */
}

[data-theme="dark"] .month-day .holiday-name {
    color: #ff0000;
    line-height: 1.2; /* Ensure consistent line height with day number */
}

/* Ensure day numbers are properly styled */
.month-day .day-number {
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1.2; /* Ensure consistent line height with holiday name */
}

.month-day .day-number.holiday-highlight {
    color: #dc2626;
}

[data-theme="dark"] .month-day .day-number.holiday-highlight {
    color: #fecaca;
}

/* Holiday highlight styles */
.holiday-highlight {
    background-color: #fee2e2 !important;
    border-bottom: 2px solid #ef4444 !important;
}

.holiday-highlight .day-column-title {
    color: #dc2626 !important;
    font-weight: bold !important;
}

.holiday-highlight .day-column-date {
    color: #dc2626 !important;
}

.holiday-name {
    color: #dc2626 !important;
    font-weight: bold !important;
    font-size: 0.75rem !important;
    margin-top: 0 !important; /* Ensure proper vertical alignment with day number */
}

/* Dark mode holiday highlight styles */
[data-theme="dark"] .holiday-highlight {
    background-color: #7f1d1d !important;
    border-bottom: 2px solid #ef4444 !important;
}

[data-theme="dark"] .holiday-highlight .day-column-title {
    color: #fecaca !important;
}

[data-theme="dark"] .holiday-highlight .day-column-date {
    color: #fecaca !important;
}

[data-theme="dark"] .holiday-name {
    color: #fecaca !important;
    margin-top: 0 !important; /* Ensure proper vertical alignment with day number */
}

/* Mobile Notification Modal */
#mobileNotificationModal .modal-content {
    border: 2px solid var(--brand-color);
}

#mobileNotificationModal .flex.items-center {
    border-bottom: 1px solid var(--brand-color);
    padding-bottom: 1rem;
}

/* Dark mode mobile notification modal */
[data-theme="dark"] #mobileNotificationModal .modal-content {
    background-color: var(--bg-primary);
    border-color: var(--brand-color);
}

[data-theme="dark"] #mobileNotificationModal .flex.items-center {
    border-color: var(--brand-color);
}

[data-theme="dark"] #mobileNotificationModal .text-gray-900 {
    color: var(--text-primary);
}

[data-theme="dark"] #mobileNotificationModal .text-gray-600 {
    color: var(--text-secondary);
}

/* Welcome Notification Modal */
#welcomeModal .modal-content {
    border: 2px solid var(--brand-color);
}

#welcomeModal .flex.items-center {
    border-bottom: 1px solid var(--brand-color);
    padding-bottom: 1rem;
}

#welcomeModal .bg-blue-50 {
    background-color: #dbeafe;
}

#welcomeModal .text-blue-800 {
    color: #1e40af;
}

#welcomeModal .text-blue-700 {
    color: #1d4ed8;
}

/* Dark mode welcome notification modal */
[data-theme="dark"] #welcomeModal .modal-content {
    background-color: var(--bg-primary);
    border-color: var(--brand-color);
}

[data-theme="dark"] #welcomeModal .flex.items-center {
    border-color: var(--brand-color);
}

[data-theme="dark"] #welcomeModal .text-gray-900 {
    color: var(--text-primary);
}

[data-theme="dark"] #welcomeModal .text-gray-600 {
    color: var(--text-secondary);
}

[data-theme="dark"] #welcomeModal .bg-blue-50 {
    background-color: #1e3a8a;
}

[data-theme="dark"] #welcomeModal .text-blue-800 {
    color: #93c5fd;
}

[data-theme="dark"] #welcomeModal .text-blue-700 {
    color: #bfdbfe;
}
