:root {
    /* Light Mode (Default) */
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --primary-color: #3b82f6;

    /* Shift Colors (Base - Light Mode) */
    /* Morning: Red-ish */
    --shift-morning-bg: #fee2e2;
    --shift-morning-text: #991b1b;

    /* Evening: Gold/Yellow-ish */
    --shift-evening-bg: #fef08a;
    --shift-evening-text: #854d0e;

    /* Night: Green-ish */
    --shift-night-bg: #dcfce7;
    --shift-night-text: #166534;

    --shift-off-bg: #f1f5f9;
    --shift-off-text: #94a3b8;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --card-bg: #1e293b;
    --border-color: #334155;
    --primary-color: #60a5fa;

    /* Shift Colors (Dark Mode - Vibrant) */
    /* Deep Red */
    --shift-morning-bg: #7f1d1d;
    --shift-morning-text: #fecaca;

    /* Deep Gold/Brown */
    --shift-evening-bg: #713f12;
    --shift-evening-text: #fef08a;

    /* Deep Green */
    --shift-night-bg: #14532d;
    --shift-night-text: #dcfce7;

    --shift-off-bg: #0f172a;
    --shift-off-text: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border: 1px solid var(--border-color);
}

.main-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

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

.controls h2 {
    margin: 0;
    font-size: 1.25rem;
    min-width: 180px;
    text-align: center;
}

.btn {
    text-decoration: none;
    color: var(--text-color);
    background: var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.btn:hover {
    background: #cbd5e1;
}

body.dark-mode .btn:hover {
    background: #475569;
}

.alert {
    padding: 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

/* Table */
.roster-wrapper {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

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

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

.roster-table th {
    background: var(--bg-color);
    vertical-align: top;
    color: var(--text-color);
}

.col-date {
    width: 100px;
}

.cell-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.day-num {
    font-size: 1.25rem;
    font-weight: bold;
}

.day-name {
    font-size: 0.875rem;
    color: #64748b;
}

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

/* Group Headers */
.group-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.group-members {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.member {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Shift Badges */
.shift-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    justify-content: center;
    width: 100%;
    max-width: 140px;
}

.shift-code {
    font-weight: bold;
    display: none;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--border-color);
}

/* Updated Shift Colors */
.shift-morning {
    background-color: var(--shift-morning-bg);
    color: var(--shift-morning-text);
    border: 1px solid currentColor;
}

.shift-evening {
    background-color: var(--shift-evening-bg);
    color: var(--shift-evening-text);
    border: 1px solid currentColor;
}

.shift-night {
    background-color: var(--shift-night-bg);
    color: var(--shift-night-text);
    border: 1px solid currentColor;
}

.shift-off {
    background-color: var(--shift-off-bg);
    color: var(--shift-off-text);
    border: 1px solid var(--border-color);
}

/* Eye Catching Leave Colors (Vibrant Gradients) */
.shift-leave-al {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    /* Violet */
    color: white;
    font-weight: bold;
    border: none;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.shift-leave-sl {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    /* Red */
    color: white;
    font-weight: bold;
    border: none;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.shift-leave-pl {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    /* Blue */
    color: white;
    font-weight: bold;
    border: none;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.shift-leave-el {
    background: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
    /* Orange */
    color: white;
    font-weight: bold;
    border: none;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3);
}

/* Compact Table for Redesign */
.compact-table th,
.compact-table td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.compact-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background: var(--card-bg);
    box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.compact-table td.sticky-col.emp-role {
    left: 150px;
    font-size: 0.85rem;
    color: #64748b;
    border-right: 2px solid var(--border-color);
}

/* Role Highlights */
.role-team-lead {
    color: #0369a1 !important;
    /* Sky 700 */
    font-weight: 700;
}

.role-technician {
    color: #475569 !important;
    /* Slate 600 */
}

.role-application-support {
    color: #7c3aed !important;
    /* Violet 600 */
    font-weight: 600;
}

.role-backup-tl {
    color: #0d9488 !important;
    /* Teal 600 */
    font-weight: 600;
}

.role-backup-as {
    color: #db2777 !important;
    /* Pink 600 */
    font-weight: 600;
}


.compact-table td.sticky-col.emp-name {
    width: 150px;
    font-weight: 500;
}

.cell-day {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 30px;
}

.group-separator td {
    background: var(--bg-color);
    font-weight: bold;
    color: var(--text-color);
    text-align: left;
    padding: 0.5rem 1rem;
}

.header-weekend {
    background: #fecaca;
    /* Keep fixed or use var if desired */
    /* Let's make it conditional or subtle in dark mode? For now keep as alert-ish */
    color: #7f1d1d;
}

body.dark-mode .header-weekend {
    background: #450a0a;
    color: #fca5a5;
}

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