:root {
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    /* Pink 500 */
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --sidebar-bg: #1e293b;
    --sidebar-text: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: fixed;
    height: 100%;
    z-index: 100;
}

.brand {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    margin-top: 2rem;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--sidebar-text);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: block;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: white;
    border-left: 3px solid var(--primary-color);
    padding-left: 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    /* Width of sidebar */
    padding: 2rem;
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 0.05) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 0.05) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.05) 0, transparent 50%);
    background-size: cover;
    background-attachment: fixed;
    background-color: #f8fafc;
}

/* Glassmorphism Card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Typography */
h1 {
    margin-bottom: 1.5rem;
    color: #1e293b;
}

h2 {
    margin-bottom: 1rem;
    color: #334155;
    font-size: 1.25rem;
}

h3 {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    background: white;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:hover {
    background-color: #f8fafc;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: white;
    color: var(--text-color);
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card .value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 0.5rem;
}

/* Form Styles */
input,
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #fff;
    transition: border-color 0.2s;
    font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #475569;
}

/* --- MOBILE RESPONSIVENESS (20:9 & Standard Mobile) --- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .brand {
        margin-bottom: 0;
        font-size: 1.2rem;
    }

    .nav-links {
        margin-top: 1rem;
        display: flex;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .nav-links li {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .nav-links a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
    }

    h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        /* Stack cards vertically on mobile */
    }

    /* Stack tables for better mobile view if needed, or keep scroll */
    .table-responsive {
        box-shadow: inset -5px 0 5px -5px rgba(0, 0, 0, 0.1);
    }
}