@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* ==========================================================================
   Print Shop Management System - Modern UI/UX Design System 2026
   ========================================================================== */

:root {
    --font-primary: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-numbers: 'Plus Jakarta Sans', 'Cairo', -apple-system, sans-serif;
    --font-mono: 'Plus Jakarta Sans', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    
    /* Modern Color Palette */
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --primary-dark: #075985;
    
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #047857;
    
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #b91c1c;
    
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #b45309;
    
    --slate-bg: #f8fafc;
    --slate-card: #ffffff;
    --slate-border: #e2e8f0;
    --slate-text: #0f172a;
    --slate-muted: #64748b;

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 78px;
    --topbar-height: 64px;
    
    /* Modern Soft Shadows */
    --shadow-subtle: 0 2px 6px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.02);
    --shadow-card: 0 10px 32px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.03);
    --shadow-hover: 0 18px 44px rgba(15, 23, 42, 0.09), 0 8px 20px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 25px rgba(2, 132, 199, 0.25);
    
    --radius-sm: 0.625rem;
    --radius-md: 0.875rem;
    --radius-lg: 1.125rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-pill: 9999px;
}

/* ─────────────────────────────────────────────────────────────
   Dark Theme Variables
   ───────────────────────────────────────────────────────────── */
body.dark-theme,
[data-theme="dark"] {
    --slate-bg: #070d1d;
    --slate-card: #0f172a;
    --slate-border: #1e293b;
    --slate-text: #f8fafc;
    --slate-muted: #94a3b8;
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.7);
}

body.dark-theme .app-topbar {
    background: rgba(15, 23, 42, 0.94);
    border-bottom-color: #1e293b;
}

body.dark-theme .topbar-breadcrumb-parent {
    color: #94a3b8;
}

body.dark-theme .topbar-breadcrumb-current {
    color: #f8fafc;
}

body.dark-theme .topbar-toggle-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-theme .topbar-currency-badge {
    background: #27271a;
    border-color: #785a15;
    color: #fde047;
}

body.dark-theme .topbar-user-chip {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-theme .topbar-user-name {
    color: #f8fafc;
}

body.dark-theme .table th {
    background-color: #0b1329;
    color: #94a3b8;
    border-bottom-color: #1e293b;
}

body.dark-theme .table td {
    color: #e2e8f0;
    border-bottom-color: #1a2744;
}

body.dark-theme .table tr:hover td {
    background-color: #162444;
}

body.dark-theme .stat-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark-theme .stat-card .value {
    color: #f8fafc;
}

body.dark-theme .card-footer {
    background-color: #0b1329;
    border-top-color: #1e293b;
}

body.dark-theme .form-group label {
    color: #cbd5e1;
}

body.dark-theme .form-group input,
body.dark-theme .form-group select,
body.dark-theme .form-group textarea,
body.dark-theme .input {
    background-color: #070d1d;
    border-color: #1e293b;
    color: #f8fafc;
}

body.dark-theme .btn-secondary {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}
body.dark-theme .btn-secondary:hover {
    background: #334155;
    color: #ffffff;
}

/* Theme Toggle Button Style */
.theme-toggle-btn {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid var(--slate-border);
    color: #334155;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}
body.dark-theme .theme-toggle-btn {
    background: #1e293b;
    border-color: #334155;
    color: #fbbf24;
}
.theme-toggle-btn:hover {
    transform: scale(1.08);
}

/* Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 15px;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    background-color: var(--slate-bg);
    color: var(--slate-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    letter-spacing: -0.015em;
    font-weight: 700;
}

.font-mono,
.font-numbers,
.stat-card-value,
.badge-mono {
    font-family: var(--font-numbers) !important;
    font-feature-settings: 'tnum' on, 'lnum' on;
}

/* ─────────────────────────────────────────────────────────────
   Modern Sidebar (Collapsible & RTL Native)
   ───────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0b1329 0%, #111e38 50%, #0d172e 100%);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.18);
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: var(--topbar-height);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: #ffffff;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    transition: opacity 0.2s ease, max-width 0.28s ease;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    display: block;
    line-height: 1.2;
}

.sidebar-brand-badge {
    display: block;
    font-size: 0.7rem;
    color: #38bdf8;
    font-weight: 700;
}

.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #94a3b8;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    padding: 1rem 0.85rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.4rem 0.75rem 0.2rem;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.sidebar-link-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sidebar-link-text {
    transition: opacity 0.2s ease;
}

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-3px);
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.38);
    font-weight: 700;
}

.sidebar-footer {
    padding: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-portal-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    color: #34d399;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.84rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-portal-btn:hover {
    background: rgba(16, 185, 129, 0.22);
    color: #6ee7b7;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: #fca5a5;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.84rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fee2e2;
}

/* ─────────────────────────────────────────────────────────────
   Desktop Collapsed Sidebar Mode
   ───────────────────────────────────────────────────────────── */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-link-text,
body.sidebar-collapsed .sidebar-section-label {
    opacity: 0;
    pointer-events: none;
    display: none;
}

body.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-portal-btn,
body.sidebar-collapsed .sidebar-logout-btn {
    justify-content: center;
    padding: 0.75rem 0;
}

body.sidebar-collapsed .sidebar-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─────────────────────────────────────────────────────────────
   Unified App Topbar
   ───────────────────────────────────────────────────────────── */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-border);
    margin-right: var(--sidebar-width);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    transition: margin-right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed .app-topbar {
    margin-right: var(--sidebar-collapsed-width);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-toggle-btn {
    background: #f1f5f9;
    border: 1px solid var(--slate-border);
    color: #334155;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-toggle-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.04);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    font-weight: 700;
}

.topbar-breadcrumb-parent {
    color: var(--slate-muted);
}

.topbar-breadcrumb-sep {
    color: #cbd5e1;
}

.topbar-breadcrumb-current {
    color: #0f172a;
    display: flex;
    align-items: center;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.topbar-currency-badge {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 800;
}

.topbar-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.topbar-btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
}
.topbar-btn-primary:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.topbar-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
}
.topbar-btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.topbar-user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #f8fafc;
    border: 1px solid var(--slate-border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
}

.topbar-user-avatar {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.topbar-user-info {
    line-height: 1.1;
}

.topbar-user-name {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
}

.topbar-user-status {
    font-size: 0.68rem;
    color: #10b981;
    font-weight: 700;
}

.topbar-user-logout {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.2rem;
    transition: color 0.2s ease;
}
.topbar-user-logout:hover {
    color: #ef4444;
}

/* ─────────────────────────────────────────────────────────────
   Main Content Layout
   ───────────────────────────────────────────────────────────── */
main,
.app-main,
footer {
    margin-right: var(--sidebar-width);
    transition: margin-right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

body.no-sidebar main,
body.no-sidebar .app-main,
body.no-sidebar footer,
body.no-sidebar header,
body.no-sidebar .app-topbar {
    margin-right: 0 !important;
}

body.sidebar-collapsed main,
body.sidebar-collapsed .app-main,
body.sidebar-collapsed footer {
    margin-right: var(--sidebar-collapsed-width);
}

.sidebar-placeholder {
    display: contents;
}

/* ─────────────────────────────────────────────────────────────
   Mobile & Tablet Off-Canvas Drawer (<= 992px)
   ───────────────────────────────────────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.25s ease;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
        width: 280px !important;
    }

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

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

    .app-topbar,
    main,
    .app-main,
    footer,
    body.sidebar-collapsed .app-topbar,
    body.sidebar-collapsed main,
    body.sidebar-collapsed .app-main,
    body.sidebar-collapsed footer {
        margin-right: 0 !important;
    }

    .topbar-actions-group {
        display: none;
    }

    .sidebar-collapse-btn {
        display: none;
    }

    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .sidebar-link-text,
    body.sidebar-collapsed .sidebar-section-label {
        opacity: 1 !important;
        pointer-events: auto !important;
        display: block !important;
    }

    body.sidebar-collapsed .sidebar-link {
        justify-content: flex-start !important;
        padding: 0.7rem 0.9rem !important;
    }
}

@media (max-width: 576px) {
    .topbar-currency-badge {
        display: none;
    }
    .topbar-breadcrumb-parent,
    .topbar-breadcrumb-sep {
        display: none;
    }
    .app-topbar {
        padding: 0 1rem;
    }
}

/* ─────────────────────────────────────────────────────────────
   Container & Cards
   ───────────────────────────────────────────────────────────── */
.container-max {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.narrow-container {
    max-width: 860px;
}

.card {
    background: var(--slate-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--slate-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .card-body {
        padding: 2rem;
    }
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--slate-border);
    background-color: #f8fafc;
}

/* ─────────────────────────────────────────────────────────────
   Unified Modern Stat Cards & Boxes (2026 UI Architecture)
   ───────────────────────────────────────────────────────────── */
.stats-grid-responsive {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 540px) {
    .stats-grid-responsive {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .stats-grid-responsive {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1536px) {
    .stats-grid-responsive {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 540px) {
    .stats-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .stats-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Base Card Pro */
.stat-card-pro {
    background: var(--slate-card);
    border-radius: 1.25rem;
    border: 1px solid var(--slate-border);
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    padding: 1.25rem 1.35rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 128px;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.35s ease, 
                border-color 0.35s ease;
    animation: statCardFadeIn 0.5s ease-out both;
}

.stat-card-pro:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

/* Subtle top gradient bar */
.stat-card-pro::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--stat-accent, #0284c7);
    border-radius: 1.25rem 1.25rem 0 0;
    opacity: 0.9;
}

/* Background watermark icon */
.stat-card-pro .stat-watermark {
    position: absolute;
    left: -0.75rem;
    bottom: -0.75rem;
    font-size: 5rem;
    opacity: 0.04;
    color: var(--stat-accent, currentColor);
    pointer-events: none;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.stat-card-pro:hover .stat-watermark {
    transform: scale(1.15) rotate(-8deg);
    opacity: 0.08;
}

/* Icon bubble */
.stat-icon-bubble {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--stat-bg, #e0f2fe);
    color: var(--stat-color, #0284c7);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card-pro:hover .stat-icon-bubble {
    transform: scale(1.12) rotate(6deg);
}

/* Head row inside card */
.stat-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.stat-card-info {
    flex: 1;
    min-width: 0;
}

.stat-card-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card-value {
    font-size: clamp(1.15rem, 1.8vw, 1.6rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0.25rem 0;
    color: var(--stat-val-color, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.stat-card-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    white-space: nowrap;
}

/* Color theme presets */
.stat-theme-blue {
    --stat-accent: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
    --stat-bg: #e0f2fe;
    --stat-color: #0284c7;
    --stat-val-color: #0f172a;
}
.stat-theme-red {
    --stat-accent: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    --stat-bg: #fee2e2;
    --stat-color: #ef4444;
    --stat-val-color: #dc2626;
}
.stat-theme-amber {
    --stat-accent: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    --stat-bg: #fef3c7;
    --stat-color: #d97706;
    --stat-val-color: #b45309;
}
.stat-theme-purple {
    --stat-accent: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
    --stat-bg: #ede9fe;
    --stat-color: #7c3aed;
    --stat-val-color: #6d28d9;
}
.stat-theme-emerald {
    --stat-accent: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    --stat-bg: #d1fae5;
    --stat-color: #059669;
    --stat-val-color: #047857;
}
.stat-theme-slate {
    --stat-accent: linear-gradient(90deg, #334155 0%, #64748b 100%);
    --stat-bg: #f1f5f9;
    --stat-color: #334155;
    --stat-val-color: #1e293b;
}

/* Dark mode stat card overrides */
body.dark-theme .stat-card-pro {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}
body.dark-theme .stat-theme-blue { --stat-bg: rgba(2, 132, 199, 0.18); --stat-val-color: #f8fafc; }
body.dark-theme .stat-theme-red { --stat-bg: rgba(239, 68, 68, 0.18); --stat-val-color: #f87171; }
body.dark-theme .stat-theme-amber { --stat-bg: rgba(245, 158, 11, 0.18); --stat-val-color: #fbbf24; }
body.dark-theme .stat-theme-purple { --stat-bg: rgba(139, 92, 246, 0.18); --stat-val-color: #c084fc; }
body.dark-theme .stat-theme-emerald { --stat-bg: rgba(16, 185, 129, 0.18); --stat-val-color: #34d399; }
body.dark-theme .stat-theme-slate { --stat-bg: rgba(71, 85, 105, 0.25); --stat-val-color: #cbd5e1; }

@keyframes statCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Entrance Animations */
.stats-grid-responsive > :nth-child(1), .stats-grid-4 > :nth-child(1) { animation-delay: 0.04s; }
.stats-grid-responsive > :nth-child(2), .stats-grid-4 > :nth-child(2) { animation-delay: 0.08s; }
.stats-grid-responsive > :nth-child(3), .stats-grid-4 > :nth-child(3) { animation-delay: 0.12s; }
.stats-grid-responsive > :nth-child(4), .stats-grid-4 > :nth-child(4) { animation-delay: 0.16s; }
.stats-grid-responsive > :nth-child(5) { animation-delay: 0.20s; }
.stats-grid-responsive > :nth-child(6) { animation-delay: 0.24s; }

/* Enhanced theme hover glows */
.stat-theme-blue:hover {
    border-color: #7dd3fc;
    box-shadow: 0 16px 32px -4px rgba(2, 132, 199, 0.15), 0 4px 12px rgba(2, 132, 199, 0.08);
}
.stat-theme-red:hover {
    border-color: #fca5a5;
    box-shadow: 0 16px 32px -4px rgba(239, 68, 68, 0.15), 0 4px 12px rgba(239, 68, 68, 0.08);
}
.stat-theme-amber:hover {
    border-color: #fcd34d;
    box-shadow: 0 16px 32px -4px rgba(245, 158, 11, 0.15), 0 4px 12px rgba(245, 158, 11, 0.08);
}
.stat-theme-purple:hover {
    border-color: #c4b5fd;
    box-shadow: 0 16px 32px -4px rgba(139, 92, 246, 0.15), 0 4px 12px rgba(139, 92, 246, 0.08);
}
.stat-theme-emerald:hover {
    border-color: #6ee7b7;
    box-shadow: 0 16px 32px -4px rgba(16, 185, 129, 0.15), 0 4px 12px rgba(16, 185, 129, 0.08);
}
.stat-theme-slate:hover {
    border-color: #cbd5e1;
    box-shadow: 0 16px 32px -4px rgba(71, 85, 105, 0.15), 0 4px 12px rgba(71, 85, 105, 0.08);
}

@media (max-width: 640px) {
    .stat-card-pro {
        padding: 1rem 1.15rem;
        min-height: 110px;
    }
    .stat-icon-bubble {
        width: 2.65rem;
        height: 2.65rem;
        font-size: 1.1rem;
    }
    .stat-card-value {
        font-size: 1.35rem;
    }
}


/* ─────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-subtle);
}

.btn:active {
    transform: scale(0.98);
}

/* ─────────────────────────────────────────────────────────────
   Solid High-Contrast Button Variants (Guaranteed styling)
   ───────────────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid #0284c7 !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
    color: #ffffff !important;
}

.btn-success, .btn-emerald, .btn-whatsapp {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: 1px solid #059669 !important;
}
.btn-success:hover, .btn-emerald:hover, .btn-whatsapp:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
    color: #ffffff !important;
}

.btn-danger, .btn-rose, .btn-pdf {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    color: #ffffff !important;
    border: 1px solid #e11d48 !important;
}
.btn-danger:hover, .btn-rose:hover, .btn-pdf:hover {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4) !important;
    color: #ffffff !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    border: 1px solid #d97706 !important;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
    color: #ffffff !important;
}

.btn-thermal, .btn-dark, .btn-slate {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
    color: #ffffff !important;
    border: 1px solid #1e293b !important;
}
.btn-thermal:hover, .btn-dark:hover, .btn-slate:hover {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    box-shadow: 0 4px 14px rgba(30, 41, 59, 0.4) !important;
    color: #ffffff !important;
}

.btn-purple {
    background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%) !important;
    color: #ffffff !important;
    border: 1px solid #7e22ce !important;
}
.btn-purple:hover {
    background: linear-gradient(135deg, #7e22ce 0%, #6b21a8 100%) !important;
    box-shadow: 0 4px 14px rgba(147, 51, 234, 0.4) !important;
    color: #ffffff !important;
}

.btn-secondary, .btn-account {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1.5px solid #cbd5e1 !important;
    font-weight: 700;
}
.btn-secondary:hover, .btn-account:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}
body.dark-theme .btn-secondary,
body.dark-theme .btn-account {
    background: #1e293b !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}
body.dark-theme .btn-secondary:hover,
body.dark-theme .btn-account:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

.btn-light {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1 !important;
}
.btn-light:hover {
    background: #e2e8f0 !important;
    color: #0284c7 !important;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

/* ─────────────────────────────────────────────────────────────
   Modern Product Card & WhatsApp Order Showcase
   ───────────────────────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--slate-card);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.12);
    border-color: var(--primary);
}

.product-image-box {
    position: relative;
    width: 100%;
    height: 180px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
body.dark-theme .product-image-box {
    background: #070d1d;
}
.product-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-image-box img {
    transform: scale(1.06);
}

.product-info-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.btn-wa-order {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
}
.btn-wa-order:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────────────
   Badges
   ───────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* ─────────────────────────────────────────────────────────────
   Forms & Inputs
   ───────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea,
.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.15);
    background-color: #ffffff;
}

/* ─────────────────────────────────────────────────────────────
   Tables
   ───────────────────────────────────────────────────────────── */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    text-align: right;
    border-collapse: collapse;
}

.table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 800;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.95rem 1.1rem;
    border-bottom: 1.5px solid var(--slate-border);
}

.table td {
    padding: 1rem 1.1rem;
    color: #1e293b;
    font-size: 0.88rem;
    border-bottom: 1px solid #f1f5f9;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: #f8fafc;
}

/* ─────────────────────────────────────────────────────────────
   Alerts
   ───────────────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-right: 4px solid;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #b45309;
}

.alert-info {
    background-color: #f0f9ff;
    border-color: #0284c7;
    color: #0369a1;
}

/* ─────────────────────────────────────────────────────────────
   KPI Statistics Cards
   ───────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-border);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--slate-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.stat-card .value {
    font-size: 1.85rem;
    font-weight: 900;
    color: #0f172a;
    font-family: var(--font-primary);
}

.stat-card .subtitle {
    font-size: 0.78rem;
    color: var(--slate-muted);
    margin-top: 0.35rem;
}

/* ─────────────────────────────────────────────────────────────
   Tom-Select, Flatpickr & SweetAlert2 Modern Styling (RTL & Dark Mode)
   ───────────────────────────────────────────────────────────── */
.ts-wrapper {
    width: 100%;
}
.ts-control {
    border-radius: var(--radius-md) !important;
    border: 1.5px solid var(--slate-border) !important;
    padding: 0.65rem 0.9rem !important;
    font-family: var(--font-primary) !important;
    font-size: 0.95rem !important;
    background-color: var(--slate-card) !important;
    color: var(--slate-text) !important;
    box-shadow: var(--shadow-subtle) !important;
    transition: all 0.2s ease !important;
}
.ts-control:focus, .ts-wrapper.focus .ts-control {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}
.ts-dropdown {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--slate-border) !important;
    box-shadow: var(--shadow-hover) !important;
    background: var(--slate-card) !important;
    color: var(--slate-text) !important;
    z-index: 1000 !important;
    font-family: var(--font-primary) !important;
}
.ts-dropdown .option {
    padding: 0.6rem 0.9rem !important;
    font-size: 0.9rem !important;
    border-bottom: 1px solid var(--slate-border) !important;
}
.ts-dropdown .option:last-child {
    border-bottom: none !important;
}
.ts-dropdown .active {
    background-color: var(--primary-light) !important;
    color: var(--primary-dark) !important;
}
body.dark-theme .ts-dropdown .active {
    background-color: #1e3a8a !important;
    color: #93c5fd !important;
}
body.dark-theme .ts-dropdown .option {
    border-bottom-color: #1e293b !important;
}
body.dark-theme .ts-control {
    background-color: #070d1d !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Flatpickr RTL & Dark Mode */
.flatpickr-calendar {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-hover) !important;
    border: 1px solid var(--slate-border) !important;
}
body.dark-theme .flatpickr-calendar {
    background: #0f172a !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}
body.dark-theme .flatpickr-day {
    color: #e2e8f0 !important;
}
body.dark-theme .flatpickr-day.today {
    border-color: var(--primary) !important;
}
body.dark-theme .flatpickr-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}
body.dark-theme .flatpickr-months .flatpickr-month,
body.dark-theme .flatpickr-current-month .flatpickr-monthDropdown-months,
body.dark-theme span.flatpickr-weekday {
    background: #0f172a !important;
    color: #f8fafc !important;
}

/* SweetAlert2 RTL Theme Overrides */
.swal2-popup {
    font-family: var(--font-primary) !important;
    border-radius: var(--radius-xl) !important;
}
body.dark-theme .swal2-popup {
    background: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #1e293b !important;
}
body.dark-theme .swal2-title {
    color: #f8fafc !important;
}
body.dark-theme .swal2-html-container {
    color: #94a3b8 !important;
}

/* Chart Canvas Card */
.chart-container-card {
    position: relative;
    width: 100%;
    min-height: 280px;
}

/* Print Overrides */
@media print {
    .sidebar, .app-topbar, .sidebar-backdrop, .no-print {
        display: none !important;
    }
    main,
    .app-main,
    footer {
        margin: 0 !important;
        padding: 0 !important;
    }
    body {
        background: #ffffff !important;
        font-size: 12pt;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* ─────────────────────────────────────────────────────────────
   Tabulator Modern Rounded Styling & Seamless Integration
   ───────────────────────────────────────────────────────────── */
.tabulator {
    border: none !important;
    background-color: transparent !important;
    font-family: var(--font-primary) !important;
    font-size: 0.9rem !important;
}

.tabulator .tabulator-header {
    background-color: #f8fafc !important;
    border-bottom: 1.5px solid var(--slate-border) !important;
    color: #475569 !important;
    font-weight: 800 !important;
    border-top: none !important;
}

body.dark-theme .tabulator .tabulator-header {
    background-color: #0b1329 !important;
    border-bottom-color: #1e293b !important;
    color: #94a3b8 !important;
}

.tabulator .tabulator-header .tabulator-col {
    background-color: transparent !important;
    border-right: none !important;
    padding: 0.85rem 0.75rem !important;
}

.tabulator .tabulator-row {
    background-color: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    transition: background-color 0.15s ease !important;
}

.tabulator .tabulator-row:hover {
    background-color: #f8fafc !important;
}

body.dark-theme .tabulator .tabulator-row {
    background-color: #0f172a !important;
    border-bottom-color: #1a2744 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .tabulator .tabulator-row:hover {
    background-color: #162444 !important;
}

.tabulator .tabulator-row .tabulator-cell {
    border-right: none !important;
    padding: 0.85rem 0.75rem !important;
    vertical-align: middle !important;
}

.tabulator .tabulator-footer {
    background-color: #f8fafc !important;
    border-top: 1px solid var(--slate-border) !important;
    padding: 0.75rem 1rem !important;
    color: #64748b !important;
}

body.dark-theme .tabulator .tabulator-footer {
    background-color: #0b1329 !important;
    border-top-color: #1e293b !important;
    color: #94a3b8 !important;
}

.tabulator-page {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--slate-border) !important;
    padding: 0.35rem 0.75rem !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    margin: 0 0.15rem !important;
    transition: all 0.15s ease !important;
}

.tabulator-page.active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

/* ─────────────────────────────────────────────────────────────
   Premium Action Buttons (Edit, Delete, View)
   ───────────────────────────────────────────────────────────── */
.action-btn-group {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.action-btn:hover {
    transform: translateY(-2px) scale(1.08);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn-edit {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}
.action-btn-edit:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.action-btn-delete {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}
.action-btn-delete:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.action-btn-view {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}
.action-btn-view:hover {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

body.dark-theme .action-btn-edit {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
    border-color: rgba(37, 99, 235, 0.3);
}
body.dark-theme .action-btn-edit:hover {
    background: #2563eb;
    color: #ffffff;
}

body.dark-theme .action-btn-delete {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.3);
}
body.dark-theme .action-btn-delete:hover {
    background: #dc2626;
    color: #ffffff;
}

body.dark-theme .action-btn-view {
    background: rgba(22, 163, 74, 0.15);
    color: #86efac;
    border-color: rgba(22, 163, 74, 0.3);
}
body.dark-theme .action-btn-view:hover {
    background: #16a34a;
    color: #ffffff;
}

/* ==========================================================================
   Customer Portal Dedicated Design System 2026 (Ultra-Modern, RTL Native)
   ========================================================================== */

/* ─── 1. Hero Welcome Banner ─── */
.portal-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e1b4b 100%) !important;
    color: #ffffff !important;
    border-radius: var(--radius-2xl);
    padding: 1.75rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.35);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.portal-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.portal-hero-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.portal-user-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.portal-user-avatar {
    width: 3.85rem;
    height: 3.85rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.4) 0%, rgba(99, 102, 241, 0.4) 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.15);
}

.portal-welcome-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #38bdf8;
    margin-bottom: 0.35rem;
}

.portal-status-dot {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
}

.portal-hero-title {
    font-size: 1.65rem;
    font-weight: 900;
    color: #ffffff !important;
    line-height: 1.2;
    margin: 0;
}

.portal-hero-subtitle {
    font-size: 0.88rem;
    color: #94a3b8 !important;
    margin-top: 0.25rem;
}

.portal-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ─── 2. Financial Stats Grid ─── */
.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .portal-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .portal-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.portal-stat-card {
    background: var(--slate-card);
    border: 1px solid var(--slate-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    height: 100%;
}

.portal-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.1);
}

.portal-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.portal-stat-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--slate-muted);
    text-transform: uppercase;
}

.portal-stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.portal-stat-value {
    font-size: 1.85rem;
    font-weight: 900;
    font-family: var(--font-primary), monospace;
    line-height: 1.2;
    margin-bottom: 0.6rem;
}

.portal-stat-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 800;
}

/* Specific Stat Card Colors */
.stat-debt-danger .portal-stat-icon {
    background: #fee2e2;
    color: #dc2626;
}
.stat-debt-danger .portal-stat-value {
    color: #dc2626;
}
.stat-debt-danger .portal-stat-tag {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.stat-debt-success .portal-stat-icon {
    background: #d1fae5;
    color: #059669;
}
.stat-debt-success .portal-stat-value {
    color: #059669;
}
.stat-debt-success .portal-stat-tag {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.stat-paid .portal-stat-icon {
    background: #dcfce7;
    color: #16a34a;
}
.stat-paid .portal-stat-value {
    color: #16a34a;
}
.stat-paid-sub {
    font-size: 0.8rem;
    color: var(--slate-muted);
}

.stat-invoices .portal-stat-icon {
    background: #ede9fe;
    color: #7c3aed;
}
.stat-invoices .portal-stat-value {
    color: #7c3aed;
}

/* Dark mode stat overrides */
body.dark-theme .stat-debt-danger .portal-stat-icon {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}
body.dark-theme .stat-debt-success .portal-stat-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}
body.dark-theme .stat-paid .portal-stat-icon {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}
body.dark-theme .stat-invoices .portal-stat-icon {
    background: rgba(124, 58, 237, 0.2);
    color: #a78bfa;
}

/* ─── 3. Progress Percentage Bar ─── */
.portal-progress-card {
    background: var(--slate-card);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-xl);
    padding: 1.35rem 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.portal-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.portal-progress-track {
    width: 100%;
    height: 0.85rem;
    background: #e2e8f0;
    border-radius: var(--radius-pill);
    overflow: hidden;
    padding: 2px;
}
body.dark-theme .portal-progress-track {
    background: #1e293b;
}

.portal-progress-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-progress-fill.completed {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.portal-progress-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.65rem;
    font-size: 0.82rem;
    color: var(--slate-muted);
}

/* ─── 4. Catalog Highlight Banner ─── */
.portal-catalog-banner {
    background: linear-gradient(135deg, #0284c7 0%, #4338ca 100%) !important;
    border-radius: var(--radius-2xl);
    padding: 1.5rem 2rem;
    color: #ffffff !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
    box-shadow: 0 12px 28px -6px rgba(2, 132, 199, 0.35);
}

.portal-catalog-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.portal-catalog-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.portal-catalog-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #ffffff !important;
    margin: 0;
}

.portal-catalog-desc {
    font-size: 0.88rem;
    color: #e0f2fe !important;
    margin-top: 0.25rem;
}

.portal-catalog-btn {
    background: #ffffff !important;
    color: #0369a1 !important;
    font-weight: 900;
    font-size: 0.92rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.portal-catalog-btn:hover {
    background: #f0f9ff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ─── 5. Pending Weekly Withdrawals (مسحوبات الأسبوع الحالي) ─── */
.portal-pending-card {
    background: var(--slate-card);
    border: 1.5px solid #fde68a !important;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    margin-bottom: 2.25rem;
    overflow: hidden;
}
body.dark-theme .portal-pending-card {
    border-color: #854d0e !important;
}

.portal-pending-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-bottom: 1.5px solid #fde68a;
    padding: 1.25rem 1.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
body.dark-theme .portal-pending-header {
    background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
    border-bottom-color: #78350f;
}

.portal-pending-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-pending-header-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-lg);
    background: #d97706;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

.portal-pending-main-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #78350f;
    margin: 0;
}
body.dark-theme .portal-pending-main-title {
    color: #fde68a;
}

.portal-pending-sub {
    font-size: 0.8rem;
    color: #92400e;
    margin-top: 0.15rem;
}
body.dark-theme .portal-pending-sub {
    color: #d97706;
}

.portal-pending-badge-total {
    background: #fffbeb;
    border: 1.5px solid #f59e0b;
    color: #b45309;
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    font-weight: 800;
}
body.dark-theme .portal-pending-badge-total {
    background: #1c1917;
    border-color: #d97706;
    color: #fde68a;
}

.portal-pending-body {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.portal-product-group {
    background: #ffffff;
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
}
body.dark-theme .portal-product-group {
    background: #0b1329;
    border-color: #1e293b;
}

.portal-product-group-head {
    background: #f8fafc;
    border-bottom: 1px solid var(--slate-border);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
body.dark-theme .portal-product-group-head {
    background: #070d1d;
    border-bottom-color: #1e293b;
}

.portal-prod-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--slate-text);
}

.portal-prod-sku {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--slate-muted);
    background: #e2e8f0;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}
body.dark-theme .portal-prod-sku {
    background: #1e293b;
    color: #94a3b8;
}

.portal-prod-total-pill {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-pill);
}
body.dark-theme .portal-prod-total-pill {
    background: #27271a;
    border-color: #785a15;
    color: #fde047;
}

.portal-days-grid {
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
}

.portal-day-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}
.portal-day-item:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}
body.dark-theme .portal-day-item {
    background: #070d1d;
    border-color: #1e293b;
}
body.dark-theme .portal-day-item:hover {
    background: #0f172a;
    border-color: #334155;
}

.portal-day-info {
    line-height: 1.3;
}

.portal-day-date {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--slate-text);
    display: block;
}

.portal-day-note {
    font-size: 0.74rem;
    color: var(--slate-muted);
}

.portal-day-qty {
    font-family: var(--font-primary), monospace;
    font-size: 0.95rem;
    font-weight: 900;
    color: #0369a1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.dark-theme .portal-day-qty {
    background: #1e293b;
    border-color: #334155;
    color: #38bdf8;
}

.portal-info-notice {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-xl);
    padding: 1rem 1.35rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    color: #78350f;
    font-size: 0.86rem;
    line-height: 1.5;
}
body.dark-theme .portal-info-notice {
    background: #1c1917;
    border-color: #78350f;
    color: #fde68a;
}
.portal-info-notice i {
    font-size: 1.35rem;
    color: #d97706;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

/* ─── 6. Invoices Accordion Section ─── */
.portal-invoices-card {
    background: var(--slate-card);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card);
    margin-bottom: 2.25rem;
    overflow: hidden;
}

.portal-invoices-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--slate-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.invoice-row-btn {
    width: 100%;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--slate-border);
    cursor: pointer;
    text-align: right;
    transition: background-color 0.15s ease;
    font-family: inherit;
}
.invoice-row-btn:hover {
    background-color: #f8fafc;
}
body.dark-theme .invoice-row-btn:hover {
    background-color: #0b1329;
}

.invoice-main-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 240px;
}

.invoice-icon-badge {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-lg);
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
body.dark-theme .invoice-icon-badge {
    background: rgba(2, 132, 199, 0.15);
    border-color: rgba(2, 132, 199, 0.3);
    color: #38bdf8;
}

.invoice-no-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0284c7;
}

.invoice-period-text {
    font-size: 0.78rem;
    color: var(--slate-muted);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.invoice-price-block {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.invoice-price-val {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--slate-text);
    font-family: var(--font-primary), monospace;
}

.invoice-chevron {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: var(--radius-pill);
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: transform 0.25s ease;
}
body.dark-theme .invoice-chevron {
    background: #1e293b;
    color: #94a3b8;
}

.invoice-row-btn[aria-expanded="true"] .invoice-chevron {
    transform: rotate(180deg);
    background: #0284c7;
    color: #ffffff;
}

.invoice-expand-panel {
    background: #f8fafc;
    border-bottom: 1px solid var(--slate-border);
    padding: 1.5rem 1.75rem;
}
body.dark-theme .invoice-expand-panel {
    background: #070d1d;
}

.invoice-period-ribbon {
    background: linear-gradient(135deg, #0284c7 0%, #3b82f6 100%);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

/* ─── 7. Mobile Responsive Overrides ─── */
@media (max-width: 768px) {
    .portal-hero {
        padding: 1.25rem 1.35rem;
    }
    .portal-hero-title {
        font-size: 1.35rem;
    }
    .portal-user-avatar {
        width: 3.25rem;
        height: 3.25rem;
        font-size: 1.4rem;
    }
    .portal-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .portal-pending-header {
        padding: 1rem 1.25rem;
    }
    .portal-pending-body {
        padding: 1.25rem 1rem;
    }
    .portal-days-grid {
        grid-template-columns: 1fr;
    }
    .invoice-row-btn {
        padding: 1rem;
    }
    .invoice-price-val {
        font-size: 1.15rem;
    }
    .portal-catalog-banner {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   Modern Product Catalog Design System (E-Commerce Luxury & WhatsApp Ordering)
   ========================================================================== */

/* ─── 1. Catalog Hero Banner ─── */
.catalog-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0369a1 100%) !important;
    color: #ffffff !important;
    border-radius: var(--radius-2xl);
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 16px 36px -8px rgba(2, 132, 199, 0.3);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.catalog-hero-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    position: relative;
    z-index: 2;
}

.catalog-hero-meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.catalog-hero-icon {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3) 0%, rgba(99, 102, 241, 0.3) 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.2);
}

.catalog-hero-title {
    font-size: 1.65rem;
    font-weight: 900;
    color: #ffffff !important;
    line-height: 1.2;
    margin: 0;
}

.catalog-hero-subtitle {
    font-size: 0.88rem;
    color: #cbd5e1 !important;
    margin-top: 0.25rem;
}

/* ─── 2. Search & Filter Bar ─── */
.catalog-toolbar-card {
    background: var(--slate-card);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-2xl);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-card);
}

.catalog-toolbar-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.catalog-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.catalog-search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.catalog-search-box i {
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-muted);
    font-size: 1rem;
    pointer-events: none;
}

.catalog-search-input {
    width: 100%;
    height: 3rem;
    padding: 0 3rem 0 1.25rem;
    background: #f8fafc;
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius-xl);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--slate-text);
    outline: none;
    transition: all 0.2s ease;
}
body.dark-theme .catalog-search-input {
    background: #070d1d;
    border-color: #1e293b;
    color: #f8fafc;
}
.catalog-search-input:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}
body.dark-theme .catalog-search-input:focus {
    background: #0f172a;
}

.catalog-tabs-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid var(--slate-border);
    padding-top: 0.85rem;
}

.catalog-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1.15rem;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--slate-muted);
    background: #f1f5f9;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
body.dark-theme .catalog-tab-btn {
    background: #1e293b;
    color: #94a3b8;
}
.catalog-tab-btn:hover {
    background: #e2e8f0;
    color: var(--slate-text);
}
body.dark-theme .catalog-tab-btn:hover {
    background: #334155;
    color: #f8fafc;
}
.catalog-tab-btn.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

/* ─── 3. Modern Product Cards Grid ─── */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.catalog-card {
    background: var(--slate-card);
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}
.catalog-card:hover {
    transform: translateY(-5px);
    border-color: #0284c7;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15);
}

.catalog-media {
    position: relative;
    width: 100%;
    height: 190px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f8fafc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--slate-border);
}
body.dark-theme .catalog-media {
    background: linear-gradient(135deg, #0b1329 0%, #111e38 100%);
}

.catalog-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.catalog-card:hover .catalog-media-img {
    transform: scale(1.06);
}

.catalog-media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #0284c7;
    opacity: 0.85;
}
.catalog-media-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 10px rgba(2, 132, 199, 0.2));
}

.catalog-type-pill {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    backdrop-filter: blur(8px);
    z-index: 5;
}
.pill-tiered {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.pill-fixed {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.catalog-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.catalog-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.catalog-prod-name {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--slate-text);
    line-height: 1.3;
    margin: 0;
}

.catalog-sku-tag {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--slate-muted);
    background: #f1f5f9;
    border: 1px solid var(--slate-border);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}
body.dark-theme .catalog-sku-tag {
    background: #1e293b;
    color: #94a3b8;
}

.catalog-price-highlight {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
body.dark-theme .catalog-price-highlight {
    background: #070d1d;
    border-color: #1e293b;
}

.catalog-price-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--slate-muted);
}

.catalog-price-main {
    font-family: var(--font-primary), monospace;
    font-size: 1.1rem;
    font-weight: 900;
    color: #0284c7;
}

/* ─── 4. Tiered Pricing Visual Table ─── */
.catalog-tiers-container {
    background: #ffffff;
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
body.dark-theme .catalog-tiers-container {
    background: #0b1329;
    border-color: #1e293b;
}

.catalog-tiers-head {
    background: #f1f5f9;
    padding: 0.45rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--slate-muted);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--slate-border);
}
body.dark-theme .catalog-tiers-head {
    background: #070d1d;
}

.catalog-tier-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.75rem;
    font-size: 0.76rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--slate-text);
    transition: background-color 0.2s ease;
}
body.dark-theme .catalog-tier-row {
    border-bottom-color: #1e293b;
}
.catalog-tier-row:last-child {
    border-bottom: none;
}
.catalog-tier-row.active-tier {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    font-weight: 800;
    border-right: 3px solid #10b981;
}
body.dark-theme .catalog-tier-row.active-tier {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

.catalog-tier-price {
    font-family: var(--font-primary), monospace;
    font-weight: 900;
}

/* ─── 5. Interactive Order Box ─── */
.catalog-order-wrapper {
    background: #f8fafc;
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius-xl);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
body.dark-theme .catalog-order-wrapper {
    background: #070d1d;
    border-color: #1e293b;
}

.catalog-qty-stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.catalog-qty-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--slate-text);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.catalog-stepper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid var(--slate-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
body.dark-theme .catalog-stepper {
    background: #0f172a;
    border-color: #334155;
}

.catalog-step-btn {
    width: 2rem;
    height: 2.2rem;
    background: #f1f5f9;
    border: none;
    color: var(--slate-text);
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}
body.dark-theme .catalog-step-btn {
    background: #1e293b;
    color: #f8fafc;
}
.catalog-step-btn:hover {
    background: #e2e8f0;
}
body.dark-theme .catalog-step-btn:hover {
    background: #334155;
}

.catalog-qty-input {
    width: 3.8rem;
    height: 2.2rem;
    border: none;
    text-align: center;
    font-family: var(--font-primary), monospace;
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--slate-text);
    background: transparent;
    outline: none;
}

.catalog-live-subtotal {
    background: #f0fdf4;
    border: 1px dashed #86efac;
    border-radius: var(--radius-md);
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    color: #166534;
}
body.dark-theme .catalog-live-subtotal {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.btn-wa-order-modern {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-weight: 800;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 100%;
}
.btn-wa-order-modern:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
    transform: translateY(-2px);
}
.btn-wa-order-modern:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .catalog-hero {
        padding: 1.25rem 1.35rem;
    }
    .catalog-hero-title {
        font-size: 1.35rem;
    }
    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ==========================================================================
   Add-Operation / Withdrawals Form Modern Enhancements
   ========================================================================== */
.op-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

body.dark-theme .op-card {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
}

.op-customer-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

body.dark-theme .op-customer-box {
    background: linear-gradient(135deg, #111e38 0%, #0d172e 100%);
    border-color: #1e293b;
}

.op-items-wrapper {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
}

body.dark-theme .op-items-wrapper {
    background: #0b1329;
    border-color: #1e293b;
}

/* Row Styling */
.item-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1.15rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme .item-row {
    background: #111e38;
    border-color: #1e293b;
}

.item-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.dark-theme .item-row:hover {
    border-color: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Clean Form Controls */
.op-select {
    width: 100%;
    padding: 0.65rem 2.25rem 0.65rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.65rem;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left 0.65rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
}

body.dark-theme .op-select {
    background-color: #070d1d;
    border-color: #1e293b;
    color: #f8fafc;
}

.op-select:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.op-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.65rem;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
}

body.dark-theme .op-input {
    background-color: #070d1d;
    border-color: #1e293b;
    color: #f8fafc;
}

.op-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Quantity input with unit badge on left */
.op-qty-group {
    position: relative;
    display: flex;
    align-items: center;
}

.op-qty-input {
    width: 100%;
    padding: 0.65rem 0.5rem 0.65rem 2.8rem;
    font-size: 0.95rem;
    font-family: var(--font-primary), monospace;
    font-weight: 800;
    text-align: center;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.65rem;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
}

body.dark-theme .op-qty-input {
    background-color: #070d1d;
    border-color: #1e293b;
    color: #f8fafc;
}

.op-qty-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.op-qty-badge {
    position: absolute;
    left: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    color: #475569;
    padding: 0.2rem 0.55rem;
    border-radius: 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    pointer-events: none;
    border: 1px solid #e2e8f0;
}

body.dark-theme .op-qty-badge {
    background: #1e293b;
    color: #94a3b8;
    border-color: #334155;
}

/* Note / file input with icon on right */
.op-note-group {
    position: relative;
    display: flex;
    align-items: center;
}

.op-note-input {
    width: 100%;
    padding: 0.65rem 2.4rem 0.65rem 0.85rem;
    font-size: 0.88rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.65rem;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
}

body.dark-theme .op-note-input {
    background-color: #070d1d;
    border-color: #1e293b;
    color: #f8fafc;
}

.op-note-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.op-note-icon {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

/* Delete Row Button */
.op-delete-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.op-delete-btn:hover:not(:disabled) {
    color: #ef4444;
    background: #fef2f2;
    border-color: #fecaca;
    transform: scale(1.05);
}

body.dark-theme .op-delete-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.op-delete-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

/* Live Hint Bar */
.row-hint-bar {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
}

body.dark-theme .row-hint-bar {
    border-top-color: #1e293b;
}

/* Order Summary Live Bar */
.op-summary-bar {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid #bae6fd;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

body.dark-theme .op-summary-bar {
    background: linear-gradient(135deg, #0b1e38 0%, #0c274c 100%);
    border-color: #0369a1;
}

.op-stat-pill {
    background: #ffffff;
    padding: 0.35rem 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid #bae6fd;
    font-family: var(--font-primary), monospace;
    font-weight: 900;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

body.dark-theme .op-stat-pill {
    background: #0f172a;
    border-color: #0369a1;
}

/* Customer Type Toggle Cards */
.cust-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .cust-type-selector {
        grid-template-columns: 1fr;
    }
}

.cust-type-card {
    border: 2px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    user-select: none;
}

body.dark-theme .cust-type-card {
    background: #0b1329;
    border-color: #1e293b;
}

.cust-type-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.cust-type-card.active-type {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}

body.dark-theme .cust-type-card.active-type {
    border-color: #0284c7;
    background: rgba(2, 132, 199, 0.15);
}

.cust-type-radio {
    accent-color: #0284c7;
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
}

/* Walk-in instant settlement panel */
.walkin-settlement-panel {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1.5px solid #a7f3d0;
    border-radius: 1rem;
    padding: 1.25rem;
    margin-top: 1.25rem;
    transition: all 0.3s ease;
}

body.dark-theme .walkin-settlement-panel {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-color: #047857;
}

/* Manual Custom Item Row Styling */
.item-row.is-manual {
    border-color: #f59e0b;
    background: #fffdfa;
}

body.dark-theme .item-row.is-manual {
    border-color: #d97706;
    background: #1c1917;
}

.item-row.is-manual .op-select {
    border-color: #f59e0b;
    background-color: #fffbeb;
    color: #b45309;
    font-weight: 800;
}

body.dark-theme .item-row.is-manual .op-select {
    background-color: #292524;
    border-color: #d97706;
    color: #fde68a;
}

/* ==========================================================================
   Responsive Dashboard Grid & Split Layout Utilities
   ========================================================================== */
.dashboard-grid-split {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .dashboard-grid-split {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-12 {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
    .lg\:col-span-12 { grid-column: span 12 / span 12; }
    .lg\:col-span-8  { grid-column: span 8 / span 8; }
    .lg\:col-span-7  { grid-column: span 7 / span 7; }
    .lg\:col-span-6  { grid-column: span 6 / span 6; }
    .lg\:col-span-5  { grid-column: span 5 / span 5; }
    .lg\:col-span-4  { grid-column: span 4 / span 4; }
}



