:root {
    --primary: #818cf8;
    /* Softer Indigo */
    --primary-hover: #6366f1;
    --accent: #f472b6;
    /* Subtle Pink accent */
    --bg-dark: #020617;
    /* Deeper Navy */
    --surface: rgba(30, 41, 59, 0.4);
    /* Slate Surface */
    --border: rgba(255, 255, 255, 0.08);
    /* Finer borders */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-blur: blur(20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background:
        radial-gradient(circle at 0% 0%, hsla(253, 16%, 10%, 1) 0, transparent 40%),
        radial-gradient(circle at 100% 100%, hsla(225, 39%, 15%, 1) 0, transparent 40%),
        #020617;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.6;
    letter-spacing: -0.011em;
}

/* Update text colors for dark mesh background */
.glass {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    border-radius: 20px;
}

.card-header h2 {
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

label {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.modern-table th {
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.modern-table td {
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.glass-nav {
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
    border: 1px solid var(--border);
}

.tab {
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.tab.active {
    background: var(--surface);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tab:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
}

.nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
}

.nav-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.nav-btn,
.submit-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: #fff;
}

.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Card & Form */
.card {
    padding: 40px;
    margin-bottom: 30px;
    animation: slideUp 0.6s ease-out;
}

.card-header {
    margin-bottom: 30px;
}

.card-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.card-header p {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="date"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 1rem;
    color: white;
    outline: none;
    transition: all 0.2s ease;
}

input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.15);
}

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

.badge {
    position: absolute;
    right: 12px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Custom File Drop Zone */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.03);
    position: relative;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.drop-zone-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.drop-icon {
    font-size: 2rem;
}

.preview-container {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

#image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}

/* Dashboard Stats */
.dashboard-header {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    padding: 10px;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.modern-table th {
    padding: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid #e2e8f0;
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.proof-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
}

/* Utilities */
.hidden {
    display: none !important;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .container {
        padding: 80px 15px 100px;
        /* Space for bottom nav */
    }

    .logo .text {
        display: none;
        /* Hide 'RepairUpdate' text to save space */
    }

    .nav-actions {
        gap: 8px;
        flex: 1;
        justify-content: flex-end;
    }

    .user-name {
        display: inline-flex;
        font-size: 0.75rem;
        margin-right: 5px;
        color: var(--primary);
    }

    .nav-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .card {
        padding: 24px 16px;
        border-radius: 16px;
        margin-bottom: 20px;
    }

    .card-header h2 {
        font-size: 1.4rem;
    }

    /* Form spacing on mobile */
    .form-group {
        margin-bottom: 20px;
    }

    input[type="date"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="text"] {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    /* Mobile Table: Card View */
    .modern-table,
    .modern-table thead,
    .modern-table tbody,
    .modern-table th,
    .modern-table td,
    .modern-table tr {
        display: block;
    }

    .modern-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .modern-table tr {
        margin-bottom: 16px;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 12px;
    }

    .modern-table td {
        border: none;
        position: relative;
        padding: 10px 0 10px 45%;
        text-align: right;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }

    .modern-table td:last-child {
        border-bottom: none;
        padding-top: 15px;
    }

    .modern-table td:before {
        position: absolute;
        left: 0;
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        color: var(--text-muted);
        content: attr(data-label);
    }

    .proof-thumb {
        width: 70px;
        height: 70px;
        border-radius: 12px;
    }

    /* Stats Grid on Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card .value {
        font-size: 1.4rem;
    }

    /* Form Actions */
    .form-actions {
        margin-top: 30px;
    }

    .form-actions button {
        width: 100%;
        padding: 14px;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    transition: opacity 0.3s;
}

.toast-success {
    background: var(--success);
}

.toast-danger {
    background: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    margin-top: 50px;
    border-radius: 12px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Action Button */
.approve-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.approve-btn:hover {
    background: var(--primary-hover);
}

.empty-state {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

/* Auth Specific Styles */
.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.user-name {
    margin-right: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
}

.user-name:hover {
    opacity: 0.8;
}

.danger-outline {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
}

.done {
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 600;
}