/* EFA FASHION ERP PRO — application styles
   Layered on top of Bootstrap 5. Supports light/dark via [data-bs-theme]. */

:root {
    --efa-primary: #6f42c1;
    --efa-sidebar-w: 248px;
    --efa-sidebar-w-collapsed: 64px;
}

body { background: var(--bs-body-bg); }

/* ----- Auth screen ----- */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 60%, #3d2275 100%);
    padding: 1rem;
}
.auth-card { width: 100%; max-width: 400px; border: none; border-radius: 1rem; }
.brand-mark {
    width: 64px; height: 64px; line-height: 64px; margin: 0 auto;
    border-radius: 16px; font-size: 30px; color: #fff;
    background: linear-gradient(135deg, #6f42c1, #8a63d2);
}

/* ----- App shell ----- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--efa-sidebar-w);
    flex-shrink: 0;
    background: #211a36;
    color: #cfc7e6;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width .2s ease;
    overflow: hidden;
}
[data-bs-theme="dark"] .sidebar { background: #15101f; }

.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1rem 1.1rem; font-weight: 700; font-size: 1.05rem;
    color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
}
.sidebar-brand .bi { font-size: 1.4rem; color: #b794f4; }

.sidebar-nav { padding: .6rem; display: flex; flex-direction: column; gap: .15rem; overflow-y: auto; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: .75rem;
    color: #cfc7e6; border-radius: .5rem; padding: .6rem .8rem;
    white-space: nowrap; font-size: .94rem;
}
.sidebar-nav .nav-link .bi { font-size: 1.1rem; min-width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--efa-primary); color: #fff; }

.app-shell.collapsed .sidebar { width: var(--efa-sidebar-w-collapsed); }
.app-shell.collapsed .brand-text,
.app-shell.collapsed .nav-text { display: none; }

/* ----- Main area ----- */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem 1rem; background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 1.15rem; font-weight: 600; margin: 0; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .4rem; }
.btn-icon {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: .5rem; border: 1px solid var(--bs-border-color); background: transparent; color: var(--bs-body-color);
}
.btn-icon:hover { background: var(--bs-secondary-bg); }
.btn-user { border: 1px solid var(--bs-border-color); border-radius: .5rem; }

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

/* ----- Stat cards ----- */
.stat-card {
    display: flex; align-items: center; gap: .9rem;
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
    border-radius: .75rem; padding: 1rem; border-left-width: 4px; height: 100%;
}
.stat-icon { font-size: 1.8rem; }
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .82rem; color: var(--bs-secondary-color); margin-top: .25rem; }

/* RTL tweaks */
[dir="rtl"] .stat-card { border-left-width: 1px; border-right-width: 4px; }

.error-page { max-width: 480px; margin: 0 auto; }

/* Mobile: sidebar becomes an off-canvas overlay */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; z-index: 1040; height: 100vh;
        transform: translateX(-105%); transition: transform .2s ease;
    }
    [dir="rtl"] .sidebar { transform: translateX(105%); }
    .app-shell.mobile-open .sidebar { transform: translateX(0); }
}
