@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-text: #94a3b8;
    --bg-main: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #10b981; /* Green active state */
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { background-color: var(--bg-main); color: var(--text-main); display: flex; min-height: 100vh; }

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    border-bottom: 1px solid #1e293b;
}

.sidebar-brand i { color: var(--primary); font-size: 1.5rem; }

.sidebar-menu { padding: 16px 12px; flex: 1; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.sidebar-link:hover { background-color: var(--sidebar-hover); color: white; }

.sidebar-link.active {
    background-color: var(--primary);
    color: white;
    font-weight: 500;
}

.sidebar-link i { width: 20px; text-align: center; }

.sidebar-user {
    padding: 16px;
    border-top: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; color: white;
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
    width: calc(100% - 260px);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header h1 { font-size: 1.5rem; font-weight: 600; color: #0f172a; }
.header p { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }

/* --- CARDS --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    border-radius: 12px;
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-card .value { font-size: 1.875rem; font-weight: 700; }
.stat-card .subtext { font-size: 0.8rem; margin-top: 8px; opacity: 0.8; }

.stat-card i {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 3.5rem;
    opacity: 0.2;
}

/* Card Colors */
.bg-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.bg-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.bg-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-rose { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.bg-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }

/* --- TABLES & PANELS --- */
.panel {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 32px;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 { font-size: 1.1rem; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
th {
    background: #f8fafc;
    padding: 16px 24px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid #e2e8f0;
}
td {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
tr:hover td { background: #f8fafc; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- BUTTONS & FORMS --- */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #059669; }

.upload-box {
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 32px;
}
.upload-box input[type="file"] {
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* --- BADGES --- */
.badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* --- CLICKABLE TABLE LINKS --- */
a.table-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
a.table-link:hover {
    color: var(--primary);
}
a.table-link i {
    color: #94a3b8;
    transition: color 0.2s;
}
a.table-link:hover i {
    color: var(--primary);
}