:root {
    --primary-color: #2563eb;
    /* Stronger Blue instead of Indigo */
    --primary-hover: #1d4ed8;
    --secondary-color: #facc15;
    /* Gold for highlights/tabs/headings */
    --accent-color: #ffffff;
    /* White for accents */
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    /* Darker Slate/Black Background */
    --glass-bg: rgba(30, 41, 59, 0.7);
    /* Darker glass for better text contrast */
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    /* Pure White */
    --text-muted: #e2e8f0;
    /* Light Gray (Slate-200) */
    --card-bg: rgba(15, 23, 42, 0.8);
    --input-bg: rgba(0, 0, 0, 0.3);
    --success-color: #34d399;
    /* Brighter Green */
    --danger-color: #f87171;
    /* Brighter Red */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Login Page Specifics */
.login-container {
    max-width: 400px;
    width: 90%;
}

h1,
h2,
h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    box-shadow: none;
    width: auto;
}

.tab-btn:hover {
    color: var(--text-color);
    background: transparent;
    transform: none;
    box-shadow: none;
}

.tab-btn.active {
    color: var(--secondary-color);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

th {
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Dashboard Layout */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ffffff;
    width: auto;
    padding: 0.5rem 1.5rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* Reports Summary Card */
.reports-summary-card {
    display: flex;
    gap: 2rem;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.05);
    align-items: center;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    display: none;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: #d1fae5;
    border: 1px solid #059669;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: #fee2e2;
    border: 1px solid #b91c1c;
}

/* Modal */
.modal-icon {
    font-size: 3rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.modal-icon.error {
    color: var(--danger-color);
}

.modal-accept-btn {
    width: auto;
    min-width: 120px;
    padding: 0.75rem 2rem;
    margin-top: 1rem;
    display: inline-block;
}

/* Checkbox Style */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input {
    width: auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        /* Prevent top cutoff on long content */
        padding-top: 2rem;
        height: auto;
        /* Allow full scrolling */
        min-height: 100vh;
        /* Ensure bg covers all */
    }

    .container {
        padding: 0 1rem 1rem 1rem;
    }

    .glass-card {
        padding: 1.25rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .logout-btn {
        width: 100%;
        padding: 0.75rem;
    }

    /* Scrollable Tabs on Mobile - NOW WRAPPED */
    .tabs {
        display: flex;
        flex-wrap: wrap;
        /* Allow wrapping */
        justify-content: center;
        /* Center the buttons */
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        border-bottom: none;
        /* Optional: remove border if it looks bad wrapped */
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        /* Slightly smaller font */
        flex: 1 1 auto;
        /* Allow buttons to grow/shrink but respect content */
        text-align: center;
        border: 1px solid var(--glass-border);
        /* Add border for better visibility */
        border-radius: 0.5rem;
        /* Rounded corners */
        background: rgba(255, 255, 255, 0.05);
        /* Slight background */
        margin-bottom: 0.5rem;
        /* Space between rows */
    }

    .tab-btn.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .tab-btn.active::after {
        display: none;
        /* Remove the bottom line indicator on mobile */
    }

    /* Fix iOS Input Zoom & Style */
    input,
    select,
    button {
        font-size: 16px !important;
        /* Prevents auto-zoom on iOS */
        -webkit-appearance: none;
        appearance: none;
        /* Remove native styling */
        border-radius: 0.5rem;
    }

    /* Stack form groups slightly more compact */
    .form-group {
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    /* Adjust table font size */
    th,
    td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
        /* Prevent wrapping in cells, force scroll */
    }

    .table-container {
        -webkit-overflow-scrolling: touch;
    }

    /* Stack Reports Summary on Mobile */
    .reports-summary-card {
        flex-direction: column;
        gap: 1.5rem;
    }
}