:root {
    --brand: #b5651d;
    --brand-dark: #8a4c15;
    --brand-light: #f2a154;
    --sidebar-bg: #1f2430;
    --sidebar-bg-alt: #262c3a;
    --sidebar-text: #b7bfd1;
    --sidebar-text-active: #ffffff;
    --cream: #fdf6ec;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Poppins', sans-serif;
}

body {
    background-color: var(--cream);
    font-family: var(--font-body);
}

/* =====================================================================
   App shell: fixed sidebar + scrollable content area
   ===================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 264px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand i { color: var(--brand-light); font-size: 1.4rem; }
.sidebar-brand small { color: var(--sidebar-text); font-weight: 400; font-size: 0.7rem; vertical-align: middle; }

.sidebar-nav { padding: 0.75rem 0.75rem 2rem; }

.sidebar-group-label {
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    color: #6b7280;
    padding: 1rem 0.75rem 0.35rem;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.45rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-link i { font-size: 1rem; width: 1.1rem; text-align: center; }
.sidebar-link:hover { background: var(--sidebar-bg-alt); color: var(--sidebar-text-active); }
.sidebar-link.active { background: var(--brand); color: #fff; }
.sidebar-link.top-level { font-weight: 500; }
.sidebar-link.disabled { opacity: 0.45; cursor: not-allowed; }
.sidebar-link.disabled:hover { background: transparent; color: var(--sidebar-text); }

.submenu-toggle .submenu-caret { transition: transform 0.15s ease; font-size: 0.8rem; }
.submenu-toggle[aria-expanded="true"] .submenu-caret { transform: rotate(180deg); }
.sidebar-submenu { padding-left: 1.1rem; border-left: 1px solid rgba(255,255,255,0.08); margin-left: 1.35rem; }
.sidebar-sublink { font-size: 0.86rem; padding-top: 0.45rem; padding-bottom: 0.45rem; }

.breadcrumb-card {
    background: #fff;
    border-radius: 0.6rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 0.65rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.breadcrumb-card-icon { color: var(--brand); opacity: 0.75; font-size: 0.95rem; }

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

.topbar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 10;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -264px;
        z-index: 1050;
        transition: left 0.2s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.2);
    }
    .sidebar.open { left: 0; }
}

/* =====================================================================
   Cards / tables (shared across the app)
   ===================================================================== */
.card { border: none; border-radius: 0.6rem; }
.table thead th { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.03em; color: #6b7280; }
code { color: var(--brand); }

.breadcrumb-bar { background: transparent; }
.breadcrumb { font-size: 0.82rem; }
.breadcrumb-item a { color: var(--brand); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: #6b7280; }

.summary-card {
    border-radius: 0.6rem;
    padding: 1rem 1.25rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.summary-card .summary-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }
.summary-card .summary-value { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin-top: 0.15rem; }
.summary-card .summary-icon { font-size: 1.4rem; color: var(--brand); opacity: 0.8; }

/* DataTables Bootstrap-5 integration tweaks */
.dataTables_wrapper .dataTables_filter input { border-radius: 0.4rem; }
.dataTables_wrapper .dataTables_length select { border-radius: 0.4rem; }
table.dataTable thead th { position: relative; }

/* =====================================================================
   Split-view auth screens (login / forgot password)
   ===================================================================== */
.auth-body { background: #fff; }

.auth-split {
    display: flex;
    min-height: 100vh;
}

.auth-brand-panel {
    flex: 1.1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(135deg, #2b1608 0%, var(--brand-dark) 45%, var(--brand) 100%);
    overflow: hidden;
}
.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.08) 0, transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,0.06) 0, transparent 40%);
}

.auth-brand-content {
    position: relative;
    z-index: 2;
    color: #fff;
    width: 100%;
    max-width: 460px;
}

.auth-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.4rem;
    margin-bottom: 3.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.auth-logo i { color: var(--brand-light); }
.auth-logo small { font-weight: 300; opacity: 0.8; font-size: 0.8rem; }

.auth-carousel { min-height: 260px; }
.auth-slide-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}
.auth-carousel h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.9rem;
    margin-bottom: 0.9rem;
    line-height: 1.25;
}
.auth-carousel p { color: rgba(255,255,255,0.82); font-size: 1.02rem; line-height: 1.6; max-width: 420px; }

.auth-carousel-indicators { position: static; margin-top: 2rem; justify-content: flex-start; }
.auth-carousel-indicators button {
    width: 8px; height: 8px; border-radius: 50%;
    background-color: rgba(255,255,255,0.35);
    opacity: 1; margin-right: 8px; border: none;
}
.auth-carousel-indicators button.active { background-color: #fff; width: 22px; border-radius: 4px; }

.auth-brand-footer {
    margin-top: 3rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 1.25rem;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
}
.auth-form-wrap { width: 100%; max-width: 380px; }

.auth-heading h3 { font-family: var(--font-display); font-weight: 600; margin-bottom: 0.25rem; }

.auth-input-group .input-group-text { background: #f8f9fa; border-right: none; color: #9ca3af; }
.auth-input-group .form-control { border-left: none; }
.auth-input-group .form-control:focus { box-shadow: none; border-color: #ced4da; }
.auth-input-group:focus-within .input-group-text { border-color: var(--brand); }
.auth-input-group:focus-within .form-control { border-color: var(--brand); }
.auth-toggle-password { cursor: pointer; background: #fff; border-left: none; }

.auth-link { color: var(--brand); text-decoration: none; font-weight: 500; }
.auth-link:hover { color: var(--brand-dark); text-decoration: underline; }

.btn-auth-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
}
.btn-auth-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

@media (max-width: 900px) {
    .auth-brand-panel { display: none; }
}
