:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --sidebar-bg: #0f172a;
    --sidebar-active: #1e293b;
    --text-light: #e2e8f0;
    --text-muted: #94a3b8;
    --success: #16a34a;
    --warning: #ea580c;
    --danger: #dc2626;
}

body {
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f1f5f9;
    margin: 0;
    color: #0f172a;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    padding: 1rem;
}

.login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-box h2 {
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.login-box .subtitle {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--text-light);
    padding: 1rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
    z-index: 1000;
}

.sidebar-brand {
    padding: 0.5rem 1.25rem 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1rem;
}

.sidebar-brand h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
}

.sidebar-brand small {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-section-title {
    padding: 0.5rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.15s;
}

.sidebar a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.sidebar a.active {
    background: var(--primary);
    color: white;
    border-left: 3px solid var(--primary-light);
}

.sidebar a i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.85;
}

.main-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: white;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar .toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.role-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.role-badge.admin {
    background: #dbeafe;
    color: #1e40af;
}

.content {
    padding: 1.5rem;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.page-header .breadcrumb {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

/* Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
}

.stat-card .label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.stat-card .sub {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.danger { border-left: 4px solid var(--danger); }

/* Tables */
.table-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 600;
    padding: 0.75rem;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    font-size: 0.92rem;
}

.btn-action {
    padding: 0.25rem 0.6rem;
    font-size: 0.82rem;
}

/* Forms */
.form-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: #334155;
    margin-bottom: 0.35rem;
}

.required-mark {
    color: var(--danger);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .topbar .toggle-sidebar {
        display: inline-block;
    }
    .content {
        padding: 1rem;
    }
}

/* Empty state */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Filter bar */
.filter-bar {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}
