:root {
    --ag-maroon: #8d0f00;
    --ag-scarlet: #ff3300;
    --ag-gold: #d4af37;
    --ag-sand: #fff8e7;
    --ag-bg: #f8fafc;
    --ag-panel: #ffffff;
    --ag-border: #e2e8f0;
    --ag-soft: #f1f5f9;
    --ag-text: #172033;
    --ag-muted: #64748b;
    --ag-green: #0f766e;
    --ag-red: #b42318;
    --ag-blue: #1d4ed8;
    --ag-amber: #92400e;
    --ag-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--ag-bg);
    color: var(--ag-text);
    font-family: "Poppins", "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.sap-shell,
.preview-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 304px minmax(0, 1fr);
}

.sap-sidebar,
.sidebar {
    width: 304px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    background: linear-gradient(180deg, #ffffff, #fbfcff);
    border-right: 1px solid var(--ag-border);
    padding: 14px 12px;
    z-index: 3;
}

.sap-brand,
.brand {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--ag-border);
    margin-bottom: 10px;
}

.sap-brand span,
.brand span {
    line-height: 1.2;
}

.sap-brand strong,
.sap-brand small,
.brand strong {
    display: block;
}

.sap-brand small,
.brand span span {
    color: var(--ag-muted);
    margin-top: 2px;
}

.sap-brand-mark,
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ag-maroon);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
}

.sap-sidebar-search,
.sap-quick-links {
    margin-bottom: 12px;
}

.sap-sidebar-search {
    position: relative;
}

.sap-sidebar-search input,
.sap-menu-search {
    width: 100%;
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    min-height: 38px;
    padding: 8px 36px 8px 36px;
    background: var(--ag-soft);
}

.sap-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ag-muted);
    font-size: 14px;
    pointer-events: none;
}

.sap-quick-links {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
}

.sap-quick-links a {
    border: 1px solid var(--ag-border);
    border-radius: 10px;
    padding: 9px 12px;
    background: #fff;
    color: #334155;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sap-quick-links a:hover {
    border-color: #ffcc99;
    background: #fff8ef;
}

.sap-menu-group {
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
}

.sap-menu-summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    border-bottom: 1px solid #f1f5f9;
    padding: 10px;
    color: #1e293b;
    background: #f8fafc;
    font-weight: 700;
    font-size: 12px;
}

.sap-menu-summary::-webkit-details-marker {
    display: none;
}

.sap-menu-summary-main {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
}

.sap-menu-group-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: var(--ag-maroon);
    display: inline-grid;
    place-items: center;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
}

.sap-menu-summary::after {
    content: '\25BE';
    color: #64748b;
    margin-top: 2px;
    transition: transform 0.2s ease;
}

.sap-menu-group[open] .sap-menu-summary::after {
    transform: rotate(-180deg);
}

.sap-sidebar--tree .sap-menu-group {
    border: 0;
    border-radius: 0;
    margin: 0 0 10px;
    background: transparent;
    overflow: visible;
}

.sap-sidebar--tree .sap-menu-summary,
.sap-sidebar--tree .menu-section h2 {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 40px;
    background: #fff;
    border: 1px solid var(--ag-border);
    border-radius: 10px;
    padding: 10px 12px;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sap-sidebar--tree .sap-menu-summary-main {
    align-items: center;
    gap: 10px;
}

.sap-sidebar--tree .sap-menu-group-icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border-color: #dbeafe;
    background: #eff6ff;
    color: var(--ag-maroon);
    font-size: 11px;
}

.sap-sidebar--tree .sap-group-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #334155;
    letter-spacing: 0.04em;
}

.sap-sidebar--tree .sap-menu-summary::after {
    display: inline-flex;
}

.sap-sidebar--tree .sap-menu-list,
.sap-sidebar--tree .menu-section ul {
    margin: 6px 0 2px 12px;
    padding: 0 0 4px 14px;
    border-left: 1px dashed #d1d5db;
}

.sap-sidebar--tree .sap-menu-item,
.sap-sidebar--tree .menu-section a {
    position: relative;
    border-radius: 8px;
    min-height: 34px;
    margin-left: 0;
    padding-left: 8px;
}

.sap-sidebar--tree .sap-sidebar-search,
.sap-sidebar--tree .sap-quick-links {
    display: none;
}

.sap-sidebar--tree .sap-menu-item::before,
.sap-sidebar--tree .menu-section a::before {
    display: none;
}

.sap-sidebar--tree .sap-menu-item.is-active,
.sap-sidebar--tree .sap-menu-item[aria-current='page'] {
    background: #fff7ed;
    color: var(--ag-maroon);
    border-left: 3px solid var(--ag-maroon);
    padding-left: 7px;
}

.menu-section em,
.sap-menu-item em {
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    white-space: nowrap;
}

.sap-menu-list,
.menu-section ul {
    list-style: none;
    margin: 0;
    padding: 8px;
}

.sap-menu-list li + li,
.menu-section li + li {
    margin-top: 3px;
}

.sap-menu-item,
.menu-section a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 36px;
    border-radius: 8px;
    padding: 8px 10px;
    color: #334155;
    font-size: 13px;
}

.sap-menu-single-item {
    margin-bottom: 8px;
}

.sap-menu-item:hover,
.sap-menu-item.is-active,
.sap-menu-item[aria-current='page'],
.menu-section a:hover {
    background: #fff4ec;
    color: var(--ag-maroon);
    border-left: 3px solid var(--ag-maroon);
    padding-left: 7px;
}

.sap-menu-item-icon {
    width: 20px;
    text-align: center;
    font-size: 13px;
}

.sap-menu-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.sap-main,
.main {
    min-width: 0;
    padding: 20px 22px 28px;
    max-width: 100%;
}

.sap-header,
.topbar {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--ag-border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.sap-header .sap-sidebar-toggle {
    margin: 0;
}

.sap-header h1,
.topbar h1 {
    margin: 0;
    color: var(--ag-maroon);
    font-size: 29px;
}

.sap-header p,
.topbar p,
.crumbs {
    color: var(--ag-muted);
    margin: 4px 0 0;
}

.crumbs {
    margin: 0 0 4px;
}

.sap-admin-box,
.top-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sap-pill {
    border: 1px solid var(--ag-border);
    border-radius: 999px;
    background: #fff;
    color: #475569;
    padding: 7px 11px;
    font-size: 12px;
    white-space: nowrap;
}

.sap-logout-form {
    margin: 0;
}

.sap-logout-form button,
.btn,
.login-form button,
.module-cta {
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    min-height: 36px;
    padding: 0 12px;
    font-weight: 700;
}

.sap-logout-form button,
.btn.primary,
.module-cta.primary,
.topbar .btn.primary {
    background: var(--ag-maroon);
    border-color: var(--ag-maroon);
    color: #fff;
}

.btn.gold {
    background: #fff8df;
    border-color: #ead18a;
    color: #6b3b00;
}

.btn.action-icon-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    position: relative;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-icon {
    line-height: 1;
    font-size: 14px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sap-panel,
.panel,
.login-panel,
.panel-card,
.panel-header + p,
.panel p {
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    background: var(--ag-panel);
    box-shadow: var(--ag-shadow);
    padding: 16px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
}

.panel.flat,
.panel-card {
    box-shadow: none;
}

.panel h2,
.panel h3,
.panel-header h2 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
}

.panel h2 {
    line-height: 1.25;
}

.sap-panel p,
.sap-meta,
.panel p,
.topbar .btn + .btn {
    color: var(--ag-muted);
    line-height: 1.55;
    margin: 8px 0 0;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-summary {
    border-left: 4px solid var(--ag-maroon);
    box-shadow: var(--ag-shadow);
}

.dashboard-summary p {
    margin: 6px 0 0;
    color: var(--ag-muted);
    line-height: 1.55;
}

.dashboard-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-chart-card {
    margin: 0;
}

.dashboard-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-report-card {
    display: grid;
    gap: 5px;
    border: 1px solid var(--ag-border);
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
    color: #1e293b;
    min-height: 68px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.dashboard-report-card:hover {
    border-color: var(--ag-maroon);
    transform: translateY(-1px);
}

.dashboard-report-card-title {
    font-size: 13px;
    font-weight: 700;
}

.dashboard-report-card-note {
    font-size: 12px;
    color: var(--ag-muted);
    line-height: 1.4;
}

.mini-chart-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
    min-height: 176px;
}

.mini-chart-item {
    display: grid;
    align-items: end;
    justify-items: center;
    gap: 7px;
}

.mini-chart-track {
    position: relative;
    width: 100%;
    height: 130px;
    border-radius: 10px;
    border: 1px solid var(--ag-border);
    background: #f8fafc;
    padding: 26px 6px 5px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.mini-chart-fill {
    width: 100%;
    border-radius: 6px 6px 4px 4px;
    background: linear-gradient(180deg, var(--ag-scarlet), var(--ag-maroon));
    min-height: 10px;
    transition: height 0.2s ease;
}

.mini-chart-label {
    font-size: 11px;
    color: var(--ag-muted);
    white-space: nowrap;
}

.mini-chart-value {
    position: absolute;
    top: 6px;
    left: 5px;
    right: 5px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    text-align: center;
    line-height: 1.1;
}

.mini-bars-dashboard .bar-row strong {
    font-size: 12px;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
    gap: 14px;
}

.sap-panel.stat,
.panel.stat {
    min-height: 64px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
 
.sap-panel.stat small,
.stat small {
    color: var(--ag-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
}
 
.sap-panel.stat strong,
.stat strong {
    display: block;
    font-size: 20px;
    margin-top: 2px;
}
 
.sap-panel.stat .trend,
.stat .trend {
    color: var(--ag-green);
    font-size: 12px;
    font-weight: 800;
    margin-top: 0;
    text-align: right;
}

.sap-panel.stat .trend.warn,
.stat .trend.warn {
    color: var(--ag-amber);
}

.sap-panel.stat .trend.danger,
.stat .trend.danger {
    color: var(--ag-red);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 800;
    background: #e2e8f0;
    color: #334155;
    white-space: nowrap;
}

.badge.green { background: #ccfbf1; color: #115e59; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.blue { background: #dbeafe; color: #1e40af; }
.badge.amber { background: #fef3c7; color: #7c2d12; }
.badge.gray { background: #f1f5f9; color: #475569; }

.demo-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    color: #7c2d12;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.field-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.setting-form {
    display: grid;
    gap: 12px;
}

.setting-form label {
    display: grid;
    gap: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.setting-form input,
.setting-form select {
    width: 100%;
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    background: #fff;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
}

.b2c-directory-filters,
.module-list-filters,
.b2c-profile-panel .panel-header + p {
    margin-bottom: 10px;
}

.module-list-filters {
    padding: 12px;
    border-color: rgba(141, 15, 0, 0.14);
    background: linear-gradient(135deg, #ffffff 0%, #fff8e7 100%);
}

.module-list-filters-grid {
    grid-template-columns: minmax(240px, 1.4fr) repeat(5, minmax(135px, 1fr)) auto;
    align-items: end;
}

.module-list-filters-grid--advanced {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(141, 15, 0, 0.12);
}

.module-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    justify-content: flex-end;
}

.module-filter-actions .btn {
    min-height: 38px;
    white-space: nowrap;
}

.module-filter-submit {
    min-width: 86px;
}

.module-filter-toggle {
    background: #fff;
}

.module-filter-clear {
    color: #8d0f00;
}

.module-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.module-filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(141, 15, 0, 0.09);
    color: #7a1207;
    font-size: 12px;
    font-weight: 800;
}

.module-filter-chips[hidden] {
    display: none;
}

@media (max-width: 1180px) {
    .module-list-filters-grid,
    .module-list-filters-grid--advanced {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .module-list-filters-grid,
    .module-list-filters-grid--advanced {
        grid-template-columns: 1fr;
    }

    .module-filter-actions {
        flex-wrap: wrap;
    }
}

.b2c-filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.b2c-filter-item {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.b2c-filter-item input,
.b2c-filter-item select {
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    min-height: 38px;
    padding: 8px 10px;
    background: #fff;
    color: #1e293b;
    width: 100%;
}

.b2c-setting-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.b2c-setting-grid span {
    display: grid;
    gap: 6px;
}

.b2c-setting-grid strong {
    display: block;
    font-size: 12px;
    color: #334155;
}

.b2c-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.b2c-profile-grid p {
    margin: 0;
}

.b2c-profile-grid strong {
    color: #334155;
}

.fake-input,
.fake-select {
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    background: #fff;
    color: #475569;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 13px;
    min-width: 150px;
}

.sap-table-widget {
    display: grid;
    gap: 10px;
}

.sap-table-toolbar,
.sap-table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sap-table-count,
.sap-table-range,
.sap-table-page-info {
    color: var(--ag-muted);
    font-size: 12px;
    font-weight: 800;
}

.sap-table-page-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.sap-table-page-size select {
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    min-height: 34px;
    padding: 6px 28px 6px 10px;
    background: #fff;
    color: #1e293b;
    font-weight: 800;
}

.sap-table-scroll {
    overflow: auto;
}

.sap-table-pager-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sap-table-pager-actions .btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--ag-border);
    padding: 11px 10px;
    vertical-align: top;
    font-size: 13px;
}

th {
    color: var(--ag-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: var(--ag-soft);
}

tr:last-child td { border-bottom: 0; }

.serial-col {
    width: 52px;
    min-width: 52px;
    text-align: center;
    color: #475569;
    font-weight: 800;
}

tr.table-row-selected td {
    background: #fdf2f8;
}

.name-cell strong { display: block; color: #1e293b; }
.name-cell span { display: block; color: var(--ag-muted); margin-top: 3px; font-size: 12px; }

.timeline {
    display: grid;
    gap: 10px;
}

.event {
    border-left: 3px solid var(--ag-maroon);
    padding: 3px 0 3px 10px;
}

.event strong { display: block; }

.event span { color: var(--ag-muted); font-size: 12px; }

.mini-bars {
    display: grid;
    gap: 10px;
}

.bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 54px;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.bar-track {
    height: 9px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ag-maroon);
}

.mock-chart {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 6px;
    align-items: end;
    height: 150px;
    border-bottom: 1px solid var(--ag-border);
    padding-top: 12px;
}

.mock-chart span {
    display: block;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--ag-scarlet), var(--ag-maroon));
    min-height: 18px;
}

.workflow {
    display: grid;
    gap: 10px;
}

.step {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    padding: 10px;
}

.step-num {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #fff4ec;
    color: var(--ag-maroon);
    font-weight: 800;
}

.step strong { display: block; }

.step span { color: var(--ag-muted); font-size: 12px; line-height: 1.45; }

.note-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.note-list li {
    border: 1px solid var(--ag-border);
    border-radius: 7px;
    padding: 9px;
    color: #334155;
    font-size: 13px;
    line-height: 1.45;
}

.risk-grid {
    display: grid;
    gap: 10px;
}

.risk {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    padding: 10px;
}

.footer-note,
.sap-meta {
    color: var(--ag-muted);
    font-size: 12px;
    margin-top: 16px;
}

.hero-copy p {
    margin-bottom: 0;
}

.top-actions .sap-pill strong {
    color: var(--ag-maroon);
}

.sap-sidebar.mobile-open {
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.sap-sidebar-toggle,
.menu-trigger,
.sidebar-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sap-shell.sidebar-compact {
    grid-template-columns: 82px minmax(0, 1fr);
}

.sap-shell.sidebar-compact .sap-sidebar {
    width: 82px;
    padding: 14px 8px;
    overflow-x: hidden;
}

.sap-shell.sidebar-compact .sap-brand {
    grid-template-columns: 40px;
    justify-items: center;
    gap: 0;
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 8px;
}

.sap-shell.sidebar-compact .sap-brand span {
    display: none;
}

.sap-shell.sidebar-compact .sap-sidebar-search,
.sap-shell.sidebar-compact .sap-quick-links,
.sap-shell.sidebar-compact .sap-group-label,
.sap-shell.sidebar-compact .sap-menu-item-label {
    display: none;
}

.sap-shell.sidebar-compact .sap-menu-summary-main {
    justify-items: center;
    grid-template-columns: 1fr;
}

.sap-shell.sidebar-compact .sap-menu-group-icon {
    margin: 0 auto;
}

.sap-shell.sidebar-compact .sap-menu-summary {
    padding: 10px 8px;
    grid-template-columns: minmax(0, 1fr);
    justify-content: center;
}

.sap-shell.sidebar-compact .sap-menu-summary::after {
    display: none;
}

.sap-shell.sidebar-compact .sap-menu-item {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

.sap-shell.sidebar-compact .sap-menu-item-icon {
    width: 24px;
    font-size: 14px;
}

.sap-shell.sidebar-compact .sap-admin-box {
    justify-content: flex-end;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px 16px;
    background: linear-gradient(180deg, #fff8e7 0%, #f8fafc 100%);
}

.login-panel {
    width: 100%;
    max-width: 420px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.login-brand h1 { color: var(--ag-maroon); margin: 0; }

.login-brand p { margin: 2px 0 0; }

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    min-height: 42px;
    padding: 8px 10px;
}

.sap-alert {
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff1f2;
    color: #991b1b;
    margin-bottom: 14px;
    padding: 10px 12px;
}

@media (max-width: 1180px) {
    .grid.cols-4,
    .grid.cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-charts,
    .dashboard-report-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .b2c-filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .preview-shell,
    .sap-shell {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .sap-sidebar {
        position: static;
        height: auto;
        max-height: 56vh;
        border-right: 0;
        border-bottom: 1px solid var(--ag-border);
    }

    .split,
    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 1fr;
    }

    .dashboard-charts,
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .b2c-filters-grid,
    .b2c-setting-grid,
    .b2c-profile-grid {
        grid-template-columns: 1fr;
    }

    .mini-chart-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: auto;
    }

    .mini-chart-track {
        height: 118px;
    }

    .sap-sidebar-toggle {
        display: inline-flex;
    }

    .sap-logout-form button,
    .top-actions .btn,
    .top-actions .btn.primary {
        width: 100%;
    }

    .sap-sidebar.mobile {
        position: fixed;
        width: min(320px, calc(100vw - 24px));
        left: 12px;
        top: 12px;
        bottom: 12px;
        border-radius: 12px;
        max-height: none;
        z-index: 4;
        transition: transform 0.2s ease;
        transform: translateX(-120%);
    }

    .sap-sidebar.mobile.mobile-open {
        transform: translateX(0);
    }
}

@media (max-width: 680px) {
    .topbar,
    .sap-header,
    .toolbar,
    .field-row {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .top-actions {
        justify-content: flex-start;
    }

    .mini-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-chart-track {
        height: 110px;
    }
}

.sap-sidebar-toggle {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid var(--ag-border);
    background: #fff;
    color: #334155;
}

.sap-sidebar-toggle[aria-pressed='true'] {
    border-color: var(--ag-maroon);
    background: #fff1ec;
    color: var(--ag-maroon);
}

.menu-overlay {
    display: none;
}

.menu-overlay.visible {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 2;
}




