@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ==========================================================================
   SMART-EVAL DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Colors */
    --primary: #0284c7;
    --primary-light: #38bdf8;
    --primary-dark: #0369a1;
    --secondary: #f59e0b;
    --secondary-light: #fcd34d;
    --secondary-dark: #d97706;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-dark: #0f172a;
    --bg-darker: #020617;

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    --border: #e2e8f0;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Shadow & Border Radius */
    --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);
    --shadow-glass: 0 8px 32px rgba(148, 163, 184, 0.15);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, #e0f2fe, #f8fafc);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Flex & Grid */
.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
    .d-flex-md-col { flex-direction: column; }
}

/* ==========================================================================
   UI COMPONENTS
   ========================================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(2, 132, 199, 0.4);
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    color: #000;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-block {
    width: 100%;
}

/* Inputs & Forms */
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
}
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-main);
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus {
    outline: 0;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

/* Cards (Glassmorphism) */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-glass);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(148, 163, 184, 0.2);
}
.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Alerts / Messages */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInDown 0.4s ease-out;
}
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-full);
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-success { background: var(--success); color: #fff; }
.badge-warning { background: var(--warning); color: #fff; }
.badge-danger { background: var(--danger); color: #fff; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.table th, .table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.table th {
    background-color: rgba(248, 250, 252, 0.8);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.table tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.5);
}

/* ==========================================================================
   LAYOUTS (Dashboard & Sidebar)
   ========================================================================== */

.app-wrapper {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 50;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}
.sidebar-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header img {
    width: 40px;
}
.sidebar-header h2 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0;
}
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}
.nav-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 4px solid transparent;
}
.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.nav-item.active {
    border-left-color: var(--secondary);
}
.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

/* Tabs */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}
.tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Topbar */
.topbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Content Area */
.content-area {
    padding: 2rem;
    flex: 1;
}

/* Dashboard Specifics */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: rgba(2, 132, 199, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}
.stat-info h4 {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-body);
}
.stat-info h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-main);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out forwards; }
.animate-fade-up { animation: fadeInUp 0.5s ease-out forwards; }

/* ==========================================================================
   RESPONSIVE (MOBILE)
   ========================================================================== */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
    }
    .sidebar.open {
        transform: translateX(260px);
    }
    .menu-toggle {
        display: block;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 45;
        backdrop-filter: blur(3px);
    }
    .sidebar-overlay.active {
        display: block;
    }
    .content-area {
        padding: 1.5rem 1rem;
    }
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-body);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: fadeInDown 0.3s ease-out;
}

.close-modal {
    color: var(--text-muted);
    position: absolute;
    right: 1.5rem;
    top: 1.2rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--danger);
    text-decoration: none;
}