:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #9333ea;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #cbd5e1;
    --sidebar-bg: #ffffff;
    --sidebar-active: #4f46e5;
    --sidebar-text: #475569;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Font Sizes */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
    --fs-3xl: 1.875rem;
    --fs-4xl: 2.25rem;
}

.dark {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hind Siliguri', 'Inter', sans-serif;
}

/* Typography Utilities */
.text-xs { font-size: var(--fs-xs) !important; }
.text-sm { font-size: var(--fs-sm) !important; }
.text-base { font-size: var(--fs-base) !important; }
.text-lg { font-size: var(--fs-lg) !important; }
.text-xl { font-size: var(--fs-xl) !important; }
.text-2xl { font-size: var(--fs-2xl) !important; }
.text-3xl { font-size: var(--fs-3xl) !important; }
.text-4xl { font-size: var(--fs-4xl) !important; }
.font-black { font-weight: 900 !important; }
.font-extrabold { font-weight: 800 !important; }
.font-bold { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.font-medium { font-weight: 500 !important; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 18rem;
    transition: margin-left 0.3s ease;
}

.admin-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 4.5rem;
}

@media (max-width: 768px) {
    .admin-content {
        margin-left: 0 !important;
    }

    .sidebar-toggle-btn {
        display: flex !important;
    }
}

.sidebar-toggle-btn {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.admin-main {
    flex: 1;
    padding: 2rem;
}

@media (max-width: 768px) {
    .admin-main {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Sidebar */
.sidebar {
    width: 18rem;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.75rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.03);
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.6rem;
    text-decoration: none;
    color: var(--sidebar-text);
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Cards & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 2fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.025em;
    margin-bottom: 0.25rem;
}

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 900;
}

/* Data Tables */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    width: 100%;
}


.table-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 800;
}

/* Responsive Table (Cards on Mobile) */
@media (max-width: 640px) {
    .dg-table, .dg-table thead, .dg-table tbody, .dg-table th, .dg-table td, .dg-table tr {
        display: block;
    }

    .dg-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .dg-table tr {
        border: 2px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
        background: #ffffff;
        box-shadow: var(--shadow-sm);
    }

    .dg-table td {
        border: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        position: relative;
        padding: 0.75rem 1rem 0.75rem 50% !important;
        text-align: right;
        min-height: 3rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .dg-table td:last-child {
        border-bottom: none;
        background: rgba(0,0,0,0.01);
    }

    .dg-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 800;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.65rem;
        letter-spacing: 0.05em;
    }
}

.dg-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.dg-table th {
    background: rgba(0, 0, 0, 0.02);
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .dg-table th {
    background: rgba(255, 255, 255, 0.02);
}

.dg-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.dg-table tr:last-child td {
    border-bottom: none;
}

.dg-table tr:hover td {
    background: rgba(99, 102, 241, 0.02);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-flex;
    align-items: center;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.dark .badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.dark .badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.dark .badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.875rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
}

.btn-icon:hover {
    background: var(--border-color);
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
    background: #ffffff;
    color: var(--text-main);
    font-size: var(--fs-base);
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
    background: #fff;
}

/* Input with Icon Utilities */
.input-with-icon {
    position: relative;
    display: block;
    width: 100%;
}

.input-with-icon .icon-left {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 10;
}

.input-with-icon .form-control {
    padding-left: 3.5rem !important;
}

.input-with-icon .material-symbols-outlined {
    font-size: 1.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 32rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.01);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-fade {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide {
    animation: slideUp 0.4s ease-out;
}