/* ==============================================================================
   RESTAURANT & ADMIN DASHBOARD - STYLING (MATCHING SCREENSHOTS)
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* LIGHT THEME (Default, matching screenshots) */
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-elevated: #f1f5f9;
    --border-subtle: #e2e8f0;
    --border-light: #f1f5f9;
    --border-card: #e5e7eb;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-subtle: #9ca3af;

    --brand-primary: #f59e0b;
    --brand-blue: #2563eb;
    --brand-indigo: #4f46e5;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;

    /* Pill Colors (Screenshot Exact) */
    --pill-nieuw-bg: #dbeafe;
    --pill-nieuw-text: #1d4ed8;
    --pill-geaccepteerd-bg: #fef3c7;
    --pill-geaccepteerd-text: #b45309;
    --pill-onderweg-bg: #ffedd5;
    --pill-onderweg-text: #c2410c;
    --pill-bezorgd-bg: #dcfce7;
    --pill-bezorgd-text: #15803d;
    --pill-geannuleerd-bg: #fee2e2;
    --pill-geannuleerd-text: #b91c1c;

    --font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
}

/* DARK THEME SUPPORT */
body.theme-dark {
    --bg-main: #0b0f19;
    --bg-surface: #111827;
    --bg-card: #141c2e;
    --bg-elevated: #1e293b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-card: rgba(255, 255, 255, 0.1);

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --pill-nieuw-bg: rgba(37, 99, 235, 0.2);
    --pill-nieuw-text: #93c5fd;
    --pill-geaccepteerd-bg: rgba(217, 119, 6, 0.2);
    --pill-geaccepteerd-text: #fde047;
    --pill-onderweg-bg: rgba(234, 88, 12, 0.2);
    --pill-onderweg-text: #fdba74;
    --pill-bezorgd-bg: rgba(22, 163, 74, 0.2);
    --pill-bezorgd-text: #86efac;
    --pill-geannuleerd-bg: rgba(220, 38, 38, 0.2);
    --pill-geannuleerd-text: #fca5a5;
}

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

html, body {
    height: 100%;
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* APP CONTAINER */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 270px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.brand-text h1 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-text span {
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Role indicator badge in sidebar */
.role-badge-container {
    padding: 0 1.25rem 1rem;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    width: 100%;
    justify-content: center;
}

.role-admin {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

body.theme-dark .role-admin {
    background: rgba(109, 40, 217, 0.2);
    color: #c4b5fd;
    border-color: rgba(109, 40, 217, 0.4);
}

.role-restaurant {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

body.theme-dark .role-restaurant {
    background: rgba(3, 105, 161, 0.2);
    color: #7dd3fc;
    border-color: rgba(3, 105, 161, 0.4);
}

.pulse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

/* NAV ITEMS */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    width: 100%;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

body.theme-dark .nav-item.active {
    background: var(--bg-elevated);
    color: #ffffff;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    background: #e2e8f0;
    color: #334155;
    border-radius: var(--radius-pill);
}

body.theme-dark .nav-badge {
    background: #334155;
    color: #cbd5e1;
}

.account-badge {
    background: #ede9fe;
    color: #6d28d9;
}

/* SIDEBAR FOOTER & SWITCHER */
.sidebar-footer {
    padding: 1rem 1rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.view-switch-box {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 0.65rem;
    border: 1px solid var(--border-subtle);
}

.view-switch-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.view-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.view-btn {
    padding: 0.4rem 0.5rem;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.stripe-badge-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.stripe-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    animation: pulse 2s infinite;
}

.badge-info h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.badge-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.user-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
}

.user-info-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta {
    min-width: 0;
}

.user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.logout-btn:hover {
    color: var(--danger);
}

/* MAIN WRAPPER & TOPBAR */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-main);
}

.topbar {
    height: 65px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

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

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.restaurant-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.selector-label {
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-muted);
}

.topbar-store-select {
    padding: 0.45rem 1rem;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
    max-width: 320px;
}

.topbar-store-select:focus {
    border-color: var(--brand-blue);
}

.restaurant-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-md);
}

.locked-icon {
    font-size: 1rem;
    line-height: 1;
}

.locked-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.locked-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--brand-blue);
}

.locked-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

body.theme-dark .restaurant-locked-badge {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.35);
}

body.theme-dark .locked-name {
    color: #60a5fa;
}

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

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.825rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sync-btn:hover {
    background: var(--bg-elevated);
}

.sync-btn.spinning svg {
    animation: spin 0.8s linear infinite;
}

.stripe-direct-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: #6366f1;
    color: #ffffff;
    font-size: 0.825rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.15s ease;
}

.stripe-direct-link:hover {
    background: #4f46e5;
}

/* CONTENT AREA */
.content-area {
    padding: 1.75rem;
    flex: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

/* KPI CARDS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

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

.kpi-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-revenue { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.icon-orders { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.icon-aov { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.icon-balance { background: rgba(22, 163, 74, 0.1); color: #16a34a; }

.kpi-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.kpi-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.badge-success {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    background: #dcfce7;
    color: #15803d;
}

/* CHARTS GRID */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

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

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.chart-header {
    margin-bottom: 1.25rem;
}

.chart-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chart-body {
    position: relative;
    height: 260px;
    width: 100%;
}

/* TOP DISHES */
.dish-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.dish-row:last-child {
    border-bottom: none;
}

.dish-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dish-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dish-stats {
    text-align: right;
}

.dish-sales {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dish-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* SECTION CARD */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.section-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-title p {
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* ==============================================================================
   ORDERS TABLE & FILTERS (SCREENSHOT 1 & 2 SPECIFIC MATCH)
   ============================================================================== */

.orders-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-box-wrapper {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 420px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--text-subtle);
    pointer-events: none;
}

.search-box-wrapper input {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.35rem;
    border: 1px solid var(--border-card);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box-wrapper input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.filter-controls-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.clean-select {
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--border-card);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.clean-select:focus {
    border-color: #3b82f6;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border-card);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
}

.export-btn:hover {
    background: var(--bg-elevated);
}

/* ORDERS TABLE */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.orders-table thead th {
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.825rem;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
    white-space: nowrap;
}

.orders-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.1s ease;
    cursor: pointer;
}

.orders-table tbody tr:hover {
    background-color: var(--bg-elevated);
}

.orders-table td {
    padding: 0.95rem 1rem;
    vertical-align: middle;
    color: var(--text-primary);
}

/* Order Number */
.order-num-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
    display: inline-block;
    word-break: break-all;
}

/* Customer Name */
.customer-name {
    font-weight: 500;
    color: var(--text-primary);
}

/* Restaurant Name */
.restaurant-name-cell {
    font-weight: 500;
    color: var(--text-primary);
}

/* Date Display (Multi-line as shown in Screenshot 1) */
.date-cell-multiline {
    font-size: 0.775rem;
    color: var(--text-secondary);
    line-height: 1.25;
    font-family: inherit;
    white-space: pre-line;
}

/* Source Pill "Web" */
.source-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
}

body.theme-dark .source-badge {
    background: #1e293b;
    color: #94a3b8;
}

/* STATUS PILLS (EXACT SCREENSHOT COLORING) */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.status-nieuw {
    background: var(--pill-nieuw-bg);
    color: var(--pill-nieuw-text);
}

.status-geaccepteerd {
    background: var(--pill-geaccepteerd-bg);
    color: var(--pill-geaccepteerd-text);
}

.status-onderweg {
    background: var(--pill-onderweg-bg);
    color: var(--pill-onderweg-text);
}

.status-bezorgd {
    background: var(--pill-bezorgd-bg);
    color: var(--pill-bezorgd-text);
}

.status-geannuleerd {
    background: var(--pill-geannuleerd-bg);
    color: var(--pill-geannuleerd-text);
}

/* ACTION SELECT IN ROW (MATCHES SCREENSHOT 1 DROPDOWN) */
.action-select-container {
    display: flex;
    justify-content: flex-end;
}

.action-status-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding: 0.45rem 1.9rem 0.45rem 0.95rem;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: all 0.15s ease;
}

.action-status-select:hover {
    border-color: #94a3b8;
}

.action-status-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* PAGINATION */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.page-info {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border-card);
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-elevated);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==============================================================================
   ORDER DETAILS MODAL (SCREENSHOT 3 EXACT MATCH)
   ============================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.modal-card {
    background: var(--bg-surface);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-subtle);
}

.modal-header-custom {
    padding: 1.35rem 1.65rem 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-order-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.modal-order-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.meta-dot {
    font-weight: bold;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: color 0.15s;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-body-custom {
    padding: 1.5rem 1.65rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Modal Sections */
.modal-section {
    display: flex;
    flex-direction: column;
}

.modal-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
}

.modal-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.25rem 0;
}

/* Klantgegevens & Bestelgegevens Grid */
.detail-rows-container {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.detail-row-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    font-size: 0.875rem;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 400;
}

.detail-val {
    color: var(--text-primary);
    font-weight: 500;
}

/* Product Cards (Screenshot 3 Specific) */
.product-card {
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    background: var(--bg-surface);
    margin-bottom: 0.75rem;
}

.product-card:last-child {
    margin-bottom: 0;
}

.product-category-eyebrow {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.product-row-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.product-price {
    font-weight: 600;
}

/* Overzicht Section */
.overview-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.overview-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.overview-total {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 0.25rem;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.9); }
}

/* ==============================================================================
   RESTAURANT PORTALS (ADMIN-CREATED DUMMY CONNECTED ACCOUNT ID)
   ============================================================================== */

.portal-create-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.portal-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.portal-field input {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-card);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-field input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.portal-field-submit {
    display: flex;
    align-items: flex-end;
}

.portal-submit-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: var(--brand-indigo);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: opacity 0.15s;
}

.portal-submit-btn:hover {
    opacity: 0.9;
}

.portal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.credentials-panel {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.credentials-panel h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 0.6rem;
}

.credentials-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.825rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.credentials-row .cred-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 90px;
}

.credentials-row code {
    font-family: monospace;
    background: var(--bg-elevated);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    color: var(--text-primary);
}

.env-snippet-box {
    margin-top: 0.6rem;
    padding: 0.85rem 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    position: relative;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border-card);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

.copy-btn:hover {
    background: var(--bg-elevated);
}

@media (max-width: 900px) {
    .portal-create-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .portal-create-form {
        grid-template-columns: 1fr;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
