/* assets/css/style.css */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: #fff;
}

input, textarea {
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

select {
    transition: border-color 0.2s, box-shadow 0.2s;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    background-color: #1e293b;
}

select option {
    background-color: #1e293b;
    color: #fff;
}

/* Specific fix for browser-forced white backgrounds in dropdowns */
select:-webkit-autofill,
select:focus {
    background-color: #1e293b !important;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: var(--primary-hover);
}

.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dashboard Layout */
.layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

aside {
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid var(--glass-border);
    padding: 2rem;
}

main {
    padding: 2.5rem;
    max-width: 1600px;
    width: 100%;
}

nav ul {
    list-style: none;
    margin-top: 2rem;
}

nav li {
    margin-bottom: 0.5rem;
}

nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

nav a:hover, nav a.active {
    color: white;
    background: var(--glass-bg);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: fadeIn 0.4s ease-out;
}

/* Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    overflow: hidden;
}

.calendar-day-header {
    background: var(--bg-dark);
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive table {
    min-width: 800px; /* Ensure table doesn't squish too much */
}

/* Base Table Styles */
table th, table td {
    padding: 1rem;
}

.text-nowrap {
    white-space: nowrap;
}

.text-wrap {
    white-space: normal !important;
}

table td {
    vertical-align: middle;
}

.calendar-day {
    background: var(--bg-dark);
    min-height: 120px;
    padding: 0.3rem;
    position: relative;
}

.calendar-day.today {
    background: rgba(79, 70, 229, 0.05);
}

.calendar-date {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.leave-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    display: none; /* Controlled by JS: use 'flex' to show */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}

.modal-overlay .glass-card {
    margin: auto;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* Required Field Indicator */
.required-label::after {
    content: " *";
    color: var(--error) !important;
    font-weight: bold;
    display: inline-block;
    margin-left: 0.25rem;
}

/* Mobile Responsiveness */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    width: auto;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }

    aside {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        background: var(--bg-dark);
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid var(--glass-border);
    }

    aside.sidebar-open {
        transform: translateX(0);
    }

    main {
        padding: 1.5rem;
    }

    .hamburger-btn {
        display: block;
    }

    .header-content {
        display: flex;
        align-items: center;
    }
}

/* Reusable layout classes */
.responsive-grid-2col {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

@media (max-width: 900px) {
    .responsive-grid-2col {
        grid-template-columns: 1fr;
    }
}
