/* ═══════════════════════════════════════════════════════ */
/*  CleanArch – Modern Dashboard Theme                    */
/* ═══════════════════════════════════════════════════════ */

:root {
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --primary: #4f46e5;
    --primary-light: #eef2ff;
    --bg-body: #f4f6fb;
    --bg-sidebar: #1e1e2d;
    --bg-sidebar-hover: #2a2a3d;
    --text-sidebar: #a2a3b7;
    --text-sidebar-active: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --radius: 0.75rem;
}

/* ── Global ─────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-body);
    color: #1f2937;
    font-size: 0.9rem;
}
a { text-decoration: none; }

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}
.sidebar-brand i { font-size: 1.4rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0; }
.sidebar-nav .nav { gap: 2px; padding: 0 0.75rem; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-sidebar);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.sidebar-nav .nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}
.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: #fff;
}
.sidebar-nav .nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-section-title {
    display: block;
    padding: 1.25rem 1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #565674;
    list-style: none;
}

/* ── Main wrapper ───────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}
.topbar .breadcrumb-item a { color: var(--primary); }
.topbar .breadcrumb-item.active { color: #6b7280; }
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.sidebar-toggle { color: #6b7280; font-size: 1.2rem; padding: 0; border: none; }

/* ── Page Content ───────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* ── Footer ─────────────────────────────────────────── */
.app-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1rem 1.25rem;
}
.stat-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: 0.8rem; color: #6b7280; font-weight: 500; }

/* ── Login Page ─────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 3rem;
}
.login-left h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.login-left p { font-size: 1.1rem; opacity: 0.85; max-width: 400px; text-align: center; }
.login-right {
    width: 480px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.login-card {
    width: 100%;
    max-width: 380px;
}
.login-card h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-card .subtitle { color: #6b7280; margin-bottom: 2rem; font-size: 0.9rem; }
.login-card .form-label { font-weight: 500; font-size: 0.85rem; color: #374151; }
.login-card .form-control {
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid #d1d5db;
    font-size: 0.9rem;
}
.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.login-card .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 0.5rem;
    padding: 0.65rem;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
}
.login-card .btn-primary:hover { background: #4338ca; border-color: #4338ca; }
.login-card .input-group-text {
    background: #f9fafb;
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    color: #9ca3af;
}
.login-card .input-group .form-control { border-left: none; }

/* ── Error Pages ────────────────────────────────────── */
.error-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    text-align: center;
    padding: 2rem;
}
.error-wrapper .error-code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-wrapper h2 { font-size: 1.5rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.error-wrapper p { color: #6b7280; margin-bottom: 1.5rem; }

/* ── Tables ─────────────────────────────────────────── */
.table { font-size: 0.85rem; }
.table thead th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    border-bottom: 2px solid var(--border-color);
}

/* ── Sidebar Overlay (mobile) ───────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1040;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .login-wrapper { flex-direction: column; }
    .login-left { padding: 2rem 1.5rem; min-height: auto; }
    .login-left h1 { font-size: 1.8rem; }
    .login-right { width: 100%; padding: 2rem 1.5rem; }
}
@media (max-width: 575.98px) {
    .page-content { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.4rem; }
}
