/* ============================================================
   Excelife Admin Design System — plain CSS
   Bootstrap, Bootstrap Icons, and DataTables come from CDN.
   This file covers only app-specific overrides and components.
   ============================================================ */

/* ---- Base ------------------------------------------------- */
body {
    --portal: #0d6efd;
    --portal-rgb: 13, 110, 253;
    --sidebar-width: 264px;
    --sidebar-rail-width: 76px;
    --border-color: #e7eaf0;

    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f6fb;
    color: #1f2733;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

a { text-decoration: none; }

.text-portal { color: var(--portal) !important; }
.bg-portal-soft { background-color: rgba(var(--portal-rgb), 0.1) !important; }

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

@media (min-width: 992px) {
    aside.app-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        z-index: 1030;
    }

    .app-main {
        margin-left: var(--sidebar-width);
        transition: margin-left 0.2s ease;
    }

    html.sidebar-collapsed .app-main {
        margin-left: var(--sidebar-rail-width);
    }
}

aside.app-sidebar { transition: width 0.2s ease; }

html.sidebar-collapsed aside.app-sidebar {
    width: var(--sidebar-rail-width);
    overflow: hidden;
}

html.sidebar-collapsed aside.app-sidebar .app-sidebar__brand {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
}

html.sidebar-collapsed aside.app-sidebar .app-sidebar__brand .flex-grow-1,
html.sidebar-collapsed aside.app-sidebar .app-sidebar__section,
html.sidebar-collapsed aside.app-sidebar .app-nav__link span,
html.sidebar-collapsed aside.app-sidebar .app-nav__caret,
html.sidebar-collapsed aside.app-sidebar .app-sidebar__footer {
    display: none;
}

html.sidebar-collapsed aside.app-sidebar .app-nav {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

html.sidebar-collapsed aside.app-sidebar .app-nav__link {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

html.sidebar-collapsed aside.app-sidebar .app-nav__link i {
    width: auto;
    font-size: 1.2rem;
}

html.sidebar-collapsed aside.app-sidebar .app-nav__sub {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
}

/* ---- Sidebar --------------------------------------------- */
.app-sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.app-sidebar__brand {
    height: 68px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.4rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
    color: #1f2733;
}

.app-sidebar__brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 0.6rem;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1rem;
    background: var(--portal);
    box-shadow: 0 4px 10px rgba(var(--portal-rgb), 0.35);
    flex: 0 0 auto;
}

.app-sidebar__section {
    padding: 1rem 0.85rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa3b2;
}

.app-nav {
    padding: 0.35rem 0.7rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-y: auto;
}

.app-nav__link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.62rem 0.8rem;
    border-radius: 0.6rem;
    color: #525c6b;
    font-weight: 500;
    font-size: 0.94rem;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.app-nav__link i {
    font-size: 1.1rem;
    width: 1.35rem;
    text-align: center;
    color: #9aa3b2;
    transition: color 0.15s ease;
}

.app-nav__link:hover {
    background: #f4f6fb;
    color: #1f2733;
}

.app-nav__link:hover i { color: #525c6b; }

.app-nav__link.is-active {
    background: rgba(var(--portal-rgb), 0.1);
    color: var(--portal);
    font-weight: 600;
}

.app-nav__link.is-active i { color: var(--portal); }

.app-nav__group { cursor: pointer; }

.app-nav__group.is-open {
    color: #1f2733;
    font-weight: 600;
}

.app-nav__caret {
    font-size: 0.8rem !important;
    width: auto !important;
    margin-left: auto;
    color: #b3bccb !important;
    transition: transform 0.2s ease;
}

.app-nav__group[aria-expanded='true'] .app-nav__caret {
    transform: rotate(180deg);
}

.app-nav__sub {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin: 0.15rem 0 0.15rem 1.55rem;
    padding-left: 0.55rem;
    border-left: 1px solid var(--border-color);
}

.app-nav__link--sub {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
}

.app-sidebar__footer {
    margin-top: auto;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: #9aa3b2;
}

/* ---- Topbar ---------------------------------------------- */
.app-topbar {
    height: 68px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-topbar__title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.app-topbar__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.6rem;
    color: #1f2733;
    transition: background-color 0.15s ease;
}

.app-topbar__user:hover { background: #f4f6fb; }
.app-topbar__user::after { display: none; }

.app-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--portal);
    background: rgba(var(--portal-rgb), 0.12);
    flex: 0 0 auto;
    text-transform: uppercase;
}

/* ---- Main content ---------------------------------------- */
.app-main {
    flex: 1 1 auto;
    min-width: 0;
}

.app-content { padding: 1.75rem; }

@media (min-width: 1200px) {
    .app-content { padding: 2.25rem 2.5rem; }
}

.page-head { margin-bottom: 1.6rem; }

.page-head__title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
}

.page-head__subtitle {
    color: #6b7686;
    margin: 0.2rem 0 0;
    font-size: 0.95rem;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.875rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

.card-elevated { box-shadow: 0 4px 24px rgba(16, 24, 40, 0.06); }

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.3rem 1.4rem;
}

.stat-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 0.85rem;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    color: var(--portal);
    background: rgba(var(--portal-rgb), 0.12);
    flex: 0 0 auto;
}

.stat-card__label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7686;
    margin: 0;
}

.stat-card__value {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0.1rem 0 0;
    color: #1f2733;
}

/* ============================================================
   Tables
   ============================================================ */
.table { margin: 0; }
.table > :not(caption) > * > * { border-bottom-color: #eef1f6; }

.table thead th {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8a93a3;
    background: #fafbfd;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table tbody tr { transition: background-color 0.12s ease; }
.table tbody td { vertical-align: middle; }

.table code {
    background: #f1f3f8;
    color: #5b6472;
    padding: 0.15rem 0.45rem;
    border-radius: 0.4rem;
    font-size: 0.82rem;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(var(--portal-rgb), 0.04);
}

.card > .table-responsive,
.card > .table {
    border-radius: inherit;
    overflow: hidden;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    --bs-btn-padding-y: 0.5rem;
    --bs-btn-padding-x: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 0.55rem;
    line-height: 1.3;
}

.btn-sm {
    --bs-btn-padding-y: 0.3rem;
    --bs-btn-padding-x: 0.6rem;
    border-radius: 0.45rem;
}

.btn-portal {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--portal);
    --bs-btn-border-color: var(--portal);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: color-mix(in srgb, var(--portal) 88%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--portal) 88%, #000);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: color-mix(in srgb, var(--portal) 80%, #000);
    --bs-btn-active-border-color: color-mix(in srgb, var(--portal) 80%, #000);
    --bs-btn-focus-shadow-rgb: var(--portal-rgb);
    box-shadow: 0 3px 8px rgba(var(--portal-rgb), 0.28);
}

.btn-soft {
    --bs-btn-color: #475063;
    --bs-btn-bg: #ffffff;
    --bs-btn-border-color: #d3d9e3;
    --bs-btn-hover-color: #1f2733;
    --bs-btn-hover-bg: #f1f4f9;
    --bs-btn-hover-border-color: #b9c2d2;
    --bs-btn-active-color: #1f2733;
    --bs-btn-active-bg: #e9edf5;
    --bs-btn-active-border-color: #b9c2d2;
    box-shadow: 0 1px 1px rgba(16, 24, 40, 0.03);
}

.btn-soft-danger {
    --bs-btn-color: #dc3545;
    --bs-btn-bg: rgba(220, 53, 69, 0.08);
    --bs-btn-border-color: rgba(220, 53, 69, 0.3);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #dc3545;
    --bs-btn-hover-border-color: #dc3545;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #dc3545;
    --bs-btn-active-border-color: #dc3545;
}

.btn-icon {
    --bs-btn-padding-x: 0.5rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
    --bs-badge-padding-y: 0.4em;
    --bs-badge-padding-x: 0.7em;
    border-radius: 2rem;
    letter-spacing: 0.01em;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35em 0.75em;
    border-radius: 0.3rem;
}

.badge-status::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

.badge-status--active { color: #167a4d; background: rgba(25, 135, 84, 0.12); }
.badge-status--inactive { color: #6b7280; background: rgba(108, 117, 125, 0.14); }
.badge-status--claimed,
.badge-status--info { color: #0e7490; background: rgba(14, 165, 233, 0.16); }
.badge-status--return,
.badge-status--warning { color: #b54708; background: rgba(247, 144, 9, 0.16); }

.badge-type {
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35em 0.75em;
}

.badge-type--normal { color: #4a5568; background: rgba(108, 117, 125, 0.14); }
.badge-type--seasonal { color: #9a6700; background: rgba(255, 193, 7, 0.18); }
.badge-type--common { color: #4a5568; background: rgba(108, 117, 125, 0.14); }
.badge-type--days-remaining { color: #1d4ed8; background: rgba(37, 99, 235, 0.14); }
.badge-type--claims-remaining { color: #9a6700; background: rgba(255, 193, 7, 0.18); }
.badge-type--days-purchased { color: #0e7490; background: rgba(14, 165, 233, 0.16); }

.badge-choice {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.45em 0.75em;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #3730a3;
    background-color: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 0.375rem;
    line-height: 1.4;
    white-space: normal;
    text-align: left;
    min-width: 260px;
    max-width: 420px;
    width: 100%;
}

.badge-choice .badge-choice-tag {
    display: inline-block;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #312e81;
    background-color: #e0e7ff;
    border-radius: 0.25rem;
    padding: 0.15em 0.5em;
    margin-bottom: 0.15rem;
    flex-shrink: 0;
}

.badge-choice-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.badge-choice-item {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    width: 100%;
}

.badge-choice-bullet {
    color: #6366f1;
    font-weight: 700;
    margin-right: 0.15rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.badge-claimed-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.15em 0.5em;
    border-radius: 0.25rem;
    margin-left: 0.35rem;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.badge-soft { color: #5b6472; background: #eef1f6; font-weight: 600; }

.badge-soft-secondary {
    color: #5b6472;
    background: rgba(108, 117, 125, 0.12);
    border: 1px solid rgba(108, 117, 125, 0.3);
    font-weight: 600;
}

.badge-soft-success {
    color: #167a4d;
    background: rgba(25, 135, 84, 0.12);
    border: 1px solid rgba(25, 135, 84, 0.3);
    font-weight: 600;
}

.badge-soft-danger {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.3);
    font-weight: 600;
}

.badge-soft-info {
    color: #087990;
    background: rgba(13, 202, 240, 0.12);
    border: 1px solid rgba(13, 202, 240, 0.35);
    font-weight: 600;
}

.badge-soft-warning {
    color: #9a6700;
    background: rgba(255, 193, 7, 0.18);
    border: 1px solid rgba(255, 193, 7, 0.4);
    font-weight: 600;
}

.badge-soft-primary {
    color: #084298;
    background: rgba(13, 110, 253, 0.12);
    border: 1px solid rgba(13, 110, 253, 0.35);
    font-weight: 600;
}

/* Batch In — section groups (product / outlet) */
.batch-section-tone {
    overflow: hidden;
}

.batch-section-tone--0 {
    box-shadow: inset 4px 0 0 0 #0d6efd, 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}
.batch-section-tone--0 > .card-header {
    background: rgba(13, 110, 253, 0.08);
}

.batch-section-tone--1 {
    box-shadow: inset 4px 0 0 0 #198754, 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}
.batch-section-tone--1 > .card-header {
    background: rgba(25, 135, 84, 0.1);
}

.batch-section-tone--2 {
    box-shadow: inset 4px 0 0 0 #0dcaf0, 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}
.batch-section-tone--2 > .card-header {
    background: rgba(13, 202, 240, 0.1);
}

.batch-section-tone--3 {
    box-shadow: inset 4px 0 0 0 #fd7e14, 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}
.batch-section-tone--3 > .card-header {
    background: rgba(253, 126, 20, 0.1);
}

.batch-section-tone--4 {
    box-shadow: inset 4px 0 0 0 #6f42c1, 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}
.batch-section-tone--4 > .card-header {
    background: rgba(111, 66, 193, 0.1);
}

.batch-section-tone--5 {
    box-shadow: inset 4px 0 0 0 #d63384, 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}
.batch-section-tone--5 > .card-header {
    background: rgba(214, 51, 132, 0.08);
}

.batch-section-tone .batch-section-qty { font-weight: 600; }
.batch-section-tone--0 .batch-section-qty { color: #084298; background: rgba(13, 110, 253, 0.12); border: 1px solid rgba(13, 110, 253, 0.35); }
.batch-section-tone--1 .batch-section-qty { color: #167a4d; background: rgba(25, 135, 84, 0.12); border: 1px solid rgba(25, 135, 84, 0.3); }
.batch-section-tone--2 .batch-section-qty { color: #087990; background: rgba(13, 202, 240, 0.12); border: 1px solid rgba(13, 202, 240, 0.35); }
.batch-section-tone--3 .batch-section-qty { color: #b45309; background: rgba(253, 126, 20, 0.12); border: 1px solid rgba(253, 126, 20, 0.35); }
.batch-section-tone--4 .batch-section-qty { color: #59359a; background: rgba(111, 66, 193, 0.12); border: 1px solid rgba(111, 66, 193, 0.35); }
.batch-section-tone--5 .batch-section-qty { color: #ab296a; background: rgba(214, 51, 132, 0.1); border: 1px solid rgba(214, 51, 132, 0.3); }

/* ============================================================
   Forms
   ============================================================ */
.form-label {
    font-weight: 600;
    font-size: 0.86rem;
    color: #3a4350;
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    padding: 0.6rem 0.85rem;
    border-radius: 0.55rem;
}

.form-select,
.dropdown-toggle,
select {
    cursor: pointer;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--portal-rgb), 0.18);
}

.form-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9aa3b2;
    margin-bottom: 0.25rem;
}

.form-check-input {
    width: 1.15em;
    height: 1.15em;
    margin-top: 0.15em;
    border: 1.5px solid #c2cad6;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.form-check-input:checked {
    background-color: var(--portal);
    border-color: var(--portal);
}

.form-check-input:focus {
    border-color: rgba(var(--portal-rgb), 0.6);
    box-shadow: 0 0 0 0.2rem rgba(var(--portal-rgb), 0.2);
}

.form-check-input:disabled {
    opacity: 1;
    background-color: rgba(var(--portal-rgb), 0.55);
    border-color: rgba(var(--portal-rgb), 0.55);
    cursor: not-allowed;
}

.form-check-input:disabled ~ .form-check-label { opacity: 0.85; }

.perm-from-role { font-size: 0.68rem; font-weight: 600; }

/* ============================================================
   Dropdown menu
   ============================================================ */
.dropdown-menu {
    --bs-dropdown-border-color: #e7eaf0;
    --bs-dropdown-border-radius: 0.7rem;
    --bs-dropdown-link-active-bg: rgba(var(--portal-rgb), 0.1);
    --bs-dropdown-link-active-color: var(--portal);
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
    padding: 0.4rem;
}

.dropdown-menu .dropdown-item {
    border-radius: 0.45rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    border: 1px solid transparent;
    border-radius: 0.7rem;
    display: flex;
    gap: 0.65rem;
}

.alert > .alert-icon {
    font-size: 1.15rem;
    line-height: 1.4;
    flex: 0 0 auto;
}

/* ============================================================
   Empty states
   ============================================================ */
.empty-state { padding: 3.25rem 1.5rem; text-align: center; }

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: var(--portal);
    background: rgba(var(--portal-rgb), 0.1);
}

.empty-state__title { font-weight: 700; margin-bottom: 0.25rem; }

.empty-state__text {
    color: #6b7686;
    margin: 0 auto;
    max-width: 24rem;
    font-size: 0.92rem;
}

/* ============================================================
   DataTables 2.x polish
   ============================================================ */
.dt-container { padding: 1.1rem 1.25rem 0.85rem; }

.dt-container .dt-layout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.dt-container .dt-layout-start,
.dt-container .dt-layout-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dt-container .dt-layout-table {
    width: 100%;
    margin: 0 -1.25rem;
}

.dt-container .dt-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dt-container .dt-search input {
    border: 1px solid #d8dde7;
    border-radius: 0.55rem;
    padding: 0.4rem 0.8rem;
    min-width: 200px;
}

.dt-container .dt-search input:focus {
    outline: none;
    border-color: rgba(var(--portal-rgb), 0.55);
    box-shadow: 0 0 0 0.2rem rgba(var(--portal-rgb), 0.15);
}

.dt-container .dt-length select {
    border-radius: 0.5rem;
    border: 1px solid #d8dde7;
    padding: 0.3rem 1.6rem 0.3rem 0.6rem;
}

.dt-container .dt-info { color: #6b7686; font-size: 0.85rem; }

.dt-container .dt-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dt-container .dt-buttons .btn { white-space: nowrap; }

.dt-container .dt-processing {
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.1);
    font-weight: 600;
    color: var(--portal);
}

.dt-container .pagination { margin: 0; }

.dt-container .pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 0.12rem;
    border-color: var(--border-color);
    color: #1f2733;
}

.dt-container .pagination .page-item.active .page-link {
    background: var(--portal);
    border-color: var(--portal);
    color: #fff;
}

.dt-container .pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--portal-rgb), 0.2);
}

/* Mobile: only the table row scrolls; controls stay put */
.dt-layout-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Sort icon alignment for centered/right-aligned headers */
table.dataTable thead th.text-center div.dt-column-header { flex-direction: row; justify-content: center; }
table.dataTable thead th.text-center div.dt-column-header .dt-column-title { flex-grow: 0; }
table.dataTable thead th.text-end div.dt-column-header { flex-direction: row; justify-content: flex-end; }
table.dataTable thead th.text-end div.dt-column-header .dt-column-title { flex-grow: 0; }

/* ============================================================
   Impersonation banner
   ============================================================ */
.impersonation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.6rem 1.25rem;
    background: #1f2733;
    color: #fff;
    font-size: 0.9rem;
}

.impersonation-bar strong { font-weight: 700; }

@media (min-width: 1200px) {
    .impersonation-bar { padding-left: 2.5rem; padding-right: 2.5rem; }
}

/* ============================================================
   Toggle switch (form boolean type)
   ============================================================ */
.switch {
    --switch-w: 46px;
    --switch-h: 26px;
    --switch-knob: 20px;
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.switch .switch-input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch .switch-toggle-slider {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: var(--switch-w);
    height: var(--switch-h);
    background: #ccd2dd;
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.switch .switch-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: var(--switch-knob);
    height: var(--switch-knob);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25);
    transition: transform 0.2s ease;
}

.switch .switch-on,
.switch .switch-off { display: none; }

.switch .switch-input:checked + .switch-toggle-slider { background: #198754; }

.switch .switch-input:checked + .switch-toggle-slider::after {
    transform: translateX(calc(var(--switch-w) - var(--switch-knob) - 6px));
}

.switch .switch-input:focus-visible + .switch-toggle-slider {
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.switch.switch-success .switch-input:checked + .switch-toggle-slider { background: #198754; }

/* ============================================================
   Outlet Portal Layout
   ============================================================ */
.outlet-wrap {
    min-height: 100vh;
    background: #eef2f7;
    display: flex;
    flex-direction: column;
}

.outlet-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 80px;
    flex-shrink: 0;
}

.outlet-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.outlet-header__name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1f2733;
}

.outlet-header__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1f2733;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.4rem 0.65rem;
    border-radius: 0.55rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.outlet-header__user::after { display: none; }
.outlet-header__user:hover { background: #f4f6fb; }
.outlet-header__user i { font-size: 1.1rem; color: #7a8499; }

.outlet-tiles {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: #eef2f7;
    flex-shrink: 0;
}

.outlet-tile {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 1.25rem 0.5rem;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid var(--border-color);
    color: #b0bac8;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .outlet-tile { min-height: 130px; padding: 1.5rem 1rem; }
}

.outlet-tile i { font-size: 1.75rem; }

@media (min-width: 768px) {
    .outlet-tile i { font-size: 2.2rem; }
}

.outlet-tile:hover:not(.is-active) {
    background: #f8f9fc;
    color: #7a8499;
    border-color: #d0d7e3;
}

.outlet-tile.is-active {
    background: #1565c0;
    border-color: #1565c0;
    color: #fff;
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.3);
}

.outlet-tile__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.outlet-flash { padding: 0 1.5rem 0.75rem; }

.outlet-content {
    flex: 1;
    padding: 0 1.5rem 2rem;
}

.outlet-footer {
    text-align: center;
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    color: #9aa3b2;
    border-top: 1px solid var(--border-color);
    background: #fff;
    flex-shrink: 0;
}

/* Outlet dashboard stat cards */
.outlet-stat-lg {
    border-radius: 1rem;
    padding: 1.75rem 2rem;
    color: #fff;
}

.outlet-stat-lg__value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.4rem;
}

.outlet-stat-lg__label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.88;
}

.outlet-stat-lg--purple { background: #6c3fc5; }
.outlet-stat-lg--yellow { background: #f0a500; }

.outlet-stat-sm {
    border-radius: 0.85rem;
    padding: 1.1rem 1.4rem;
    background: #d8f3e6;
}

.outlet-stat-sm__value {
    font-size: 1.9rem;
    font-weight: 800;
    color: #1a7c45;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.outlet-stat-sm__label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #2d8a52;
}

/* ============================================================
   Auth (login) screen
   ============================================================ */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(1100px 540px at 100% -10%, rgba(var(--portal-rgb), 0.14), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(var(--portal-rgb), 0.1), transparent 55%),
        #f4f6fb;
}

.auth-card { width: 100%; max-width: 420px; }

.auth-logo {
    margin: 0 auto 1rem;
    display: flex;
    justify-content: center;
}
