/* نظام التغذية — CSS عادي (بدون Tailwind / بدون Vite) */
:root {
    --brand-primary: #047857;
    --brand-primary-hover: #065f46;
    --brand-accent: #059669;
    --brand-olive: #6b8e23;
    --brand-olive-hover: #556b19;
    --brand-surface: #f1f5f9;
    --brand-border: #e2e8f0;
    --sidebar-width: 260px;
    --sidebar-width-ltr: 244px;
    --navbar-height: 56px;
}

* { box-sizing: border-box; }

html, body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background: var(--brand-surface);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    padding-top: var(--navbar-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ── Navbar ── */
.admin-navbar {
    height: var(--navbar-height);
    background: linear-gradient(90deg, #065f46, #047857 55%, #059669) !important;
    z-index: 1040;
}

.admin-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff !important;
}

.admin-navbar .nav-link,
.admin-navbar .navbar-text {
    color: rgba(255, 255, 255, 0.9) !important;
}

.admin-navbar .dropdown-menu {
    border: 0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    border-radius: 0.75rem;
}

/* ── Sidebar (فلسفة TOP ROUND: عرض ثابت على الديسكتوب) ── */
.sidebar {
    background: linear-gradient(180deg, #065f46 0%, #047857 45%, #064e3b 100%);
    color: #fff;
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    width: var(--sidebar-width);
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - var(--navbar-height));
    min-height: calc(100vh - var(--navbar-height));
}

html[dir="ltr"] .sidebar {
    direction: ltr;
    left: 0;
    right: auto;
    width: var(--sidebar-width-ltr);
    text-align: left;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    margin: 2px 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s ease, color 0.2s ease;
}

html[dir="ltr"] .sidebar .nav-link {
    font-size: 0.81rem;
    text-align: left;
    justify-content: flex-start !important;
    gap: 0.5rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

html[dir="ltr"] .sidebar .nav-link i {
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex-shrink: 0;
}

html[dir="ltr"] .sidebar .nav-link > span {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="ltr"] .sidebar .nav-link[data-bs-toggle="collapse"] .fa-chevron-down {
    margin-left: auto !important;
    margin-right: 0;
}

html[dir="ltr"] .sidebar .collapse .nav-link {
    justify-content: flex-start !important;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.sidebar .collapse .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.sidebar .nav-link[data-bs-toggle="collapse"] .fa-chevron-down {
    transition: transform 0.25s ease;
    font-size: 0.7rem;
    opacity: 0.7;
}

.sidebar .nav-link[data-bs-toggle="collapse"]:not(.collapsed) .fa-chevron-down {
    transform: rotate(180deg);
}

.sidebar .collapse.show {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    margin: 4px 0;
    padding: 4px 0;
}

html[dir="ltr"] .sidebar .nav.flex-column.ps-3 {
    padding-left: 0.25rem !important;
    padding-right: 0 !important;
}

html[dir="ltr"] .sidebar .nav,
html[dir="ltr"] .sidebar ul,
html[dir="ltr"] .sidebar .collapse.show {
    text-align: left;
}

html[dir="ltr"] .sidebar ul.nav.flex-column,
html[dir="ltr"] .sidebar .collapse > ul {
    padding-left: 0 !important;
}

.sidebar-logo {
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 4px;
}

.content-wrapper {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: calc(100vh - var(--navbar-height));
    padding: 1.25rem 1.5rem;
    margin-right: var(--sidebar-width);
    width: auto;
    max-width: none;
}

html[dir="ltr"] .content-wrapper {
    margin-left: var(--sidebar-width-ltr);
    margin-right: 0;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    inset-inline: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1025;
}

.sidebar-backdrop.show { display: block; }

@media (max-width: 991.98px) {
    .sidebar {
        right: -280px;
        width: 280px;
        transition: right 0.3s ease;
        z-index: 1050;
    }

    .sidebar.show { right: 0; }

    html[dir="ltr"] .sidebar {
        left: -300px;
        right: auto;
        width: 300px;
        transition: left 0.3s ease;
    }

    html[dir="ltr"] .sidebar.show {
        left: 0;
        right: auto;
    }

    .content-wrapper {
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        padding: 1rem;
    }

    html[dir="ltr"] .content-wrapper {
        margin-left: 0;
    }
}

/* ── Buttons / Cards ── */
.btn-primary {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-hover) !important;
}
.btn-outline-primary {
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--brand-primary) !important;
    color: #fff !important;
}
.btn-secondary {
    background: var(--brand-olive) !important;
    color: #fff !important;
    border: 1px solid var(--brand-olive) !important;
    font-weight: 600;
}
.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background: var(--brand-olive-hover) !important;
    border-color: var(--brand-olive-hover) !important;
    color: #fff !important;
}

.btn-outline-secondary {
    color: var(--brand-olive) !important;
    border-color: var(--brand-olive) !important;
    background: transparent !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background: var(--brand-olive) !important;
    border-color: var(--brand-olive) !important;
    color: #fff !important;
}

.btn-link {
    color: var(--brand-primary) !important;
}
.btn-link:hover { color: var(--brand-primary-hover) !important; }

.btn-check:checked + .btn-outline-secondary,
.btn-check:active + .btn-outline-secondary {
    background: var(--brand-olive) !important;
    border-color: var(--brand-olive) !important;
    color: #fff !important;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: var(--brand-primary) !important;
    color: #fff !important;
}
.nav-pills .nav-link:not(.active) {
    color: #475569;
}
.nav-pills .nav-link:not(.active):hover {
    color: var(--brand-primary);
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}

.text-primary { color: var(--brand-primary) !important; }
.bg-primary { background-color: var(--brand-primary) !important; }
.border-primary { border-color: var(--brand-primary) !important; }

.form-control:focus,
.form-select:focus {
    border-color: #6ee7b7;
    box-shadow: 0 0 0 0.2rem rgba(4, 120, 87, 0.2);
}

.page-link { color: var(--brand-primary); }
.page-item.active .page-link {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

a { color: var(--brand-primary); }
a:hover { color: var(--brand-primary-hover); }

.form-check-input:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.form-check-input:focus {
    border-color: #6ee7b7;
    box-shadow: 0 0 0 0.2rem rgba(4, 120, 87, 0.15);
}
.form-switch .form-check-input:checked { background-color: var(--brand-primary) !important; }

/* ── Dashboard KPI ── */
.stat-card {
    border: none;
    border-radius: 15px;
    padding: 1.1rem 1.15rem;
    color: #fff !important;
    background: linear-gradient(135deg, #065f46 0%, #064e3b 100%);
    box-shadow: 0 2px 15px rgba(6, 78, 59, 0.25);
    height: 100%;
}
.stat-card * { color: #fff !important; }
.stat-card-success { background: linear-gradient(135deg, #059669 0%, #047857 100%); }
.stat-card-slate { background: linear-gradient(135deg, #475569 0%, #334155 100%); }
.stat-card-soft { background: linear-gradient(135deg, #34d399 0%, #059669 100%); }

.stat-card-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.stat-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
    margin: 0;
}
.kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    font-variant-numeric: tabular-nums;
}
.kpi-hint {
    font-size: 0.72rem;
    opacity: 0.8;
    margin: 0.25rem 0 0;
}

.revenue-analytics-card {
    border-radius: 1.25rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--brand-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    height: 100%;
}
.revenue-analytics-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.4rem;
}
.revenue-analytics-stats {
    display: flex;
    align-items: stretch;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.revenue-analytics-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.15rem;
}
.revenue-analytics-stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    font-variant-numeric: tabular-nums;
}
.revenue-trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}
.revenue-trend-badge.is-up { background: #dcfce7; color: #15803d; }
.revenue-trend-badge.is-down { background: #fee2e2; color: #b91c1c; }
.activity-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-inline-end: 0.3rem;
    vertical-align: middle;
}
.activity-dot-subs { background: #059669; }
.activity-dot-orders { background: #6b8e23; }
.revenue-analytics-body {
    position: relative;
    height: 220px;
    padding: 0.5rem 1rem 1rem;
}
@media (max-width: 575.98px) {
    .revenue-analytics-body { height: 200px; }
}

.dash-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--brand-border);
    background: #fff;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.quick-action:hover {
    border-color: #a7f3d0;
    box-shadow: 0 2px 8px rgba(4, 120, 87, 0.08);
}
.quick-action-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    background: #ecfdf5;
    color: #047857;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.quick-action-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.3;
}

.alert-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--brand-border);
    background: #fff;
    text-decoration: none;
}
.alert-row-warn { border-color: #fde68a; background: #fffbeb; }
.alert-row-ok { border-color: #bbf7d0; background: #f0fdf4; }

.admin-metric {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    height: 100%;
}
.admin-metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin: 0;
}
.admin-metric-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

/* ── Alerts ── */
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-error, .alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Tables ── */
.table-scroll,
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Icon size helpers (بديل Tailwind على SVG) ── */
.icon-sm, .w-3\.5, .h-3\.5 { width: 0.875rem !important; height: 0.875rem !important; }
.icon-md, .w-4, .h-4 { width: 1rem !important; height: 1rem !important; }
.w-5, .h-5 { width: 1.25rem !important; height: 1.25rem !important; }
.icon-lg, .w-6, .h-6 { width: 1.5rem !important; height: 1.5rem !important; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }

/* ── Definitions hub ── */
.definitions-hub { width: 100%; }
.definitions-tabs-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--brand-surface);
    padding-bottom: 0.75rem;
}
.definitions-tabs-bar {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.definitions-tabs-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.35rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.definitions-tabs-scroll::-webkit-scrollbar { display: none; height: 0; }
.definitions-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    border-radius: 0.5rem;
    white-space: nowrap;
    text-decoration: none;
}
.definitions-tab:hover { background: #f1f5f9; color: #334155; }
.definitions-tab-active,
.definitions-tab-active:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* ── Login ── */
.login-bg {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(145deg, #064e3b 0%, #047857 40%, #059669 100%, #064e3b 140%);
    background-size: 250% 250%;
    animation: loginBgShift 18s ease-in-out infinite alternate;
}
.login-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.login-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    background: radial-gradient(circle, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 70%);
    opacity: 0.7;
    will-change: transform;
}
.login-bg-shape-1 { width: 22rem; height: 22rem; top: -6rem; right: -4rem; animation: loginFloat1 16s ease-in-out infinite; }
.login-bg-shape-2 {
    width: 16rem; height: 16rem; bottom: -5rem; left: -3rem;
    background: radial-gradient(circle, rgba(163,230,53,0.28) 0%, rgba(163,230,53,0) 70%);
    animation: loginFloat2 20s ease-in-out infinite;
}
.login-bg-shape-3 {
    width: 12rem; height: 12rem; top: 55%; right: 12%;
    background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 70%);
    animation: loginFloat3 14s ease-in-out infinite;
}
.login-bg-shape-4 {
    width: 9rem; height: 9rem; top: 12%; left: 8%;
    background: radial-gradient(circle, rgba(6,78,59,0.35) 0%, rgba(6,78,59,0) 70%);
    animation: loginFloat2 22s ease-in-out infinite reverse;
}
@keyframes loginBgShift {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 20% 100%; }
}
@keyframes loginFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-2rem, 3rem) scale(1.1); }
}
@keyframes loginFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(2.5rem, -2rem) scale(1.15); }
}
@keyframes loginFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-1.5rem, -2.5rem) scale(0.9); }
}
@media (prefers-reduced-motion: reduce) {
    .login-bg { animation: none; }
    .login-bg-shape { animation: none; }
}
.glass-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
}

/* ── Misc helpers used during migration ── */
.page-toolbar { margin-bottom: 1rem; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.text-truncate-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Definitions back link ── */
.definitions-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
}
.definitions-back-link:hover {
    color: #1e293b;
    text-decoration: underline;
}

/* ── Document status badges ── */
.status-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
}
.status-badge-active { background: #ecfdf5; color: #047857; }
.status-badge-pending { background: #fffbeb; color: #b45309; }
.status-badge-partial { background: #fff7ed; color: #c2410c; }
.status-badge-returned { background: #f5f3ff; color: #6d28d9; }
.status-badge-cancelled { background: #fff1f2; color: #e11d48; }
.status-badge-draft { background: #f8fafc; color: #475569; }
.status-badge-sales { background: #f0f9ff; color: #0369a1; }
.status-badge-purchase { background: #f0fdfa; color: #0f766e; }

/* ── Payment method picker ── */
.payment-option-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.payment-option-btn.is-active {
    border-color: #64748b;
    background: #f8fafc;
    color: #1e293b;
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.25);
}

/* ── Meal type picker cards ── */
.meal-type-option { cursor: pointer; }
.meal-type-card {
    position: relative;
    min-height: 2.75rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem !important;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.meal-type-check {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #334155;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
}
.meal-type-icon-wrap {
    width: 1.75rem;
    height: 1.75rem;
    background: #f1f5f9;
    color: #475569;
    flex-shrink: 0;
}
.meal-type-option:has(input:checked) .meal-type-card {
    border-color: #334155;
    background: #f8fafc;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.meal-type-option:has(input:checked) .meal-type-check {
    display: inline-flex;
}

/* ── Featured customer badge ── */
.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    border: 1px solid transparent;
}
@media (min-width: 576px) {
    .featured-badge { font-size: 0.75rem; }
}
.featured-badge-light {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.featured-badge-dark {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ── Customer portal layout ── */
.customer-layout {
    min-height: 100vh;
    background: var(--brand-surface);
    color: #1e293b;
    padding-top: 0;
}
.customer-container {
    max-width: 48rem;
}
.customer-navbar { z-index: 1030; }

/* ── ERP / invoices migration helpers ── */
.filter-bar .row { margin-bottom: 0; }

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}
.row-action {
    font-size: 0.75rem;
    color: #334155;
    text-decoration: none;
}
.row-action:hover { text-decoration: underline; }

.avatar-circle {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.accounting-tabs {
    border-bottom: 1px solid var(--brand-border);
    gap: 0.35rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.accounting-tabs::-webkit-scrollbar { display: none; height: 0; }
.accounting-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.6rem 0.25rem;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.accounting-tabs .nav-link i { font-size: 0.8rem; color: #94a3b8; transition: color .15s; }
.accounting-tabs .nav-link:hover { color: var(--brand-primary); border-color: transparent; }
.accounting-tabs .nav-link.active {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    background: transparent;
}
.accounting-tabs .nav-link.active i { color: var(--brand-primary); }

.account-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.account-modal-backdrop > .modal-panel,
.account-modal-backdrop > div {
    width: 100%;
    max-width: 28rem;
}

.waste-type-card {
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.btn-check:checked + .waste-type-card {
    border-color: #dc3545 !important;
    background: #fef2f2;
}
.btn-check[value="finished"]:checked + .waste-type-card {
    border-color: #fd7e14 !important;
    background: #fff7ed;
}

[data-return-row].is-selected {
    background: rgba(255, 237, 213, 0.35);
}
[data-return-row] [data-line-amount].text-return-active {
    color: #ea580c;
}
[data-return-row] [data-line-amount].text-return-idle {
    color: #cbd5e1;
}

.journal-dir-toggle .btn-dir-active-debit {
    background: #059669 !important;
    color: #fff !important;
    border-color: #059669 !important;
}
.journal-dir-toggle .btn-dir-active-credit {
    background: #e11d48 !important;
    color: #fff !important;
    border-color: #e11d48 !important;
}

.account-tree-panel {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    overflow: hidden;
}
.account-tree-panel-head {
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
}
.account-tree-search {
    padding: 0.6rem 0.75rem;
    background: #fff;
    border-bottom: 1px solid var(--brand-border);
}
.account-tree-search input {
    border-radius: 0.6rem;
}
.account-tree-body {
    max-height: 680px;
    overflow-y: auto;
    background: #f8fafc;
    padding: 0.5rem;
}
.account-tree-body::-webkit-scrollbar { width: 6px; }
.account-tree-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

ul.account-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
ul.account-tree-list.is-nested {
    margin-inline-start: 0.85rem;
    padding-inline-start: 0.75rem;
    border-inline-start: 2px solid #e2e8f0;
}
.account-tree-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    background: #fff;
    color: #334155;
    text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
    margin-bottom: 0.3rem;
}
.account-tree-link:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}
.account-tree-link.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .25);
}
.account-tree-link.active .account-tree-code { color: rgba(255, 255, 255, .65); }
.account-tree-toggle {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.account-tree-name {
    font-weight: 600;
    font-size: 0.825rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-tree-code {
    font-family: ui-monospace, monospace;
    font-size: 0.65rem;
    color: #94a3b8;
    display: block;
}
.account-tree-count {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    flex-shrink: 0;
}
.account-tree-tone-asset { background: #eff6ff; color: #1d4ed8; }
.account-tree-tone-liability { background: #fff1f2; color: #be123c; }
.account-tree-tone-equity { background: #f5f3ff; color: #6d28d9; }
.account-tree-tone-revenue { background: #ecfdf5; color: #047857; }
.account-tree-tone-expense { background: #fffbeb; color: #b45309; }
.account-tree-tone-default { background: #f8fafc; color: #64748b; }

.text-purple { color: #7c3aed !important; }

.kpi-mini-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    height: 100%;
}

/* ── Account tree (details/summary) ── */
.account-tree-details summary {
    list-style: none;
    cursor: pointer;
}
.account-tree-details summary::-webkit-details-marker { display: none; }
.account-tree-details .tree-chevron {
    display: inline-flex;
    transition: transform 0.2s ease;
}
.account-tree-details[open] > summary .tree-chevron { transform: rotate(-90deg); }

/* ── Admin settings ── */
.settings-page { width: 100%; }

/* ── تصميم جديد: تنقّل عمودي + محتوى مبسّط ── */
.settings-shell {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}
.settings-nav {
    flex: 0 0 15rem;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    padding: 0.6rem;
    position: sticky;
    top: calc(var(--navbar-height) + 1rem);
}
.settings-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.65rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    transition: background .15s, color .15s;
}
.settings-nav-link:hover { background: #f1f5f9; color: #1e293b; }
.settings-nav-link.active { background: #ecfdf5; color: #047857; }
.settings-nav-link .settings-nav-icon {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
    font-size: 0.8rem;
}
.settings-nav-link.active .settings-nav-icon { background: #047857; color: #fff; }
.settings-content { flex: 1 1 auto; min-width: 0; }
.settings-simple-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.settings-simple-header .settings-logo-preview {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
}
@media (max-width: 767.98px) {
    .settings-shell { flex-direction: column; }
    .settings-nav {
        flex: 1 1 auto;
        width: 100%;
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 0.35rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .settings-nav::-webkit-scrollbar { display: none; height: 0; }
    .settings-nav-link { margin-bottom: 0; white-space: nowrap; }
}

.settings-header-card { border-radius: 1rem; overflow: hidden; border: 1px solid var(--brand-border); }
.settings-header-gradient {
    background: linear-gradient(to left, #1e293b, #334155 45%, #065f46);
    color: #fff;
    padding: 1.5rem;
}
.settings-stat-pill {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    min-width: 4.5rem;
    text-align: center;
}
.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.65rem;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.settings-tab:hover { background: #f1f5f9; color: #334155; }
.settings-tab.active { background: #334155; color: #fff; box-shadow: 0 2px 8px rgba(51, 65, 85, 0.25); }
.settings-card { background: #fff; border: 1px solid var(--brand-border); border-radius: 1rem; overflow: hidden; }
.settings-card-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #fafafa, #fff);
}
.settings-field-label { display: block; font-size: 0.75rem; font-weight: 600; color: #64748b; margin-bottom: 0.35rem; }
.settings-logo-preview {
    width: 5rem;
    height: 5rem;
    border-radius: 1rem;
    border: 2px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
    flex-shrink: 0;
}
.settings-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.settings-api-box {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    word-break: break-all;
}
.settings-msg-card { border: 1px solid var(--brand-border); border-radius: 0.85rem; padding: 1rem; background: #fafafa; }
.settings-badge-group { font-size: 0.65rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 0.35rem; background: #e0e7ff; color: #3730a3; }
.settings-user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Definitions hub cards ── */
.definitions-flow-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--brand-border);
    background: #fff;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}
.definitions-flow-link:hover { border-color: #94a3b8; background: #f8fafc; }
.definitions-flow-step {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #334155;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.definitions-section-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}
.definitions-section-card:hover { border-color: #94a3b8 !important; }
.definitions-section-card.featured { border-color: #cbd5e1 !important; background: rgba(248, 250, 252, 0.6); }
.definitions-section-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.definitions-section-card:hover .definitions-section-icon { background: #334155; color: #fff; }

/* ── Item type selector ── */
.item-type-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 2px solid var(--brand-border);
    background: #fff;
    border-radius: 0.85rem;
    padding: 0.6rem 0.85rem;
    text-align: right;
    width: 100%;
    transition: border-color 0.15s, background 0.15s;
}
.item-type-btn.is-active { border-color: #475569; background: #f8fafc; }

/* ── Plan cards (meals index) ── */
.plan-card { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow 0.15s; }
.plan-card:hover { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important; }
.plan-card.inactive { opacity: 0.6; }
.plan-card-header {
    background: #334155;
    color: #fff;
    padding: 0.75rem 0.85rem 0.6rem;
    position: relative;
}
.plan-quota-row {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    font-size: 0.65rem;
    max-width: 100%;
}
.plan-quota-row .text-truncate { max-width: 4.5rem; }

/* ── Nutrition index ── */
.nutrition-type-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--brand-border);
    background: #fff;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s;
}
.nutrition-type-tab:hover { box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); }
.nutrition-meal-row { transition: background 0.15s; }
.nutrition-meal-row:hover { background: rgba(248, 250, 252, 0.8); }
.nutrition-meal-row .row-actions { opacity: 0; transition: opacity 0.15s; }
.nutrition-meal-row:hover .row-actions { opacity: 1; }
.nutrition-cal-badge {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    text-align: center;
    line-height: 1.1;
}
.nutrition-pill {
    font-size: 0.6875rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 500;
}

/* ── Plan form ── */
.plan-panel-fixed { height: 580px; display: flex; flex-direction: column; }
.plan-panel-body { overflow-y: auto; flex: 1 1 auto; }
.quota-row { border: 2px solid #e2e8f0; border-radius: 0.75rem; transition: border-color 0.15s, box-shadow 0.15s; overflow: hidden; background: #fff; }
.quota-row.is-disabled { border-color: #e9ecef !important; }
.quota-row.is-disabled .quota-header { opacity: 0.6; }
.quota-row.is-enabled { box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06); }
.quota-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; cursor: pointer; user-select: none; }
.quota-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quota-pill { position: relative; width: 2.5rem; height: 1.5rem; border-radius: 999px; flex-shrink: 0; transition: background 0.2s; }
.quota-dot { position: absolute; top: 2px; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); transition: left 0.2s; }
.color-swatch {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 3px solid #fff;
    transition: transform 0.15s, border-color 0.15s;
    padding: 0;
    cursor: pointer;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.is-selected { border-color: #111; }
.color-preview { height: 2.5rem; border-radius: 0.75rem; transition: background 0.2s; }
.meal-row { transition: background 0.15s; }
.meal-row.is-off { background: rgba(248, 250, 252, 0.6); }
.meal-toggle {
    position: relative;
    width: 2.25rem;
    height: 1.25rem;
    border-radius: 999px;
    border: 2px solid #e5e7eb;
    background: #f3f4f6;
    flex-shrink: 0;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.meal-toggle-dot {
    position: absolute;
    top: 2px;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: left 0.2s;
}

/* ── Tailwind migration helpers ── */
.text-2xs { font-size: 0.65rem; }
.table-row-surplus { background-color: rgba(240, 253, 244, 0.55); }
.table-row-deficit { background-color: rgba(254, 242, 242, 0.55); }
.credit-note-banner {
    border: 1px solid #ddd6fe;
    background: rgba(245, 243, 255, 0.85);
    border-radius: 0.75rem;
}
.return-info-box {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 0.75rem;
    padding: 1rem;
}
.report-link-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
    height: 100%;
}
.report-link-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    color: inherit;
}
.progress-thin { height: 4px; }
.progress-md { height: 8px; }

/* ── Wallet card ── */
.wallet-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 520px at 100% -10%, rgba(14, 165, 233, 0.15), transparent 60%),
        radial-gradient(950px 450px at -5% 110%, rgba(16, 185, 129, 0.14), transparent 58%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    padding: 1.25rem;
}
.wallet-card {
    max-width: 29.5rem;
    width: 100%;
    border-radius: 1.75rem;
    overflow: hidden;
    border: 1px solid #dbeafe;
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.16);
}
.wallet-card-header {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 58%, #0ea5e9 100%);
    color: #fff;
    padding: 2rem 1.35rem 1.75rem;
    text-align: center;
    isolation: isolate;
}
.wallet-glow {
    position: absolute;
    inset: auto auto -50% -20%;
    width: 72%;
    height: 72%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 66%);
    pointer-events: none;
    z-index: -1;
}
.wallet-logo-wrap {
    width: 5.25rem;
    height: 5.25rem;
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: grid;
    place-items: center;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.24);
}
.wallet-logo-img {
    width: 84%;
    height: 84%;
    object-fit: contain;
}
.wallet-brand {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.9;
}
.wallet-name {
    font-size: 1.35rem;
    font-weight: 800;
}
.wallet-membership {
    font-size: 0.86rem;
    letter-spacing: 0.07em;
    opacity: 0.9;
}
.wallet-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.35rem 0.8rem;
}
.wallet-subtitle {
    color: #475569;
    font-size: 0.88rem;
}
.wallet-stat-box {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.95rem 0.75rem;
    text-align: center;
}
.wallet-stat-label {
    color: #64748b;
    font-size: 0.74rem;
    margin: 0;
}
.wallet-stat-value {
    color: #0f172a;
    font-weight: 700;
    font-size: 0.96rem;
    margin: 0;
}
.wallet-verify-box {
    border: 1px solid #86efac;
    background: #f0fdf4;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    text-align: center;
    color: #14532d;
    font-size: 0.85rem;
}
.wallet-verify-box--warning {
    border-color: #fdba74;
    background: #fff7ed;
    color: #9a3412;
}
.wallet-wallet-btn {
    background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
    border: 1px solid #0f172a;
    color: #fff;
    font-weight: 700;
    min-height: 3.2rem;
}
.wallet-wallet-btn:hover {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    color: #fff;
}

.wallet-qr-card {
    background:
        radial-gradient(320px 150px at 100% 0, rgba(15, 23, 42, 0.06), transparent 55%),
        #fff;
}
.wallet-qr-shell {
    border-color: #cbd5e1 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.wallet-qr-canvas {
    width: 13.5rem;
    height: 13.5rem;
}
.wallet-qr-canvas svg,
.wallet-qr-canvas img {
    width: 100% !important;
    height: 100% !important;
}
.wallet-qr-caption {
    font-size: 0.75rem;
    color: #64748b;
}

@media (max-width: 575.98px) {
    .wallet-page {
        padding: 0.75rem;
    }

    .wallet-card {
        border-radius: 1.3rem;
    }

    .wallet-card-header {
        padding: 1.55rem 1rem 1.35rem;
    }

    .wallet-logo-wrap {
        width: 4.4rem;
        height: 4.4rem;
        border-radius: 1.1rem;
    }

    .wallet-name {
        font-size: 1.12rem;
    }

    .wallet-qr-canvas {
        width: 11.25rem;
        height: 11.25rem;
    }
}

/* ── Account portal ── */
.account-avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: #f1f5f9;
    color: #334155;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.terms-box {
    background: #fffbeb;
    border: 2px solid #fcd34d;
    border-radius: 1rem;
    padding: 1.25rem;
}
.terms-scroll {
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 0.75rem;
    padding: 1rem;
    max-height: 12rem;
    overflow-y: auto;
    font-size: 0.875rem;
}
.pref-chip {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

/* ── ERP migration helpers (Tailwind replacements) ── */
.text-2xs { font-size: 0.625rem; }
.text-xxs { font-size: 0.6875rem; }
.table-wide { min-width: 980px; }
.table-wide-md { min-width: 760px; }
.col-min-16 { min-width: 16rem; }
.col-min-14 { min-width: 14rem; }
.col-min-9 { min-width: 9rem; }
.col-min-8 { min-width: 8rem; }
.input-w-xs { width: 6rem; max-width: 100%; }
.input-w-sm { width: 7rem; max-width: 100%; }
.row-low-stock { background: rgba(254, 226, 226, 0.35); }
.bg-tint-success { background: rgba(240, 253, 244, 0.45); border-color: #bbf7d0 !important; }
.bg-tint-warning { background: rgba(255, 251, 235, 0.45); border-color: #fde68a !important; }
.bg-tint-danger { background: #fef2f2; }
.bg-tint-success-solid { background: #f0fdf4; }
.bg-tint-danger-solid { background: #fef2f2; }
.bg-tint-warning-solid { background: #fffbeb; }
.bg-tint-info-solid { background: #eff6ff; }
.input-tax-total { border-color: #bfdbfe !important; background: #eff6ff !important; color: #1e40af !important; font-weight: 600; }
.text-tax-total { color: #1e40af !important; }
.alert-panel-warning { border-color: #fde68a; background: rgba(255, 251, 235, 0.75); }
.alert-panel-warning .alert-panel-icon { width: 2rem; height: 2rem; border-radius: 0.5rem; background: #fef3c7; color: #b45309; }
.badge-low-stock { background: #fee2e2; color: #dc2626; }
.badge-waste-raw { background: #fee2e2; color: #dc2626; }
.badge-waste-finished { background: #ffedd5; color: #c2410c; }
.badge-yield-low { background: #ffedd5; color: #c2410c; }
.badge-yield-ok { background: #f1f5f9; color: #475569; }
.badge-inactive { background: #fee2e2; color: #dc2626; }
.hint-scroll-list { max-height: 10rem; overflow-y: auto; }
@media (min-width: 992px) {
    .table-wide-lg-auto { min-width: 0; }
}

/* ── Empty states ── */
.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--bs-secondary-color);
}
.empty-state-icon {
    display: block;
    font-size: 2rem;
    opacity: 0.35;
    margin-bottom: 0.75rem;
}
.card-table-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--brand-border);
    background: #f8fafc;
}

/* ── Stat card variants (danger / warning) ── */
.stat-card-danger { background: linear-gradient(135deg, #dc3545 0%, #991b1b 100%); }
.stat-card-danger-alt { background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%); }
.stat-card-warning { background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%); }
.card-section-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--brand-border);
    background: #f8fafc;
}
.card-section-header-dark {
    padding: 0.75rem 1.25rem;
    background: #212529;
    color: #fff;
}
.card-section-header-dark .dash-panel-title { color: #fff !important; }
.card-section-header-dark .dash-panel-title i { color: rgba(255, 255, 255, 0.65) !important; }
