/* ------------------------------------------------------------------
   Enterprise Dashboard — layout & theme
   ------------------------------------------------------------------ */

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 64px;
    --navbar-height: 56px;
}

html, body { height: 100%; }

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

/* ---------- Sidebar ---------- */
.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    transition: width .2s ease;
    overflow-x: hidden;
}

.app-sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.app-sidebar.collapsed .brand-text,
.app-sidebar.collapsed .link-text,
.app-sidebar.collapsed .chevron { display: none; }

.sidebar-brand {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 1rem;
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-primary);
    white-space: nowrap;
}

.sidebar-nav { padding: .5rem .4rem; }

.sidebar-link {
    display: flex;
    align-items: center;
    color: var(--bs-body-color);
    border-radius: .4rem;
    padding: .5rem .75rem;
    white-space: nowrap;
}

.sidebar-link:hover { background: var(--bs-tertiary-bg); }
.sidebar-link .chevron { transition: transform .2s ease; }
.sidebar-link:not(.collapsed) .chevron { transform: rotate(180deg); }

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

.app-navbar {
    height: var(--navbar-height);
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.app-content { flex-grow: 1; }

/* ---------- Stat cards ---------- */
.stat-card .card-body { position: relative; padding: 1rem 1.1rem; }

.stat-icon {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: .6rem;
    font-size: 1.1rem;
}

.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--bs-secondary-color); font-size: .85rem; }

/* ---------- Auth pages ---------- */
.auth-body { min-height: 100vh; background: var(--bs-tertiary-bg); }
.auth-card { width: 100%; max-width: 420px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .app-sidebar { position: fixed; z-index: 1040; height: 100%; margin-left: calc(-1 * var(--sidebar-width)); }
    .app-sidebar.open { margin-left: 0; }
}
