:root {
    /* Color Palette - Clean Premium Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* Shift Colors */
    --shift-day-bg: #fffbeb;
    --shift-day-text: #d97706;
    --shift-day-border: #fde68a;
    
    --shift-night-bg: #eff6ff;
    --shift-night-text: #2563eb;
    --shift-night-border: #bfdbfe;
    
    --shift-off-bg: #f8fafc;
    --shift-off-text: #94a3b8;
    --shift-off-border: #e2e8f0;
    
    /* Team Header Colors */
    --team-a-bg: #dcfce7;
    --team-a-text: #166534;
    --team-b-bg: #ffedd5;
    --team-b-text: #9a3412;
    --team-c-bg: #f3e8ff;
    --team-c-text: #6b21a8;

    /* Primary Accent */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    
    /* Shadows & Transitions */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.sidebar-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.import-section {
    margin-top: 16px;
}

.btn-import {
    width: 100%;
    background-color: #10b981; /* Emerald green for Excel */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-import:hover {
    background-color: #059669;
    box-shadow: var(--shadow-md);
}

.import-status {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.import-status.success {
    color: #10b981;
}

.import-status.error {
    color: #ef4444;
}

.sidebar-nav {
    display: flex;
    padding: 16px 24px;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.nav-btn {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-btn:hover {
    background: #f1f5f9;
}

.nav-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.process-selector {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.process-selector label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.custom-select-wrapper {
    position: relative;
}

.custom-select-wrapper select {
    width: 100%;
    appearance: none;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.custom-select-wrapper select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.process-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 16px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--border-color);
}

.custom-select-wrapper .select-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.bottom-panel {
    flex: 1;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    padding: 24px 32px;
    overflow-y: auto; /* Allow scrolling teams list independently */
}

.teams-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

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

.team-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.team-off-state {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}
.team-off-state:hover {
    background-color: #f1f5f9;
}
.team-off-state .team-card-header {
    filter: grayscale(100%);
    opacity: 0.6;
}
.team-off-state .team-members li:not(.member-on-overtime) {
    filter: grayscale(100%);
    opacity: 0.4;
}

.member-on-overtime {
    background-color: #f0f9ff !important;
}
.member-on-overtime .member-name {
    color: #2563eb;
    font-weight: 700;
}
.member-on-overtime .member-id {
    color: #1e40af;
    background-color: #dbeafe;
}

.team-card-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-card[data-team="A"] .team-card-header {
    background-color: var(--team-a-bg);
    color: var(--team-a-text);
}

.team-card[data-team="B"] .team-card-header {
    background-color: var(--team-b-bg);
    color: var(--team-b-text);
}

.team-card[data-team="C"] .team-card-header {
    background-color: var(--team-c-bg);
    color: var(--team-c-text);
}

.team-members {
    list-style: none;
    padding: 0;
    margin: 0;
}

.team-members li {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    transition: var(--transition);
}

.team-members li:last-child {
    border-bottom: none;
}

.team-members li:hover {
    background-color: var(--bg-primary);
}

.member-id {
    font-family: 'Courier New', Courier, monospace;
    background: #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-right: 12px;
    min-width: 75px;
    text-align: center;
}

.member-name {
    font-weight: 500;
}

.member-pos {
    margin-left: auto;
    font-size: 0.8rem;
    color: #10b981; /* Green to highlight leader/position */
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    overflow: hidden; /* Prevent full page scroll, let bottom-panel scroll */
}

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

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title h1 i {
    color: var(--accent);
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.month-year-display {
    display: flex;
    gap: 8px;
}

.month-year-display select {
    appearance: none;
    background-color: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.month-year-display select:hover {
    background-color: #e2e8f0;
}

.month-year-display select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--bg-secondary);
}

.icon-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.btn-primary {
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

/* Calendar Area */
.calendar-wrapper {
    padding: 20px 32px; /* Reduced padding */
    overflow-x: auto;
}

.calendar-scroll-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Dashboard Area */
.dashboard-wrapper {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    background-color: var(--bg-secondary);
}

.dash-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.dash-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
}

.dash-card i {
    font-size: 2.5rem;
    opacity: 0.8;
}

.dash-card-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.dash-card-info p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.dash-table-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.dash-table-container h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.dash-table th, .dash-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
}

.dash-table th {
    background-color: #f8fafc;
    font-weight: 600;
}

.dash-table tbody tr:hover {
    background-color: #f1f5f9;
}


.calendar-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.calendar-table th, 
.calendar-table td {
    border: 1px solid var(--border-color);
    padding: 6px 4px; /* Reduced padding for smaller calendar */
    min-width: 40px;
    font-size: 0.9rem;
}

/* Table Header styling */
#calendarHeaderDays th {
    background-color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 16px;
}

#calendarHeaderDates th {
    background-color: var(--bg-primary);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    padding-bottom: 16px;
}

/* Weekend Styling */
.is-weekend {
    color: #ef4444 !important; /* Red text for weekends */
}
th.is-weekend-bg {
    background-color: #fee2e2 !important;
}

/* Team Column Header */
.team-col-header {
    background-color: var(--bg-primary) !important;
    text-align: center;
    vertical-align: middle;
    width: 120px;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 2px solid var(--border-color) !important;
}

.team-label {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.team-label-A { background: var(--team-a-bg); color: var(--team-a-text); }
.team-label-B { background: var(--team-b-bg); color: var(--team-b-text); }
.team-label-C { background: var(--team-c-bg); color: var(--team-c-text); }


/* Shift Cells */
.shift-cell {
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.shift-cell:hover {
    filter: brightness(0.95);
    cursor: default;
}

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

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

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

/* Current Day Highlight */
.is-today {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border: 3px solid #2563eb !important;
    box-shadow: none;
    font-weight: 800 !important;
    position: relative;
    z-index: 5;
}

.is-today-col {
    position: relative;
}

.is-today-col::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    right: -2px;
    bottom: -1px;
    border-left: 3px solid #2563eb;
    border-right: 3px solid #2563eb;
    pointer-events: none;
    z-index: 5;
}

.calendar-table tr:last-child td.is-today-col::after {
    border-bottom: 3px solid #2563eb;
}

/* Sticky First Column */
.calendar-table tbody td:first-child {
    position: sticky;
    left: 0;
    background-color: var(--bg-secondary);
    z-index: 1;
    border-right: 2px solid var(--border-color);
}

/* Interactive Calendar Headers */
.calendar-table th.date-cell {
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.calendar-table th.date-cell:hover {
    background-color: var(--bg-tertiary);
}

.calendar-table th.is-selected-date {
    background-color: #3b82f6 !important;
    color: white !important;
    font-weight: bold;
    border-color: #2563eb !important;
}

/* Leave Registration Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 24px;
}

.operator-info {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-color);
}

.add-leave-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.form-control {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
}

.form-control:focus {
    border-color: #3b82f6;
}

.leave-dates-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    max-height: 200px;
    overflow-y: auto;
}

.leave-dates-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.btn-remove-leave {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.btn-remove-leave:hover {
    background-color: #fee2e2;
}

/* Leave Indicators in Team List */
.btn-register-leave {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: auto;
    transition: all 0.2s;
    opacity: 0.5;
}

.team-members li:hover .btn-register-leave {
    opacity: 1;
}

.btn-register-leave:hover {
    background-color: var(--bg-tertiary);
    color: #3b82f6;
}

.member-on-leave {
    opacity: 0.5;
}

.member-on-leave .member-name {
    text-decoration: line-through;
}

.member-on-unexcused-leave {
    opacity: 0.6;
}

.member-on-unexcused-leave .member-name {
    text-decoration: line-through;
    color: #ef4444;
}

.leave-badge {
    background-color: #fee2e2;
    color: #ef4444;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

.leave-badge.unexcused {
    background-color: #fef3c7;
    color: #d97706;
}

.ot-badge {
    background-color: #d1fae5;
    color: #10b981;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

.btn-register-overtime {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 4px;
    transition: all 0.2s;
    opacity: 0.5;
}

.team-members li:hover .btn-register-overtime {
    opacity: 1;
}

.btn-register-overtime:hover {
    background-color: var(--bg-tertiary);
    color: #10b981;
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
    }
    
    .teams-container {
        flex-direction: row;
        overflow-x: auto;
        padding: 16px;
    }
    
    .team-card {
        min-width: 250px;
    }
}
\n.newcomer-tag { color: #3b82f6; font-size: 0.85em; font-weight: 500; font-style: italic; }\n