:root {
    /* Color Palette - Premium Modern */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --secondary: #10B981;
    --bg-main: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --danger: #EF4444;
    --danger-light: #FEE2E2;

    /* Shadows */
    --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);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --gradient-surface: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Prompt', 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0.03) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.03) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.03) 0, transparent 50%);
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 180px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1rem 0.75rem;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.logo h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

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

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-btn.active i {
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-info .user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-info .user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    position: relative;
}

.view-section {
    animation: fadeIn var(--transition-normal);
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.view-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-family: 'Prompt', sans-serif;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

/* Glass Panel */
.glass-panel {
    background: var(--gradient-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
}

/* Forms */
.form-container {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

.input-with-icon input {
    padding-left: 2.75rem;
}

input[type="date"],
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-family: 'Prompt', sans-serif;
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.8);
}

input[type="date"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: white;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    width: 100%;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(79, 70, 229, 0.25);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 800px; /* Keeps the calendar narrow without needing 2 columns */
}

.panel-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    color: var(--text-main);
}

/* Calendar View */
.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)); /* Mon-Sun */
    gap: 0.25rem;
}

.day-col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.day-header {
    text-align: center;
    padding: 0.2rem;
    background: var(--primary-light);
    border-radius: 0.35rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--primary);
}

.day-header .date {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0;
    font-weight: 400;
}

.leave-card {
    background: white;
    padding: 0.35rem;
    border-radius: 0.35rem;
    border-left: 3px solid var(--danger);
    box-shadow: var(--shadow-sm);
    font-size: 0.75rem;
    animation: slideIn var(--transition-normal);
    transition: transform var(--transition-fast);
    cursor: default;
}

.leave-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.leave-card .name {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.2rem;
}

.reason-indicator {
    color: var(--danger);
    font-weight: bold;
}

.leave-card .reason {
    color: var(--text-muted);
    font-size: 0.65rem;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Leave List Sidebar */
.leave-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.list-item .avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
}

.list-item-content .name {
    font-weight: 600;
    font-size: 0.9rem;
}

.list-item-content .dates {
    font-size: 0.8rem;
    color: var(--danger);
    background: var(--danger-light);
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border-left: 4px solid var(--secondary);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp var(--transition-normal);
}

.toast i {
    color: var(--secondary);
}

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

/* Mobile Header */
.mobile-header {
    display: none;
}

/* Responsive Utilities */
.mobile-only { display: none; }

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #app {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 1rem 1.5rem;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        z-index: 10;
        box-shadow: var(--shadow-sm);
    }
    
    .mobile-header .logo {
        margin-bottom: 0;
    }
    
    .mobile-header .logo h2 {
        display: none; /* Hide text on mobile to make space for selector */
    }
    
    .header-actions {
        position: fixed;
        top: 0.8rem;
        right: 1.5rem;
        z-index: 100;
        transform: scale(0.9);
        transform-origin: right top;
    }

    /* Change sidebar to bottom navigation */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0.5rem;
        border-right: none;
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        z-index: 100;
        border-radius: 1.5rem 1.5rem 0 0;
    }

    .sidebar .logo, .sidebar .user-profile {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }

    .nav-links li {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .nav-btn {
        flex-direction: column;
        gap: 0.35rem;
        padding: 0.5rem;
        font-size: 0.75rem;
        border-radius: 1rem;
        width: auto;
        font-weight: 600;
    }
    
    .nav-btn i {
        margin: 0;
        width: 20px;
        height: 20px;
    }

    .nav-btn:hover {
        transform: none;
    }

    .main-content {
        padding: 0.5rem 0.5rem 6rem 0.5rem; /* Extra bottom padding for nav */
    }

    .view-header {
        margin-bottom: 0;
        height: 0;
    }

    .dashboard-grid {
        gap: 1rem;
    }
    
    .glass-panel {
        padding: 0.5rem;
    }

    /* Make calendar horizontally scrollable on mobile */
    .schedule-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-only { display: inline; }
    .desktop-only { display: none; }
    
    .calendar-week {
        min-width: 350px; /* Reduced further to avoid needing to scroll horizontally as much, using abbreviations */
    }
    
    .toast-container {
        bottom: 90px; /* Above bottom nav */
        left: 1rem;
        right: 1rem;
    }
    
    .toast {
        justify-content: center;
    }
}
/* Monthly Calendar View */
.monthly-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--border);
    overflow: hidden;
}

.month-day-header {
    background: var(--surface);
    text-align: center;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-main);
}

.month-cell {
    background: var(--surface);
    min-height: 80px;
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.month-cell.empty {
    background: rgba(255, 255, 255, 0.4);
}

.month-cell .date-number {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 0.25rem;
}

.month-cell.today .date-number {
    color: var(--primary);
    font-weight: 700;
}

.month-leave-bar {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.65rem;
    padding: 0.15rem 0.25rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}
.month-leave-bar img {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
/* Employee Summary View */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.75rem;
}

.summary-card-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.summary-card-header .name-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.summary-card-header .total-leaves {
    font-size: 0.8rem;
    color: var(--danger);
    font-weight: 600;
    background: var(--danger-light);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    display: inline-block;
    margin-top: 0.25rem;
}

.summary-leave-item {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bg-main);
}
.summary-leave-item:last-child {
    border-bottom: none;
}

/* Monthly Calendar View */
.monthly-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--border);
    overflow: hidden;
}

.month-day-header {
    background: var(--surface);
    text-align: center;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-main);
}

.month-cell {
    background: var(--surface);
    min-height: 80px;
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.month-cell.empty {
    background: rgba(255, 255, 255, 0.4);
}

.month-cell .date-number {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 0.25rem;
}

.month-cell.today .date-number {
    color: var(--primary);
    font-weight: 700;
}

.month-leave-bar {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.65rem;
    padding: 0.15rem 0.25rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}
.month-leave-bar img {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
/* Employee Summary View */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.75rem;
}

.summary-card-header img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.summary-card-header .name-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.summary-card-header .total-leaves {
    font-size: 0.8rem;
    color: var(--danger);
    font-weight: 600;
    background: var(--danger-light);
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    display: inline-block;
    margin-top: 0.25rem;
}

.summary-leave-item {
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bg-main);
}
.summary-leave-item:last-child {
    border-bottom: none;
}

.summary-leave-item .dates {
    font-weight: 500;
    color: var(--text-main);
}

.summary-leave-item .reason {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: right;
    max-width: 50%;
}

/* Schedule Grid Setup */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.sched-row {
    display: grid;
    grid-template-columns: 80px repeat(7, minmax(100px, 1fr));
    gap: 1px;
}

.sched-header {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sched-cell {
    background: var(--surface);
    padding: 0.25rem;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sched-cell:hover {
    background: var(--primary-light);
}

.sched-shift-title {
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
}

.sched-station {
    background: var(--surface);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-right: 1px solid var(--border);
}

.sched-emp-badge {
    background: var(--secondary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.3rem;
    border-radius: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sched-emp-badge.ft-badge {
    background: var(--primary);
}
.sched-emp-badge .remove-btn {
    cursor: pointer;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--bg-main); color: var(--text-main); border: 1px solid var(--border); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 400px;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-body {
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

.close-modal-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.icon-btn {
    background: white; border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-sm);
}

.leave-warning-container, .workload-warning-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.warning-badge {
    background: var(--danger-light);
    color: var(--danger);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--danger);
    font-weight: 500;
}

.employee-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.emp-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}
.emp-list-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
