/**
 * Step1 Diet Admin — Bootstrap 5
 * اللون الأساسي: #FF4800
 */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

.sar-symbol {
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    vertical-align: -0.12em;
    object-fit: contain;
}

.sar-money {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    white-space: nowrap;
}

:root {
    --s1-primary: #ff4800;
    --s1-primary-rgb: 255, 72, 0;
    --s1-primary-dark: #e04000;
    --s1-primary-light: #fff4ee;
    --s1-sidebar-w: 268px;
    --s1-topbar-h: 72px;
    --s1-bg: #f4f6f9;
    --s1-surface: #ffffff;
    --s1-border: #e8ecf1;
    --s1-text: #1a2332;
    --s1-muted: #6b7a90;
    --bs-primary: var(--s1-primary);
    --bs-primary-rgb: var(--s1-primary-rgb);
    --bs-link-color: var(--s1-primary);
    --bs-link-hover-color: var(--s1-primary-dark);
    --bs-border-radius: 0.625rem;
    --bs-border-radius-lg: 0.875rem;
    --bs-body-font-family: 'Cairo', system-ui, sans-serif;
}

body.admin-app {
    font-family: var(--bs-body-font-family);
    background: var(--s1-bg);
    color: var(--s1-text);
    min-height: 100vh;
}

/* Bootstrap overrides */
.btn-primary {
    --bs-btn-bg: var(--s1-primary);
    --bs-btn-border-color: var(--s1-primary);
    --bs-btn-hover-bg: var(--s1-primary-dark);
    --bs-btn-hover-border-color: var(--s1-primary-dark);
    --bs-btn-active-bg: var(--s1-primary-dark);
    --bs-btn-active-border-color: var(--s1-primary-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--s1-primary);
    --bs-btn-border-color: var(--s1-primary);
    --bs-btn-hover-bg: var(--s1-primary);
    --bs-btn-hover-border-color: var(--s1-primary);
}

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

.form-control:focus,
.form-select:focus {
    border-color: var(--s1-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--s1-primary-rgb), 0.15);
}

.nav-pills .nav-link.active {
    background-color: var(--s1-primary);
}

.badge.bg-primary {
    background-color: var(--s1-primary) !important;
}

.text-primary {
    color: var(--s1-primary) !important;
}

.bg-primary-subtle {
    background-color: var(--s1-primary-light) !important;
}

/* Shell */
.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--s1-sidebar-w);
    background: var(--s1-surface);
    border-left: 1px solid var(--s1-border);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease;
}

.admin-sidebar-brand {
    height: var(--s1-topbar-h);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--s1-border);
    gap: 0.65rem;
    text-decoration: none;
    color: var(--s1-text);
}

.admin-sidebar-brand .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--s1-primary), #ff7a45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.admin-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--s1-text);
    flex-shrink: 0;
}

.admin-brand-logo img {
    width: auto;
    height: var(--admin-logo-size, 32px);
    max-height: var(--admin-logo-size, 32px);
    max-width: var(--admin-logo-size, 32px);
    object-fit: contain;
    flex-shrink: 0;
}

.admin-brand-logo--sm { --admin-logo-size: 24px; }
.admin-brand-logo--md { --admin-logo-size: 32px; }
.admin-brand-logo--lg { --admin-logo-size: 36px; }
.admin-brand-logo--xl { --admin-logo-size: 42px; }

.admin-brand-logo--stacked {
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
}

.admin-brand-logo-text {
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.2;
    white-space: nowrap;
}

.admin-brand-logo--sm .admin-brand-logo-text { font-size: 0.8rem; }
.admin-brand-logo--lg .admin-brand-logo-text { font-size: 0.95rem; }
.admin-brand-logo--xl .admin-brand-logo-text { font-size: 1.05rem; }

.admin-brand-logo-accent {
    color: var(--s1-primary);
}

.admin-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-sidebar-brand-text .brand-name {
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.2;
}

.admin-sidebar-brand small {
    display: block;
    color: var(--s1-muted);
    font-size: 0.7rem;
    font-weight: 500;
}

.admin-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem 1rem;
    min-height: 0;
}

/* ——— Sidebar nav groups ——— */
.admin-nav-group {
    margin-bottom: 0.15rem;
}

.admin-nav-group__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    margin-top: 0.35rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--s1-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.admin-nav-group__toggle:hover {
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

.admin-nav-group.is-active-group > .admin-nav-group__toggle {
    color: var(--s1-primary);
    background: rgba(var(--s1-primary-rgb), 0.08);
}

.admin-nav-group__chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    opacity: 0.75;
}

.admin-nav-group.is-open .admin-nav-group__chevron {
    transform: rotate(180deg);
}

.admin-nav-group__panel {
    display: none;
    padding-bottom: 0.15rem;
}

.admin-nav-group.is-open .admin-nav-group__panel {
    display: block;
}

/* ——— Nested sidebar subgroups (inside المتجر) ——— */
.admin-nav-subgroup {
    margin: 0.15rem 0 0.35rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.admin-nav-subgroup__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 700;
    color: #4a5568;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.admin-nav-subgroup__toggle:hover {
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

.admin-nav-subgroup.is-active-subgroup > .admin-nav-subgroup__toggle {
    color: var(--s1-primary);
}

.admin-nav-subgroup__icon {
    font-size: 0.95rem;
    opacity: 0.85;
    flex-shrink: 0;
}

.admin-nav-subgroup__chevron {
    margin-inline-start: auto;
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.admin-nav-subgroup.is-open .admin-nav-subgroup__chevron {
    transform: rotate(180deg);
}

.admin-nav-subgroup__panel {
    display: none;
    padding: 0 0.35rem 0.35rem;
}

.admin-nav-subgroup.is-open .admin-nav-subgroup__panel {
    display: block;
}

.admin-nav-subgroup .nav-link {
    font-size: 0.84rem;
    padding: 0.45rem 0.65rem 0.45rem 0.75rem;
    margin-bottom: 1px;
}

.admin-nav-subgroup .nav-link i {
    font-size: 1rem;
    width: 1.15rem;
}

.admin-sidebar-nav .nav-section {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--s1-muted);
    padding: 0.75rem 0.75rem 0.35rem;
    margin-top: 0.25rem;
}

.admin-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.5rem;
    color: #3d4f66;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
}

.admin-sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.35rem;
    text-align: center;
    opacity: 0.85;
}

.admin-sidebar-nav .nav-link:hover {
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

.admin-sidebar-nav .nav-link.active {
    background: var(--s1-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(var(--s1-primary-rgb), 0.35);
}

.admin-sidebar-nav .nav-link--sub {
    padding-inline-start: 1.35rem;
    font-size: 0.92rem;
}

.admin-sidebar-nav .nav-link-hint {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.65;
    margin-top: 0.1rem;
}

.admin-sidebar-nav .nav-section--sub {
    margin-top: 0.25rem;
    font-size: 0.7rem;
}

.admin-sidebar-nav .nav-link.active i {
    opacity: 1;
}

.admin-main {
    flex: 1;
    margin-right: var(--s1-sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    min-height: var(--s1-topbar-h);
    background: var(--s1-surface);
    border-bottom: 1px solid var(--s1-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.admin-topbar-start,
.admin-topbar-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.admin-topbar-start {
    flex: 1;
}

.admin-topbar-title-block {
    min-width: 0;
}

.admin-topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    margin-bottom: 0.15rem;
    flex-wrap: wrap;
}

.admin-topbar-breadcrumb a {
    color: var(--s1-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s;
}

.admin-topbar-breadcrumb a:hover {
    color: var(--s1-primary);
}

.admin-topbar-breadcrumb .breadcrumb-sep {
    font-size: 0.6rem;
    color: #cbd5e1;
}

.admin-topbar-breadcrumb .breadcrumb-current {
    color: var(--s1-primary);
    font-weight: 600;
}

.admin-topbar-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    color: var(--s1-text);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-topbar-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--s1-bg);
    border: 1px solid var(--s1-border);
    border-radius: 12px;
    padding: 0.35rem 0.5rem;
}

.admin-topbar-toolbar-slot {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0.35rem;
    border-left: 1px solid var(--s1-border);
}

.admin-topbar-toolbar-slot:empty {
    display: none;
}

.admin-topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 38px;
    padding: 0 0.85rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.admin-topbar-btn:hover {
    background: var(--s1-surface);
    color: var(--s1-primary);
}

.admin-topbar-btn-icon {
    width: 38px;
    padding: 0;
    flex-shrink: 0;
    display: none;
    background: var(--s1-surface);
    border: 1px solid var(--s1-border);
}

.admin-topbar-btn-icon i {
    font-size: 1.25rem;
}

.admin-topbar-btn-label {
    display: none;
}

@media (min-width: 576px) {
    .admin-topbar-btn-label {
        display: inline;
    }
}

.admin-topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--s1-border);
    margin: 0 0.15rem;
}

/* User menu */
.admin-user-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    height: 38px;
    padding: 0.25rem 0.5rem 0.25rem 0.35rem;
    border: 0;
    border-radius: 10px;
    background: var(--s1-surface);
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.admin-user-btn:hover,
.admin-user-dropdown.show .admin-user-btn {
    box-shadow: 0 0 0 2px var(--s1-primary-light);
}

.admin-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.admin-user-avatar.lg {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

.admin-user-meta {
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
    line-height: 1.2;
    max-width: 140px;
}

.admin-user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--s1-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.admin-user-role {
    font-size: 0.68rem;
    color: var(--s1-muted);
    font-weight: 600;
}

.admin-user-chevron {
    font-size: 0.7rem;
    color: var(--s1-muted);
    margin-right: 0.15rem;
}

.admin-user-menu {
    min-width: 240px;
    border-radius: 12px !important;
    padding: 0.5rem;
    margin-top: 0.5rem !important;
}

.admin-user-menu .dropdown-header {
    padding: 0.65rem 0.75rem;
}

.admin-user-menu-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-user-menu-head strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.admin-user-menu .dropdown-item {
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
}

.admin-user-menu .dropdown-item:hover {
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

.admin-content {
    padding: 1.5rem;
    flex: 1;
}

/* Page toolbar (تحت الهيدر — وصف وأزرار فقط) */
.admin-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1.15rem;
    background: var(--s1-surface);
    border: 1px solid var(--s1-border);
    border-radius: var(--bs-border-radius-lg);
}

.admin-page-toolbar-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.admin-page-toolbar-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--s1-primary-light);
    color: var(--s1-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.admin-page-toolbar-subtitle {
    color: var(--s1-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.admin-page-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* Cards — alias للصفحات القديمة */
.table-card,
.admin-card {
    background: var(--s1-surface);
    border: 1px solid var(--s1-border);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--s1-border);
    font-weight: 700;
    padding: 1rem 1.25rem;
}

.stat-card {
    border: 0 !important;
    border-radius: var(--bs-border-radius-lg) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card.primary .stat-icon { background: var(--s1-primary-light); color: var(--s1-primary); }
.stat-card.success .stat-icon { background: #e8f8ef; color: #1cc88a; }
.stat-card.warning .stat-icon { background: #fff8e6; color: #f6c23e; }
.stat-card.info .stat-icon { background: #e8f4fd; color: #36b9cc; }

.page-title {
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 0;
}

/* Permissions grid */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.perm-item {
    background: var(--s1-bg);
    border: 1px solid var(--s1-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.perm-item .form-check-label {
    font-size: 0.85rem;
    font-weight: 500;
}

.role-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
}

.role-pill.super_admin { background: #1a2332; color: #fff; }
.role-pill.admin { background: var(--s1-primary-light); color: var(--s1-primary); }
.role-pill.moderator { background: #e8f4fd; color: #2563eb; }
.role-pill.viewer { background: #f1f3f5; color: #495057; }

/* Permissions studio */
.perm-studio-presets .card-body { padding: 1rem; }

.perm-preset-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    border: 1px solid var(--s1-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    background: #fff;
    text-align: start;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.perm-preset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: var(--s1-primary);
}

.perm-preset-btn strong { display: block; font-size: 0.9rem; }
.perm-preset-btn small { color: #64748b; font-size: 0.75rem; }

.perm-preset-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.perm-preset-btn.super_admin .perm-preset-icon { background: #1e293b; color: #fff; }
.perm-preset-btn.admin .perm-preset-icon { background: var(--s1-primary-light); color: var(--s1-primary); }
.perm-preset-btn.moderator .perm-preset-icon { background: #dbeafe; color: #2563eb; }
.perm-preset-btn.viewer .perm-preset-icon { background: #f1f5f9; color: #64748b; }

.perm-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--s1-border);
}

.perm-summary-row:last-child { border-bottom: 0; }
.perm-summary-label { color: #64748b; font-size: 0.8rem; }

.perm-studio-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.perm-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.perm-action-chip { margin: 0; cursor: pointer; }
.perm-action-chip input { position: absolute; opacity: 0; pointer-events: none; }

.perm-action-chip-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--s1-border);
    background: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.perm-action-chip input:checked + .perm-action-chip-inner {
    color: #fff;
    border-color: transparent;
}

.perm-action-view input:checked + .perm-action-chip-inner { background: #6366f1; }
.perm-action-add input:checked + .perm-action-chip-inner { background: #22c55e; }
.perm-action-edit input:checked + .perm-action-chip-inner { background: #0ea5e9; }
.perm-action-delete input:checked + .perm-action-chip-inner { background: #ef4444; }
.perm-action-control_panel input:checked + .perm-action-chip-inner { background: #1e293b; }

.perm-groups-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--s1-border);
    background: #fafbfc;
}

.perm-groups { display: flex; flex-direction: column; }

.perm-group {
    border-bottom: 1px solid var(--s1-border);
}

.perm-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(90deg, color-mix(in srgb, var(--perm-accent) 8%, #fff), #fff);
}

.perm-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.perm-group-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--perm-accent) 15%, #fff);
    color: var(--perm-accent);
}

.perm-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    margin: 0;
}

.perm-group-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.65rem;
    padding: 0.85rem 1rem 1rem;
}

.perm-module-card { margin: 0; cursor: pointer; }
.perm-module-card input { position: absolute; opacity: 0; pointer-events: none; }

.perm-module-card-inner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 3rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--s1-border);
    border-radius: 12px;
    background: #fff;
    transition: all 0.15s ease;
}

.perm-module-check {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 6px;
    border: 1.5px solid #cbd5e1;
    display: grid;
    place-items: center;
    color: transparent;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.perm-module-label { font-size: 0.82rem; font-weight: 600; line-height: 1.3; }

.perm-module-card input:checked + .perm-module-card-inner {
    border-color: var(--perm-accent);
    background: color-mix(in srgb, var(--perm-accent) 6%, #fff);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--perm-accent) 18%, transparent);
}

.perm-module-card input:checked + .perm-module-card-inner .perm-module-check {
    background: var(--perm-accent);
    border-color: var(--perm-accent);
    color: #fff;
}

@media (max-width: 767px) {
    .perm-studio-header { flex-direction: column; align-items: stretch; }
    .perm-groups-toolbar { flex-direction: column; align-items: stretch; }
}

/* Alerts */
.alert-step1 {
    border: 0;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-step1-success {
    background: #d4edda;
    color: #155724;
    border-right: 4px solid #28a745;
}

.alert-step1-danger {
    background: #f8d7da;
    color: #721c24;
    border-right: 4px solid #dc3545;
}

.badge-status-active { background: #d4edda; color: #155724; }
.badge-status-pending_payment { background: #fff3cd; color: #856404; }
.badge-status-cancelled { background: #f8d7da; color: #721c24; }
.badge-status-completed { background: #cce5ff; color: #004085; }
.badge-status-draft { background: #e2e3e5; color: #383d41; }
.badge-status-expired { background: #e2e3e5; color: #383d41; }

/* Login */
body.admin-login-page {
    min-height: 100vh;
    background: linear-gradient(145deg, #fff8f4 0%, var(--s1-bg) 50%, #fff 100%);
}

.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.admin-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--s1-surface);
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--s1-border);
}

.admin-login-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--s1-primary), #ff7a45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
}

/* Overlay mobile */
.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(100%);
    }

    body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .admin-sidebar-backdrop {
        display: block;
    }

    .admin-main {
        margin-right: 0;
    }

    .admin-topbar-btn-icon {
        display: inline-flex;
    }

    .admin-topbar-title {
        font-size: 1rem;
    }

    .admin-topbar-breadcrumb {
        display: none;
    }
}

.admin-breadcrumb .breadcrumb {
    font-size: 0.8rem;
}

/* ——— Tables (Bootstrap 5) ——— */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--s1-border, #e2e8f0);
    border-radius: 12px;
    background: #fff;
}

.admin-table {
    margin-bottom: 0;
    font-size: 0.9rem;
    --bs-table-border-color: #e8ecef;
}

.admin-table thead th {
    background: #f1f5f9;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: #475569;
    border-bottom: 2px solid #dee2e6;
    padding: 0.85rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
}

.admin-table.table-bordered > :not(caption) > * > * {
    border-color: #e8ecef;
}

.admin-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.admin-table.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: #fafbfc;
}

.admin-table tbody tr:hover > * {
    --bs-table-hover-bg: #fff8f5;
}

.admin-table .cell-sub {
    font-size: 0.78rem;
    color: var(--s1-muted);
}

.admin-table .cell-actions {
    white-space: nowrap;
}

/* ——— Design cards grid ——— */
.pkg-design-filter-card {
    border: 1px solid var(--s1-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.pkg-design-filter-group .input-group-text {
    background: var(--s1-bg);
    border-color: var(--s1-border);
    color: var(--s1-primary);
}

.pkg-design-filter-select {
    font-weight: 600;
    border-color: var(--s1-border);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    cursor: pointer;
}

.pkg-design-filter-select:focus {
    border-color: rgba(var(--s1-primary-rgb), 0.45);
    box-shadow: 0 0 0 0.2rem rgba(var(--s1-primary-rgb), 0.12);
}

.pkg-design-filter-active {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.85rem;
    background: var(--s1-bg);
    border: 1px solid var(--s1-border);
    border-radius: 12px;
}

.pkg-design-filter-active__img,
.pkg-design-filter-active__placeholder {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}

.pkg-design-filter-active__img {
    object-fit: cover;
}

.pkg-design-filter-active__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

.design-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.design-package-strip {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--s1-bg);
    border: 1px solid var(--s1-border);
    border-radius: var(--bs-border-radius-lg);
    margin-top: 0.5rem;
}

.design-package-strip:first-child {
    margin-top: 0;
}

.design-package-strip__img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.design-package-strip__placeholder {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--s1-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--s1-primary);
    flex-shrink: 0;
}

.design-package-strip__name {
    font-size: 1rem;
}

.design-card-thumb {
    position: relative;
}

.design-card-thumb__badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.design-card {
    background: var(--s1-surface);
    border: 1px solid var(--s1-border);
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.design-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.design-card-thumb {
    height: 140px;
    background: linear-gradient(135deg, var(--s1-primary-light), #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.design-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.design-card-thumb .placeholder-icon {
    font-size: 2.5rem;
    color: var(--s1-primary);
    opacity: 0.35;
}

.design-card-body {
    padding: 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.design-card-package {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--s1-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.design-card-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--s1-text);
    line-height: 1.2;
}

.design-card-price small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--s1-muted);
}

.design-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.65rem 0;
}

.design-card-meta .tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    background: var(--s1-bg);
    border-radius: 50px;
    color: #475569;
    font-weight: 600;
}

.design-card-footer {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--s1-border);
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
}

/* ——— Package cards ——— */
.pkg-admin-card {
    border: 1px solid var(--s1-border) !important;
    border-radius: var(--bs-border-radius-lg) !important;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.pkg-admin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08) !important;
}

.pkg-admin-card .pkg-order {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--s1-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--s1-muted);
}

/* ——— Form panel ——— */
.admin-form-panel .card-header {
    background: var(--s1-bg);
    padding: 0.85rem 1.15rem;
}

.admin-form-panel .card-header h6 {
    font-weight: 700;
}

/* ——— Filters bar ——— */
.admin-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--s1-bg);
    border-bottom: 1px solid var(--s1-border);
}

.admin-filter-bar .btn {
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ——— Status badges ——— */
.admin-status-badge {
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35em 0.75em;
    border-radius: 50px;
}

/* ——— Pagination ——— */
.admin-pagination {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--s1-border);
}

.admin-pagination .pagination,
.admin-pagination-nav .pagination {
    margin-bottom: 0;
    justify-content: center;
    --bs-pagination-padding-y: 0.3rem;
    --bs-pagination-padding-x: 0.55rem;
    --bs-pagination-font-size: 0.8125rem;
    --bs-pagination-border-radius: 0.4rem;
}

.admin-pagination .page-link,
.admin-pagination-nav .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    line-height: 1;
}

.admin-pagination .page-link .bi,
.admin-pagination-nav .page-link .bi {
    font-size: 0.85rem;
    line-height: 1;
}

.admin-pagination .page-item:first-child .page-link,
.admin-pagination .page-item:last-child .page-link,
.admin-pagination-nav .page-item:first-child .page-link,
.admin-pagination-nav .page-item:last-child .page-link {
    min-width: 2.1rem;
    padding-inline: 0.45rem;
}

/* ——— KPI cards (dashboard) ——— */
.admin-kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    background: var(--s1-surface);
    border: 1px solid var(--s1-border);
    border-radius: var(--bs-border-radius-lg);
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.admin-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(var(--s1-primary-rgb), 0.35);
    color: inherit;
}

.admin-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

.admin-kpi-primary .admin-kpi-icon { background: var(--s1-primary-light); color: var(--s1-primary); }
.admin-kpi-success .admin-kpi-icon { background: #e8f8ef; color: #1cc88a; }
.admin-kpi-info .admin-kpi-icon { background: #e8f4fd; color: #36b9cc; }
.admin-kpi-warning .admin-kpi-icon { background: #fff8e6; color: #f6c23e; }
.admin-kpi-muted .admin-kpi-icon { background: #f1f3f5; color: #6c757d; }

.admin-kpi-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--s1-muted);
    margin-bottom: 0.2rem;
}

.admin-kpi-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--s1-text);
    line-height: 1.2;
    word-break: break-word;
}

/* ——— Dashboard ——— */
.admin-dashboard .row {
    --bs-gutter-y: 1.25rem;
}

.admin-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.admin-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.75rem;
    background: var(--s1-surface);
    border: 1px solid var(--s1-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--s1-text);
    transition: all 0.2s;
}

.admin-quick-link:hover {
    border-color: var(--s1-primary);
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

.admin-quick-link i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--s1-primary);
}

.admin-quick-link span {
    font-size: 0.8rem;
    font-weight: 700;
}

/* ——— Modal ——— */
.modal-content {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
}

.modal-header {
    background: var(--s1-bg);
    border-bottom: 1px solid var(--s1-border);
}

.modal-footer {
    background: var(--s1-bg);
    border-top: 1px solid var(--s1-border);
}

/* ——— Empty state ——— */
.admin-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--s1-muted);
}

.admin-empty i {
    font-size: 3rem;
    opacity: 0.25;
    display: block;
    margin-bottom: 1rem;
}

/* ——— Sidebar footer ——— */
.admin-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--s1-border);
    margin-top: auto;
}

.admin-sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    color: var(--s1-muted);
    text-decoration: none;
    border-radius: 8px;
}

.admin-sidebar-footer a:hover {
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

/* ——— Content max width on xl ——— */
@media (min-width: 1400px) {
    .admin-content-inner {
        max-width: 1320px;
        margin: 0 auto;
    }
}

/* ——— Package hub & menu planner ——— */
.pkg-hub-card {
    border: 0;
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pkg-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--s1-primary-rgb), 0.12);
}

.pkg-hub-card-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: var(--s1-primary-light);
}

.pkg-hub-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--s1-muted);
}

.pkg-hub-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pkg-hub-tabs .nav-link {
    border-radius: 999px;
    padding: 0.5rem 1rem;
    color: var(--s1-muted);
    font-weight: 600;
}

.pkg-hub-tabs .nav-link.active {
    background: var(--s1-primary);
    color: #fff;
}

.pkg-thumb {
    max-height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.admin-catalog-filter {
    padding-bottom: 0.25rem;
}

.admin-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    max-width: 540px;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid var(--s1-border);
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.admin-mode-tabs__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #64748b;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.admin-mode-tabs__btn:not(.is-active) {
    background: #fff;
    border-color: #e8ecef;
}

.admin-mode-tabs__btn.is-active {
    background: linear-gradient(135deg, var(--s1-primary), var(--s1-primary-dark));
    color: #fff;
    box-shadow: 0 8px 22px rgba(255, 72, 0, 0.28);
}

.admin-mode-tabs__btn.is-active i {
    color: #fff;
}

.admin-mode-tabs__count {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.admin-mode-tabs__btn:not(.is-active) .admin-mode-tabs__count {
    background: #f1f5f9;
    color: #475569;
}

.admin-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.admin-status-tabs__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--s1-border);
    border-radius: 999px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.admin-status-tabs__btn.is-active {
    background: var(--s1-primary-light);
    border-color: rgba(var(--s1-primary-rgb), 0.35);
    color: var(--s1-primary-dark);
}

.admin-table-wrap--elevated {
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.admin-table--catalog thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #eef2f7;
}

.pkg-table-desc {
    max-width: 280px;
}

.pkg-table-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pkg-table-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e8ecef;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    cursor: help;
}

.pkg-table-stat--link {
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.pkg-table-stat--link:hover {
    background: var(--s1-primary-light);
    border-color: rgba(var(--s1-primary-rgb), 0.35);
    color: var(--s1-primary-dark);
    transform: translateY(-1px);
}

.pkg-table-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--s1-border);
    background: var(--s1-bg);
}

.pkg-table-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--s1-primary);
    opacity: 0.45;
    font-size: 1.25rem;
}

.pkg-table-row--hidden > * {
    opacity: 0.72;
}

.pkg-table-row--hidden:hover > * {
    opacity: 1;
}

.pgw-table-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--s1-primary-light);
    color: var(--s1-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pgw-settings-accordion .accordion-item {
    overflow: hidden;
}

.pgw-accordion-btn {
    font-size: 0.95rem;
    background: var(--s1-bg);
}

.pgw-accordion-btn:not(.collapsed) {
    background: #fff;
    color: var(--s1-text);
    box-shadow: inset 0 -1px 0 var(--s1-border);
}

.pgw-settings-accordion .accordion-body {
    background: #fff;
}

@media (max-width: 767.98px) {
    .admin-mode-tabs {
        max-width: none;
        grid-template-columns: 1fr;
        border-radius: 1rem;
    }

    .admin-mode-tabs__btn {
        justify-content: flex-start;
    }

    .pkg-table-desc {
        max-width: 180px;
    }
}

.checkbox-grid-scroll {
    max-height: 200px;
    overflow-y: auto;
}

.design-price-card {
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.design-price-card-img {
    height: 100px;
    background-size: cover;
    background-position: center;
    background-color: var(--s1-bg);
}

.menu-planner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    align-items: start;
}

.menu-day-column {
    background: var(--s1-surface);
    border: 1px solid var(--s1-border);
    border-radius: 12px;
    padding: 0.75rem;
    min-height: 200px;
}

.menu-day-column-head {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--s1-primary-light);
}

.menu-day-column-head h6 {
    font-weight: 700;
    color: var(--s1-primary);
    margin-bottom: 0.5rem;
}

.menu-day-toggle.active {
    background: var(--s1-primary);
    color: #fff;
    border-color: var(--s1-primary);
}

.meal-slot {
    background: var(--s1-bg);
}

.meal-slot__preview-img {
    display: block;
    width: 100%;
    max-width: 140px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
    background: #f1f5f9;
}

.discount-card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.discount-code-badge {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    color: var(--s1-primary);
    background: var(--s1-primary-light);
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.discount-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.discount-stats-grid span {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--s1-text);
}

.discount-stats-grid small {
    color: var(--s1-muted);
    font-size: 0.7rem;
}

.discount-location-preview {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.discount-location-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    background: var(--s1-bg);
    border: 1px solid var(--s1-border);
    font-size: 0.72rem;
    color: var(--s1-text);
}

.discount-location-chip strong {
    color: var(--s1-primary);
    margin-right: auto;
}

.discount-location-chip--branch {
    background: #f8f9fa;
}

.delivery-map-canvas {
    height: 520px;
    border-radius: 0 0 14px 14px;
    z-index: 1;
}

/* ── Delivery map page ── */
.dmap-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #1a2332 0%, #2d3a4f 55%, var(--s1-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(26, 35, 50, 0.25);
}

.dmap-hero-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dmap-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.dmap-hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
}

.dmap-hero-sub {
    font-size: 0.82rem;
    opacity: 0.85;
    max-width: 520px;
}

.dmap-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dmap-stat {
    background: #fff;
    border: 1px solid var(--s1-border);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dmap-stat span {
    display: block;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--s1-text);
    line-height: 1.1;
}

.dmap-stat small {
    font-size: 0.72rem;
    color: var(--s1-muted);
    font-weight: 600;
}

.dmap-stat--branch span { color: var(--s1-primary); }
.dmap-stat--delivery span { color: #2563eb; }
.dmap-stat--map span { color: #1cc88a; }
.dmap-stat--active span { color: #6f42c1; }

.dmap-city-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--s1-border);
    border-radius: 14px;
}

.dmap-city-bar-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--s1-muted);
    white-space: nowrap;
}

.dmap-city-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dmap-city-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--s1-border);
    background: var(--s1-bg);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--s1-text);
    text-decoration: none;
    transition: all 0.15s ease;
}

.dmap-city-pill em {
    font-style: normal;
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--s1-muted);
}

.dmap-city-pill:hover {
    border-color: rgba(var(--s1-primary-rgb), 0.35);
    color: var(--s1-primary);
}

.dmap-city-pill.is-active {
    background: var(--s1-primary);
    border-color: var(--s1-primary);
    color: #fff;
}

.dmap-city-pill.is-active em {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.dmap-panel {
    background: #fff;
    border: 1px solid var(--s1-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.dmap-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    background: var(--s1-bg);
    border-bottom: 1px solid var(--s1-border);
    font-size: 0.88rem;
}

.dmap-panel-head i {
    color: var(--s1-primary);
    margin-left: 0.25rem;
}

.dmap-legend {
    display: flex;
    gap: 0.85rem;
    font-size: 0.72rem;
    color: var(--s1-muted);
    font-weight: 600;
}

.dmap-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}

.dmap-dot--branch { background: var(--s1-primary); }
.dmap-dot--customer { background: #2563eb; }

.dmap-branch-list,
.dmap-order-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dmap-branch-card,
.dmap-order-card {
    width: 100%;
    border: 1px solid var(--s1-border);
    border-radius: 12px;
    background: #fff;
    padding: 0.75rem 0.85rem;
    text-align: right;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dmap-branch-card:hover,
.dmap-order-card:hover,
.dmap-branch-card.is-focused,
.dmap-order-card.is-focused {
    border-color: rgba(var(--s1-primary-rgb), 0.45);
    box-shadow: 0 4px 14px rgba(var(--s1-primary-rgb), 0.12);
}

.dmap-branch-card-top,
.dmap-order-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.dmap-branch-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--s1-primary);
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.dmap-branch-card-top {
    align-items: center;
    gap: 0.65rem;
}

.dmap-branch-name,
.dmap-order-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--s1-text);
}

.dmap-branch-city,
.dmap-order-package {
    font-size: 0.72rem;
    color: var(--s1-muted);
}

.dmap-branch-meta,
.dmap-order-meta,
.dmap-order-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.7rem;
    color: var(--s1-muted);
    font-weight: 600;
}

.dmap-order-fee {
    font-weight: 800;
    color: var(--s1-primary);
    font-size: 0.85rem;
    white-space: nowrap;
}

.dmap-order-foot {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--s1-border);
}

.dmap-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    border: 2px solid #fff;
}

.dmap-marker--branch {
    width: 32px;
    height: 32px;
    background: var(--s1-primary);
    font-size: 0.85rem;
}

.dmap-marker--customer {
    width: 28px;
    height: 28px;
    background: #2563eb;
    font-size: 0.75rem;
}

@media (max-width: 1199px) {
    .delivery-map-canvas { height: 420px; }
    .dmap-branch-list,
    .dmap-order-list { max-height: 240px; }
}

.pkg-visibility-bar {
    border-radius: 14px;
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
}

.pkg-visibility-bar--visible {
    background: linear-gradient(135deg, #e8f8ef 0%, #f0fdf4 100%);
    border-color: #b8e6c8;
    color: #1a5c32;
}

.pkg-visibility-bar--hidden {
    background: linear-gradient(135deg, #fff4ee 0%, #fef3e8 100%);
    border-color: #ffd4b8;
    color: #8a3d12;
}

.pkg-visibility-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    background: rgba(255, 255, 255, 0.65);
}

.design-price-card--hidden {
    opacity: 0.72;
    border: 2px dashed var(--s1-border);
}

.design-price-card--hidden .design-price-card-img {
    filter: grayscale(0.6);
}

.pkg-hub-card--hidden {
    opacity: 0.82;
    border: 2px dashed var(--s1-border);
}

/* ── Subscription detail page ── */
.sub-doc {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 1.75rem;
    padding: 1.35rem 1.5rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--s1-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.sub-doc::after {
    content: '';
    position: absolute;
    left: -20px;
    top: -20px;
    width: 72px;
    height: 72px;
    background: url('/images/logo.png') center / contain no-repeat;
    opacity: 0.04;
    pointer-events: none;
}

.sub-doc--active {
    border-color: rgba(28, 200, 138, 0.25);
    background: linear-gradient(135deg, #fff 60%, #f0faf5 100%);
}

.sub-doc--pending {
    border-color: rgba(246, 194, 62, 0.35);
    background: linear-gradient(135deg, #fff 60%, #fffbf0 100%);
}

.sub-doc--ended {
    border-color: var(--s1-border);
    background: linear-gradient(135deg, #fff 60%, var(--s1-bg) 100%);
}

.sub-doc-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding-left: 1rem;
    border-left: 3px solid var(--s1-primary);
    flex-shrink: 0;
}

.sub-doc-brand-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--s1-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sub-doc-main {
    flex: 1;
    min-width: 0;
}

.sub-doc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.sub-doc-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--s1-text);
}

.sub-doc-customer {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--s1-text);
}

.sub-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sub-doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.82rem;
    color: var(--s1-muted);
}

.sub-doc-meta i {
    color: var(--s1-primary);
    margin-left: 0.25rem;
}

.sub-doc-meta-money {
    font-weight: 700;
    color: var(--s1-primary);
}

.sub-doc-tabs {
    gap: 0.35rem;
    flex-wrap: wrap;
    background: #fff;
    padding: 0.45rem;
    border-radius: 14px;
    border: 1px solid var(--s1-border);
}

.sub-doc-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--s1-muted);
    border: 0;
    background: transparent;
}

.sub-doc-tabs .nav-link:hover {
    color: var(--s1-primary);
    background: var(--s1-primary-light);
}

.sub-doc-tabs .nav-link.active {
    background: var(--s1-primary);
    color: #fff;
}

.sub-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.25);
}

.sub-doc-tabs .nav-link:not(.active) .sub-tab-badge {
    background: var(--s1-bg);
    color: var(--s1-muted);
}

.sub-side-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 1200px) {
    .sub-side-stack {
        position: sticky;
        top: calc(var(--s1-topbar-h) + 1rem);
    }
}

.sub-side-card-head i {
    color: var(--s1-primary);
    margin-left: 0.35rem;
}

.sub-customer-block {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sub-customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--s1-primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sub-package-name {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.sub-package-specs {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--s1-muted);
}

.sub-package-specs i {
    color: var(--s1-primary);
    margin-left: 0.25rem;
}

.sub-package-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.sub-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sub-detail-section {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--s1-border);
}

.sub-detail-section:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.sub-detail-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--s1-text);
    margin-bottom: 0.85rem;
}

.sub-detail-section-title i {
    color: var(--s1-primary);
    margin-left: 0.35rem;
}

.sub-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff 0%, var(--s1-primary-light) 100%);
    border: 1px solid rgba(var(--s1-primary-rgb), 0.12);
    box-shadow: 0 4px 20px rgba(var(--s1-primary-rgb), 0.08);
}

.sub-hero--active {
    border-color: rgba(28, 200, 138, 0.25);
    background: linear-gradient(135deg, #fff 0%, #e8f8ef 100%);
}

.sub-hero--pending {
    border-color: rgba(246, 194, 62, 0.35);
    background: linear-gradient(135deg, #fff 0%, #fff8e6 100%);
}

.sub-hero--ended {
    border-color: var(--s1-border);
    background: linear-gradient(135deg, #fff 0%, #f4f6f9 100%);
}

.sub-hero-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

.sub-hero-avatar {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--s1-primary);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(var(--s1-primary-rgb), 0.3);
}

.sub-hero-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--s1-text);
}

.sub-hero-customer {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--s1-text);
    margin-bottom: 0.35rem;
}

.sub-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.82rem;
    color: var(--s1-muted);
}

.sub-hero-meta i {
    color: var(--s1-primary);
    margin-left: 0.25rem;
}

.sub-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sub-insights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sub-insight-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--s1-border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--s1-text);
}

.sub-insight-chip i {
    color: var(--s1-primary);
}

.sub-progress-card {
    background: #fff;
    border-radius: 14px;
    padding: 1rem 1.15rem;
    border: 1px solid var(--s1-border);
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sub-progress-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sub-progress-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sub-progress-icon--days { background: var(--s1-primary-light); color: var(--s1-primary); }
.sub-progress-icon--meals { background: #e8f8ef; color: #1cc88a; }
.sub-progress-icon--barcode { background: #e8f4fd; color: #36b9cc; }
.sub-progress-icon--absence { background: #fff8e6; color: #f6c23e; }

.sub-progress-label {
    font-size: 0.75rem;
    color: var(--s1-muted);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.sub-progress-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--s1-text);
    line-height: 1.2;
}

.sub-progress-value small {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--s1-muted);
}

.sub-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: #eef1f5;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.sub-progress-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--s1-primary), #ff7a40);
    transition: width 0.4s ease;
}

.sub-progress-bar--muted span {
    background: linear-gradient(90deg, #adb5bd, #ced4da);
}

.sub-progress-foot {
    font-size: 0.72rem;
    color: var(--s1-muted);
}

.sub-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
    padding: 0.25rem 0;
}

@media (max-width: 575px) {
    .sub-info-grid { grid-template-columns: 1fr; }
}

.sub-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sub-info-item--full {
    grid-column: 1 / -1;
}

.sub-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--s1-muted);
    text-transform: none;
}

.sub-info-label i {
    margin-left: 0.25rem;
    color: var(--s1-primary);
}

.sub-info-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--s1-text);
}

.sub-info-value--money {
    font-size: 1.1rem;
    color: var(--s1-primary);
}

.sub-info-value--money small {
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Subscription barcodes panel ── */
.sub-barcodes-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--s1-border);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.sub-barcodes-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    background: linear-gradient(135deg, #fafbfc 0%, var(--s1-primary-light) 100%);
    border-bottom: 1px solid var(--s1-border);
}

.sub-barcodes-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--s1-text);
    margin-bottom: 0.2rem;
}

.sub-barcodes-title i {
    color: var(--s1-primary);
    margin-left: 0.35rem;
}

.sub-barcodes-subtitle {
    font-size: 0.78rem;
    color: var(--s1-muted);
    font-weight: 600;
}

.sub-barcodes-progress-wrap {
    min-width: 160px;
    text-align: left;
}

.sub-barcodes-progress-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--s1-primary);
    margin-bottom: 0.35rem;
}

.sub-barcodes-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(var(--s1-primary-rgb), 0.15);
    overflow: hidden;
}

.sub-barcodes-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--s1-primary), #ff7a40);
}

.sub-barcodes-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--s1-border);
}

@media (max-width: 767px) {
    .sub-barcodes-stats { grid-template-columns: repeat(2, 1fr); }
}

.sub-barcodes-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    border-left: 1px solid var(--s1-border);
    text-align: center;
}

.sub-barcodes-stat:last-child { border-left: 0; }

@media (max-width: 767px) {
    .sub-barcodes-stat:nth-child(odd) { border-left: 0; }
    .sub-barcodes-stat:nth-child(-n+2) { border-bottom: 1px solid var(--s1-border); }
}

.sub-barcodes-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

.sub-barcodes-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sub-barcodes-stat--used .sub-barcodes-stat-num { color: #1cc88a; }
.sub-barcodes-stat--used .sub-barcodes-stat-label { color: #1a9d6a; }

.sub-barcodes-stat--active .sub-barcodes-stat-num { color: var(--s1-primary); }
.sub-barcodes-stat--active .sub-barcodes-stat-label { color: var(--s1-primary-dark); }

.sub-barcodes-stat--pending .sub-barcodes-stat-num { color: #6c757d; }
.sub-barcodes-stat--pending .sub-barcodes-stat-label { color: #868e96; }

.sub-barcodes-stat--total .sub-barcodes-stat-num { color: var(--s1-text); }
.sub-barcodes-stat--total .sub-barcodes-stat-label { color: var(--s1-muted); }

.sub-barcodes-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    background: var(--s1-bg);
    border-bottom: 1px solid var(--s1-border);
}

.sub-barcodes-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.sub-barcodes-filter {
    border: 1px solid var(--s1-border);
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--s1-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sub-barcodes-filter span {
    display: inline-block;
    min-width: 1.2rem;
    margin-right: 0.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--s1-bg);
    font-size: 0.68rem;
}

.sub-barcodes-filter:hover {
    border-color: rgba(var(--s1-primary-rgb), 0.35);
    color: var(--s1-primary);
}

.sub-barcodes-filter.is-active {
    background: var(--s1-primary);
    border-color: var(--s1-primary);
    color: #fff;
}

.sub-barcodes-filter.is-active span {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.sub-barcodes-search {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.sub-barcodes-search i {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--s1-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.sub-barcodes-search input {
    width: 100%;
    border: 1px solid var(--s1-border);
    border-radius: 10px;
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    font-size: 0.82rem;
    background: #fff;
}

.sub-barcodes-search input:focus {
    outline: none;
    border-color: rgba(var(--s1-primary-rgb), 0.45);
    box-shadow: 0 0 0 3px rgba(var(--s1-primary-rgb), 0.1);
}

.sub-barcodes-view-toggle {
    display: flex;
    border: 1px solid var(--s1-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.sub-barcodes-view-toggle button {
    border: 0;
    background: transparent;
    padding: 0.45rem 0.65rem;
    color: var(--s1-muted);
    cursor: pointer;
}

.sub-barcodes-view-toggle button.is-active {
    background: var(--s1-primary-light);
    color: var(--s1-primary);
}

.sub-barcodes-table-wrap {
    position: relative;
}

.sub-barcodes-table {
    font-size: 0.85rem;
}

.sub-barcodes-table thead th {
    background: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--s1-muted);
    text-transform: none;
    border-bottom: 2px solid var(--s1-border);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.sub-barcodes-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f2f5;
}

.sub-barcodes-table tbody tr:last-child td {
    border-bottom: 0;
}

.sub-barcodes-table tbody tr:hover {
    background: #fafbfc;
}

.sub-barcode-row.sub-barcode-row--highlight td {
    background: var(--s1-primary-light);
}

.sub-barcode-day-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--s1-bg);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--s1-text);
    border: 1px solid var(--s1-border);
}

.sub-barcode-day-badge--lg {
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
}

.sub-barcode-code {
    display: inline-block;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--s1-text);
    background: #f4f6f9;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px dashed #d5dbe3;
}

.sub-barcode-code--tile {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.78rem;
    padding: 0.45rem 0.35rem;
    margin: 0.5rem 0;
    word-break: break-all;
}

.sub-barcode-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.sub-barcode-status-pill--sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
}

.sub-barcode-status-pill--used {
    background: #e8f8ef;
    color: #1a9d6a;
}

.sub-barcode-status-pill--active {
    background: var(--s1-primary-light);
    color: var(--s1-primary-dark);
}

.sub-barcode-status-pill--pending {
    background: #f1f3f5;
    color: #6c757d;
}

.sub-barcode-status-pill--expired {
    background: #fff4ee;
    color: #c0392b;
}

.sub-barcode-status-pill--cancelled {
    background: #e9ecef;
    color: #495057;
}

.sub-barcode-meta {
    font-size: 0.8rem;
    color: var(--s1-text);
}

.sub-barcode-meta small {
    display: block;
    color: var(--s1-muted);
    font-size: 0.72rem;
}

.sub-barcode-copy {
    line-height: 1;
}

.sub-barcode-copy--icon {
    border: 0;
    background: transparent;
    color: var(--s1-muted);
    padding: 0.15rem;
    cursor: pointer;
}

.sub-barcode-copy--icon:hover {
    color: var(--s1-primary);
}

.sub-barcodes-no-match {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--s1-muted);
}

.sub-barcodes-no-match i {
    font-size: 2rem;
    opacity: 0.35;
    display: block;
    margin-bottom: 0.5rem;
}

.sub-barcodes-no-match p {
    margin: 0;
    font-weight: 700;
}

.sub-barcodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    padding: 1.15rem;
}

.sub-barcode-tile {
    border-radius: 14px;
    border: 1px solid var(--s1-border);
    padding: 0.85rem;
    background: #fff;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.sub-barcode-tile:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.sub-barcode-tile--used {
    border-color: #b8e6c8;
    background: linear-gradient(180deg, #fff 0%, #f0fdf4 100%);
}

.sub-barcode-tile--active {
    border-color: rgba(var(--s1-primary-rgb), 0.3);
    background: linear-gradient(180deg, #fff 0%, var(--s1-primary-light) 100%);
}

.sub-barcode-tile--pending {
    background: #fafbfc;
}

.sub-barcode-tile--expired {
    border-color: #ffd4b8;
    background: #fffaf7;
    opacity: 0.85;
}

.sub-barcode-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.sub-barcode-tile-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.68rem;
    color: var(--s1-muted);
    font-weight: 600;
}

.sub-barcode-tile-foot span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.sub-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--s1-muted);
}

.sub-empty i {
    font-size: 2.5rem;
    opacity: 0.35;
    display: block;
    margin-bottom: 0.75rem;
}

.sub-empty p {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--s1-text);
}

.sub-side-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--s1-border);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sub-side-card-head {
    padding: 0.85rem 1.15rem;
    font-weight: 800;
    font-size: 0.9rem;
    background: var(--s1-bg);
    border-bottom: 1px solid var(--s1-border);
}

.sub-side-card-body {
    padding: 1rem 1.15rem;
}

.sub-money-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    font-size: 0.85rem;
    color: var(--s1-muted);
    border-bottom: 1px dashed var(--s1-border);
}

.sub-money-row:last-child {
    border-bottom: 0;
}

.sub-money-row strong {
    color: var(--s1-text);
    font-weight: 700;
}

.sub-money-row--discount strong {
    color: #1cc88a;
}

.sub-money-row--total {
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 2px solid var(--s1-border);
    border-bottom: 0;
    font-weight: 700;
    color: var(--s1-text);
}

.sub-money-row--total strong {
    font-size: 1.15rem;
    color: var(--s1-primary);
}

.sub-timeline {
    padding: 1rem 1.15rem;
}

.sub-timeline-item {
    display: flex;
    gap: 0.85rem;
    padding-bottom: 1.25rem;
    position: relative;
}

.sub-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    right: 7px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: var(--s1-border);
}

.sub-timeline-item--done:not(:last-child)::before {
    background: var(--s1-primary);
    opacity: 0.35;
}

.sub-timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--s1-border);
    background: #fff;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.sub-timeline-item--done .sub-timeline-dot {
    border-color: var(--s1-primary);
    background: var(--s1-primary);
}

.sub-timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sub-timeline-content strong {
    font-size: 0.85rem;
    color: var(--s1-text);
}

.sub-timeline-content span {
    font-size: 0.78rem;
    color: var(--s1-muted);
}

.sub-qr-box {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--s1-bg);
    border-radius: 10px;
    text-align: center;
}

.sub-qr-box code {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--s1-primary);
    margin-top: 0.25rem;
}

/* Activity logs */
.activity-actors-accordion .accordion-button:not(.collapsed) {
    background: var(--s1-primary-light, #fff3ed);
    color: var(--s1-primary, #ff4800);
    box-shadow: none;
}

.activity-actors-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.activity-log-detail {
    background: #f8fafc;
    border-top: 1px solid var(--s1-border, #e8ecef);
}

.activity-log-json {
    max-height: 200px;
    overflow: auto;
    direction: ltr;
    text-align: left;
    font-size: 0.75rem;
    background: #fff;
    border: 1px solid #e8ecef;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin: 0;
}

tr:has(+ .activity-log-detail-row.show) {
    background: rgba(255, 72, 0, 0.04);
}

/* ——— Locations (simplified) ——— */
.admin-loc-pricing-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--s1-border, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.admin-loc-pricing-bar__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--s1-primary-light, #fff3ed);
    color: var(--s1-primary, #ff4800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.admin-loc-pricing-bar__body { flex: 1; min-width: 200px; }

.admin-page-locations .loc-branch-card {
    background: #fff;
    border: 1px solid #e8ecef;
    border-radius: 12px;
    padding: 1rem;
}

/* ——— Discounts (cleaner cards) ——— */
.admin-page-discounts .discount-card {
    border: 1px solid #e8ecef;
    border-radius: 14px;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.admin-page-discounts .discount-card:hover {
    border-color: #fed7aa;
    box-shadow: 0 8px 24px rgba(255, 72, 0, 0.08);
}

.admin-page-discounts .discount-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    text-align: center;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 10px;
}

.admin-page-discounts .discount-stats-grid span {
    display: block;
    font-weight: 800;
    font-size: 1rem;
}

.admin-page-discounts .discount-stats-grid small {
    color: #64748b;
    font-size: 0.68rem;
}
