/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4361ee;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --success: #06d6a0;
    --danger: #ef476f;
    --warning: #ffd166;
    --bg-body: #f1f5f9;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #1e293b;
    --radius-lg: 20px;
    /* Reduced radius */
    --radius-md: 12px;
    --sidebar-width: 240px;
    /* Reduced width */
    --header-height: 60px;
    /* Mobile header height */
}

* {
    box-sizing: border-box;
    /* Fixed lint error: box-sizing */
    margin: 0;
    padding: 0;
}

html {
    font-size: 85%;
    /* Aggressive scale down (approx 13.6px base) */
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    background-color: #f8fafc;
    background-image:
        radial-gradient(at 0% 0%, rgba(67, 97, 238, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(6, 214, 160, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    display: block;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 999;
    /* Increased Z-index to sure it stays on top */
    transition: transform 0.3s ease;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand i {
    background: var(--primary);
    color: white;
    padding: 8px;
    border-radius: 12px;
    font-size: 1.25rem;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-links a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(67, 97, 238, 0.3);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    /* Hidden on Desktop */
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 2000;
    background: var(--primary);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
    cursor: pointer;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.5);
}

.mobile-toggle.active {
    background: white;
    color: var(--danger);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    left: 200px;
    /* Slide with sidebar */
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
        /* Flex to center icon */
    }
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 2rem 2.5rem;
    /* Reduced padding */
    position: relative;
    z-index: 1;
}

.header-title {
    margin-bottom: 2.5rem;
}

.header-title h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.header-title p {
    color: var(--secondary);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* Grid Layout Fix */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Force 3 columns on Desktop */
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    /* Reduced padding */
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.stat-card:hover {
    padding-top: 1.8rem;
    padding-bottom: 2.2rem;
}

/* Subtle lift effect fix */

.stat-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.stat-card .value {
    font-size: 2rem;
    /* Reduced from 2.5rem */
    font-weight: 800;
    line-height: 1.1;
}

/* General Layout Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.card h2 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-main);
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

thead th {
    text-align: left;
    padding: 1rem;
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

tbody tr {
    transition: all 0.2s;
}

tbody tr:hover {
    transform: scale(1.005);
}

td {
    padding: 1.25rem 1rem;
    background: white;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

td:first-child {
    border-left: 1px solid #f1f5f9;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

td:last-child {
    border-right: 1px solid #f1f5f9;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(67, 97, 238, 0.4);
}

.btn-danger {
    background: #fee2e2;
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on tablet */
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        /* Hide sidebar by default */
        width: 250px;
    }

    .sidebar.active {
        transform: translateX(0);
        /* Slide in */
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
        /* Big shadow when open */
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        /* Compact mobile padding */
        padding-top: 5rem;
    }

    .mobile-toggle {
        display: flex !important;
    }

    /* Adjust sidebar z-index for mobile overlap */
    .sidebar {
        z-index: 1500;
        width: 260px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
        /* Reduced card padding */
    }

    .stat-card .value {
        font-size: 1.75rem;
        /* Smaller numbers */
    }

    .header-title {
        margin-bottom: 1.5rem;
    }

    .header-title h1 {
        font-size: 1.5rem;
        /* Smaller title */
    }

    /* Ensure tables can scroll horizontally */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Make table rows visually separated blocks on mobile if needed, or keep scroll */
    td {
        white-space: nowrap;
    }
}