/* Kultura Hleba - Cabinet / B2B CSS */
:root {
    --primary: #1A1A1A;
    --secondary: #4A6C4A;
    --bg: #F5F5F5;
    --surface: #FFFFFF;
    --border: #E5E5E5;
    --muted: #888888;
    --danger: #DC2626;
    --warning: #F59E0B;
    --success: #16A34A;
    --info: #2563EB;
    --sidebar-w: 260px;
    --sidebar-collapsed-w: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--primary); font-size: 14px; }

.cabinet-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w); background: var(--primary); color: #fff; position: fixed;
    top: 0; left: 0; bottom: 0; z-index: 30; display: flex; flex-direction: column;
    transition: transform 0.3s, width 0.3s;
    overflow: hidden;
}
.sidebar-header { padding: 1.25rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-family: 'Playfair Display', serif; font-size: 1.25rem; }
.role-badge { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; background: var(--secondary); padding: 0.2rem 0.5rem; border-radius: 4px; }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1.25rem; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.8125rem; transition: all 0.2s; border-left: 3px solid transparent; }
.sidebar-nav a i, .sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: #fff; background: rgba(255,255,255,0.05); border-color: var(--secondary); }
.sidebar-nav a.nav-sub { padding: 0.4rem 1.25rem 0.4rem 2.5rem; font-size: 0.75rem; }
.sidebar-nav a.nav-sub i, .sidebar-nav a.nav-sub svg { width: 14px; height: 14px; }
.cabinet-layout.sidebar-collapsed .sidebar-nav a.nav-sub { padding: 0.55rem 0.5rem; justify-content: center; }
.sidebar-nav .nav-section { padding: 0.75rem 1.25rem 0.375rem; font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(255,255,255,0.35); }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.1); }
.avatar-btn { border:none; background:rgba(255,255,255,0.08); width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; cursor:pointer; font-weight:700; letter-spacing:0.03em; }
.avatar-btn:hover { background:rgba(255,255,255,0.15); }
.avatar-circle { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,#4a6c4a,#2f3f2f); font-weight:700; letter-spacing:0.02em; }
.profile-row { display:flex; align-items:center; gap:0.75rem; text-decoration:none; color:#fff; padding:0.35rem 0; }
.profile-row:hover .avatar-circle { box-shadow:0 0 0 3px rgba(255,255,255,0.08); }
.profile-text { display:flex; flex-direction:column; min-width:0; }
.profile-name { font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.profile-company { font-size:0.8rem; color:rgba(255,255,255,0.7); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.logout-btn { text-decoration:none; color: rgba(255,255,255,0.85); font-size:0.8rem; display:inline-flex; align-items:center; gap:0.35rem; padding:0.55rem 0.75rem; border:1px solid rgba(255,255,255,0.15); border-radius:8px; background:rgba(255,255,255,0.04); transition:all 0.2s; }
.logout-btn.wide { width:100%; justify-content:center; margin-top:0.35rem; }
.logout-btn:hover { color: #fff; }
.lang-switch { display: flex; gap: 0.375rem; margin-bottom: 0.75rem; }
.lang-switch .lang-btn { padding: 0.2rem 0.5rem; font-size: 0.7rem; border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; color: rgba(255,255,255,0.6); background: none; cursor: pointer; text-decoration: none; }
.lang-switch .lang-btn.active { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.user-info { font-size: 0.8125rem; }
.user-info span { display: block; margin-bottom: 0.25rem; }
.logout-btn { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 0.75rem; }
.logout-btn:hover { color: #fff; }

/* Sidebar close button (mobile) */
.sidebar-close {
    display: none; position: absolute; top: 0.85rem; right: 0.85rem; z-index: 2;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.6); cursor: pointer;
    border-radius: 8px; transition: all 0.15s;
    align-items: center; justify-content: center;
}
.sidebar-close:hover { color: #fff; background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.25); }
.sidebar-close i, .sidebar-close svg { width: 18px; height: 18px; }

/* Sidebar collapse toggle */
.sidebar-collapse-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: calc(100% - 1.5rem); margin: 0 auto 0.75rem;
    padding: 0.5rem; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.45); cursor: pointer; transition: all 0.2s;
    font-size: 0.75rem;
}
.sidebar-collapse-btn:hover { color: #fff; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.sidebar-collapse-btn i, .sidebar-collapse-btn svg { width: 16px; height: 16px; transition: transform 0.3s; flex-shrink: 0; }

/* ── Collapsed sidebar state ── */
.cabinet-layout.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
.cabinet-layout.sidebar-collapsed .cabinet-main { margin-left: var(--sidebar-collapsed-w); }
.cabinet-layout.sidebar-collapsed .sidebar,
.cabinet-layout.sidebar-collapsed .sidebar-nav { overflow: visible; }

.cabinet-layout.sidebar-collapsed .sidebar-header h2 { display: none; }
.cabinet-layout.sidebar-collapsed .sidebar-header { justify-content: center; padding: 1rem 0.5rem; }
.cabinet-layout.sidebar-collapsed .role-badge { display: none; }

.cabinet-layout.sidebar-collapsed .sidebar-nav a { justify-content: center; padding: 0.7rem 0.5rem; position: relative; gap: 0; }
.cabinet-layout.sidebar-collapsed .sidebar-nav a span { display: none; }
.cabinet-layout.sidebar-collapsed .sidebar-nav a .sidebar-cart-badge { display: none; }
.cabinet-layout.sidebar-collapsed .sidebar-nav .nav-section { font-size: 0; padding: 0.5rem 0 0.25rem; text-align: center; }
.cabinet-layout.sidebar-collapsed .sidebar-nav .nav-section span { display: none; }
.cabinet-layout.sidebar-collapsed .sidebar-nav .nav-section::after { content: ''; display: block; width: 20px; height: 1px; background: rgba(255,255,255,0.15); margin: 0 auto; }

.cabinet-layout.sidebar-collapsed .sidebar-footer { padding: 0.5rem; }
.cabinet-layout.sidebar-collapsed .sidebar-footer .lang-switch { justify-content: center; flex-wrap: wrap; gap: 0.2rem; margin-bottom: 0.5rem; }
.cabinet-layout.sidebar-collapsed .sidebar-footer .lang-switch .lang-btn { padding: 0.15rem 0.35rem; font-size: 0.6rem; }
.cabinet-layout.sidebar-collapsed .sidebar-footer .user-info { display: none; }
.cabinet-layout.sidebar-collapsed .profile-row { justify-content:center; padding:0.4rem 0; }
.cabinet-layout.sidebar-collapsed .profile-text { display:none; }
.cabinet-layout.sidebar-collapsed .logout-btn { width:40px; height:40px; padding:0; border-radius:50%; font-size:0; margin:0 auto; display:flex; align-items:center; justify-content:center; }
.cabinet-layout.sidebar-collapsed .logout-btn.wide { width:40px; }

.cabinet-layout.sidebar-collapsed .sidebar-collapse-btn {
    width: 36px; height: 36px; padding: 0; margin: 0 auto 0.75rem; border-radius: 50%;
}
.cabinet-layout.sidebar-collapsed .sidebar-collapse-btn i,
.cabinet-layout.sidebar-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* Flyout tooltip on hover (collapsed only) */
.cabinet-layout.sidebar-collapsed .sidebar-nav a:hover::after {
    content: attr(data-label);
    position: absolute;
    left: calc(var(--sidebar-collapsed-w) + 4px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: #fff;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 200;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.12);
}

/* Main */
.cabinet-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; transition: margin-left 0.3s; overflow-x: hidden; }
.cabinet-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 10; }
.cabinet-header h1 { font-size: 1.125rem; font-weight: 600; flex: 1; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.cabinet-content { padding: 1.5rem; flex: 1; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
    .sidebar.open { transform: translateX(0); }
    .cabinet-main { margin-left: 0 !important; }
    .menu-toggle { display: block; }
    .sidebar-close { display: block; }
    .sidebar-collapse-btn { display: none; }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 29; }
    .sidebar.open ~ .sidebar-overlay { display: block; }
    .cabinet-content { padding: 1rem; }
    .form-row { grid-template-columns: 1fr !important; }
    input, select, textarea { max-width: 100%; }
}

/* Alerts (legacy inline — kept for non-toast contexts) */
.alert { padding: 0.75rem 1rem; border-radius: 0.5rem; margin: 0 1.5rem 0; font-size: 0.875rem; }
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

/* Toast notifications */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; max-width: 420px; width: calc(100% - 2rem); }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.85rem 1rem; border-radius: 10px; font-size: 0.875rem; line-height: 1.4; box-shadow: 0 4px 14px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08); animation: toastIn 0.3s ease-out; position: relative; overflow: hidden; }
.toast.toast-out { animation: toastOut 0.3s ease-in forwards; }
.toast-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.toast-body { flex: 1; word-break: break-word; }
.toast-close { flex-shrink: 0; background: none; border: none; cursor: pointer; opacity: 0.5; padding: 2px; margin: -2px -4px 0 0; transition: opacity 0.15s; }
.toast-close:hover { opacity: 1; }
.toast-close svg { width: 14px; height: 14px; }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; border-radius: 0 0 10px 10px; animation: toastProgress linear forwards; }
.toast:hover .toast-progress { animation-play-state: paused; }
.toast-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.toast-success .toast-progress { background: #22c55e; }
.toast-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.toast-error .toast-progress { background: #ef4444; }
.toast-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.toast-warning .toast-progress { background: #f59e0b; }
.toast-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.toast-info .toast-progress { background: #3b82f6; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 1rem; max-width: 100%; overflow: hidden; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title { font-weight: 600; font-size: 1rem; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1rem; }
.stat-card i { width: clamp(22px, 4vw, 28px) !important; height: clamp(22px, 4vw, 28px) !important; }
.stat-value { font-size: clamp(1.05rem, 2.2vw, 1.9rem); font-weight: 700; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { font-size: clamp(0.65rem, 1.2vw, 0.9rem); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 0.75rem; color: var(--muted); }
.trend-up { color: #16a34a; }
.trend-down { color: #dc2626; }

/* Payment alert banners */
.payment-alert { display:flex; align-items:center; gap:0.75rem; padding:0.875rem 1.25rem; border-radius:8px; margin-bottom:1rem; font-size:0.95rem; }
.payment-alert-warning { background:#fef3c7; border:1px solid #f59e0b; color:#92400e; }
.payment-alert-danger  { background:#fee2e2; border:1px solid #dc2626; color:#991b1b; }
@media (max-width: 1280px) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .card-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
    .form-row { grid-template-columns: 1fr !important; }
    .stock-details.open { grid-template-columns: 1fr !important; }
}

/* Tables */
.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
.card > table, .card > form > table { display: block; overflow-x: auto; }
thead th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 0.75rem 0.75rem; text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap; }
tbody td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: rgba(0,0,0,0.015); }
.text-right { text-align: right; }

/* Badges / Status */
.status { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.status-pending { background: #FEF3C7; color: #92400E; }
.status-accepted { background: #DBEAFE; color: #1E40AF; }
.status-baking { background: #FED7AA; color: #9A3412; }
.status-packed { background: #E0E7FF; color: #3730A3; }
.status-on_the_way { background: #CFFAFE; color: #155E75; }
.status-delivered { background: #DCFCE7; color: #166534; }
.status-cancelled { background: #FEE2E2; color: #991B1B; }
.status-active { background: #DCFCE7; color: #166534; }
.status-inactive { background: #F3F4F6; color: #6B7280; }
.status-low { background: #FEE2E2; color: #991B1B; }
.status-ok { background: #DCFCE7; color: #166534; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.375rem; }
.form-control { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; font-size: 0.875rem; font-family: inherit; background: var(--surface); transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(74,108,74,0.1); }
select.form-control { appearance: auto; }
textarea.form-control { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input { width: 16px; height: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.8125rem; font-weight: 500; border: none; cursor: pointer; text-decoration: none; transition: all 0.2s; font-family: inherit; }
.btn-sm { padding: 0.3rem 0.625rem; font-size: 0.75rem; }
.btn-primary { background: var(--secondary); color: #fff; }
.btn-primary:hover { background: #3d5b3d; }
.btn-secondary { background: var(--primary); color: #fff; }
.btn-secondary:hover { opacity: 0.9; }
.btn-outline { border: 1px solid var(--border); background: var(--surface); color: var(--primary); }
.btn-outline:hover { border-color: var(--secondary); color: var(--secondary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-icon { padding: 0.375rem; border-radius: 0.375rem; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: 0.5rem 1rem; font-size: 0.8125rem; font-weight: 500; border: none; background: none; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab.active { color: var(--secondary); border-color: var(--secondary); }

/* Product Catalog (Client) */
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.catalog-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; transition: all 0.2s; }
.catalog-card:hover { border-color: var(--secondary); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.catalog-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.catalog-card-body { padding: 0.75rem; }
.catalog-card-body h4 { font-size: 0.9375rem; margin-bottom: 0.25rem; }
.catalog-card-body .desc { font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.5rem; }
.catalog-card-body .price { font-size: 1rem; font-weight: 700; color: var(--secondary); }
.catalog-card-actions { padding: 0 0.75rem 0.75rem; display: flex; gap: 0.5rem; }

/* Cart */
.cart-table td { vertical-align: middle; }
.qty-input { width: 60px; text-align: center; }

/* BOM / Production Plan */
.bom-table { margin-top: 0.5rem; }
.bom-table th { font-size: 0.65rem; }
.bom-table td { font-size: 0.8125rem; }
.bom-total { font-weight: 700; background: #F9FAFB; }

/* Print */
@media print {
    .sidebar, .cabinet-header, .menu-toggle, .btn, .no-print { display: none !important; }
    .cabinet-main { margin-left: 0 !important; }
    .cabinet-content { padding: 0 !important; }
    body { font-size: 12px; }
    .card { border: 1px solid #ccc; break-inside: avoid; }
}
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* Pagination */
.pagination { display: flex; gap: 0.25rem; justify-content: center; margin-top: 1.5rem; }
.page-link { padding: 0.375rem 0.75rem; border: 1px solid var(--border); border-radius: 0.375rem; font-size: 0.8125rem; text-decoration: none; color: var(--primary); }
.page-link.active { background: var(--secondary); color: #fff; border-color: var(--secondary); }

/* Search */
.search-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-bar input { flex: 1; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }

/* Prepared toggle */
.prep-check { position: relative; display:inline-flex; align-items:center; justify-content:center; width:24px; height:24px; cursor:pointer; }
.prep-check input { position:absolute; opacity:0; inset:0; }
.prep-check span { width:18px; height:18px; border:2px solid var(--border); border-radius:6px; display:inline-block; transition:all 0.15s; background:#fff; }
.prep-check input:checked + span { background: var(--secondary); border-color: var(--secondary); box-shadow: inset 0 0 0 2px #fff; }
.prep-check input:focus-visible + span { outline: 2px solid rgba(74,108,74,0.4); outline-offset: 2px; }

/* Timeline */
.timeline { position: relative; margin: 0 0 1rem; padding-left: 1.2rem; }
.timeline:before { content:''; position:absolute; left:6px; top:0; bottom:0; width:2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom:0.75rem; padding-left:1rem; }
.timeline-dot { position:absolute; left:-1px; top:4px; width:10px; height:10px; border-radius:50%; background: var(--secondary); box-shadow:0 0 0 3px rgba(74,108,74,0.15); }
.timeline-content { background: var(--surface); border:1px solid var(--border); border-radius:8px; padding:0.6rem 0.75rem; }
.timeline-title { font-weight:600; font-size:0.9rem; }
.timeline-meta { color: var(--muted); font-size:0.75rem; margin-top:2px; }
.timeline-body { font-size:0.85rem; margin-top:4px; }

/* Baker cards */
.baker-card-grid { margin-bottom: 1rem; }
.baker-card { position: relative; min-height: 100%; }
.baker-placeholder { width:100%; aspect-ratio:1; display:flex; align-items:center; justify-content:center; background:#f3f4f6; color:#ccc; font-size:1.5rem; }
.qty-badge { background: var(--brand-100); color: var(--brand-800); padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.8rem; }
.prep-card-row { display:flex; align-items:center; gap:0.4rem; margin:0.35rem 0 0.5rem; }
.baker-ingredients { display:flex; flex-wrap:wrap; gap:0.35rem; margin-bottom:0.5rem; }
.baker-chip { background:#f3f4f6; color:#555; padding:0.2rem 0.55rem; border-radius:9999px; font-size:0.78rem; }
.baker-chip.muted { background:#fff3cd; color:#92400e; }
.baker-recipe { padding:0.75rem; border-top:1px solid var(--border); background:#f9fafb; }
.baker-recipe.highlight-once { animation: recipe-highlight 1.2s ease; }
@keyframes recipe-highlight {
    0% { box-shadow: 0 0 0 0 rgba(200,134,69,0.35); background: #fff6ec; }
    60% { box-shadow: 0 0 0 12px rgba(200,134,69,0); background: #fff6ec; }
    100% { box-shadow: none; background:#f9fafb; }
}
.status-track { display:flex; align-items:center; gap:6px; margin:0.25rem 0 0.5rem; }
.status-btn { flex:1; padding:0.35rem 0.4rem; border:1px solid var(--border); background:#fff; border-radius:0.375rem; font-size:0.78rem; cursor:pointer; transition:all 0.15s; }
.status-btn.active { background: var(--brand-100); color: var(--brand-800); border-color: var(--brand-400); font-weight:600; }
.status-btn.complete { background: #e5e7eb; color:#374151; border-color:#d1d5db; }
.status-line { width:10px; height:2px; background: var(--border); }
.baker-stack-list { display:flex; flex-direction:column; gap:1rem; }
.baker-stack-card { display:flex; gap:1rem; border:1px solid var(--border); border-radius:0.75rem; padding:1rem; background:var(--surface); }
.baker-stack-left img, .baker-stack-left .baker-placeholder { width:140px; height:140px; border-radius:0.75rem; object-fit:cover; }
.baker-stack-right { flex:1; display:flex; flex-direction:column; gap:0.5rem; }
.stack-head { display:flex; justify-content:space-between; align-items:flex-start; gap:0.5rem; }
.stack-name { font-weight:700; font-size:1rem; }
.stack-sku { font-size:0.8rem; }
.stack-tabs { display:inline-flex; gap:0.25rem; margin-top:0.25rem; }
.stack-tab { border:1px solid var(--border); background:#fff; padding:0.35rem 0.65rem; border-radius:0.375rem; font-size:0.78rem; cursor:pointer; }
.stack-tab.active { background: var(--secondary); color:#fff; border-color: var(--secondary); }
.stack-panel { margin-top:0.5rem; }
.stack-table { width:100%; border-collapse:collapse; font-size:0.9rem; }
.stack-table th, .stack-table td { padding:0.35rem 0.4rem; border-bottom:1px solid var(--border); }
.stack-step { display:flex; gap:0.5rem; margin-bottom:0.4rem; }
.stack-step-num { font-weight:700; color: var(--brand-700); }
.stack-step-title { font-weight:600; }
.stack-step-body { font-size:0.9rem; color:#555; white-space:pre-line; }
.stack-step-note { font-size:0.8rem; color:#b45309; font-style:italic; }

/* Payment status badges */
.status-unpaid { background: #FEE2E2; color: #991B1B; }
.status-partial { background: #FEF3C7; color: #92400E; }
.status-paid { background: #DCFCE7; color: #166534; }
.status-info { background: #DBEAFE; color: #1E40AF; }

/* Inventory movement type indicators */
.movement-in { border-left: 3px solid var(--success); }
.movement-out { border-left: 3px solid var(--danger); }

/* Pricing matrix horizontal scroll with sticky column */
.pricing-scroll-wrapper { overflow-x: auto; position: relative; -webkit-overflow-scrolling: touch; }
.pricing-scroll-wrapper table th:first-child,
.pricing-scroll-wrapper table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pricing-scroll-clone { overflow-x: auto; height: 12px; margin-bottom: 0.5rem; }
.pricing-scroll-clone > div { height: 1px; }

/* Order detail enhancements */
.order-item-thumb { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; flex-shrink: 0; display: block; }
.order-item-placeholder { width: 32px; height: 32px; border-radius: 4px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; color: #ccc; flex-shrink: 0; }
.order-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
@media (max-width: 768px) { .order-info-grid { grid-template-columns: 1fr; } }

/* Tab pills (category filter within tabs) */
.tab-pills { display: flex; gap: 0.375rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab-pill { padding: 0.3rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; text-decoration: none; transition: all 0.2s; }
.tab-pill:hover { border-color: var(--secondary); color: var(--secondary); }
.tab-pill.active { background: var(--secondary); color: #fff; border-color: var(--secondary); }

/* Utilities */
.text-muted { color: var(--muted); }
.text-secondary { color: var(--secondary); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.hidden { display: none; }

/* Toggle switch (iOS style) */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-switch .toggle-track { width: 36px; height: 20px; background: #d1d5db; border-radius: 10px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-switch .toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-switch input:checked + .toggle-track { background: var(--secondary); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle-switch .toggle-label { font-size: 0.85rem; font-weight: 500; user-select: none; }

/* Shift pill checkboxes */
.shift-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.shift-pill { display: inline-block; }
.shift-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.shift-pill span { display: inline-block; padding: 0.35rem 0.85rem; border: 1px solid var(--border); border-radius: 9999px; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; background: var(--surface); color: var(--muted); }
.shift-pill input:checked + span { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.shift-pill span:hover { border-color: var(--secondary); color: var(--secondary); }
.shift-pill input:checked + span:hover { color: #fff; }

/* Type toggle (Intake / Outgoing) */
.type-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.type-toggle label { padding: 0.4rem 1rem; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.2s; border-right: 1px solid var(--border); }
.type-toggle label:last-child { border-right: none; }
.type-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.type-toggle input[value="in"]:checked + label { background: #DCFCE7; color: #166534; }
.type-toggle input[value="out"]:checked + label { background: #FEE2E2; color: #991B1B; }

/* Section card (soft bordered) */
.section-card { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 1rem; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.section-card h4 { margin: 0 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.section-card h4 i { color: var(--muted); }

/* Dynamic row (contacts) */
.dynamic-row-styled { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; padding: 0.5rem; background: #fafafa; border-radius: 8px; border: 1px solid #f0f0f0; }

/* Form submit bar */
.form-submit-bar { padding: 1rem 0; margin-top: 0.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; }

/* Inventory quick-add toolbar */
.stock-toolbar { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; padding: 0.75rem 1rem; }
.stock-toolbar .form-group { margin-bottom: 0; }
.stock-details { padding: 0.75rem 1rem; border-top: 1px dashed var(--border); display: none; }
.stock-details.open { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }

/* ═══════════════════════════════════════════════════
   Client Cabinet — Brand Design (from B2B prototype)
   ═══════════════════════════════════════════════════ */
:root {
    --brand-50: #fbf8f3;
    --brand-100: #f5efe4;
    --brand-200: #eaddc4;
    --brand-300: #dec29a;
    --brand-400: #d1a06a;
    --brand-500: #c88645;
    --brand-600: #bc6e38;
    --brand-700: #9c562e;
    --brand-800: #80472a;
    --brand-900: #683b25;
}

/* Hero Banner */
.client-hero {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
    border-radius: 1rem;
    padding: 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(200,134,69,0.2);
}
.client-hero h3 { font-family: 'Playfair Display', serif; font-size: 1.75rem; margin-bottom: 0.5rem; }
.client-hero p { opacity: 0.9; margin-bottom: 1rem; font-size: 0.9rem; }
.client-hero .hero-icon {
    position: absolute; right: -1rem; bottom: -1rem;
    width: 8rem; height: 8rem; opacity: 0.1; transform: rotate(12deg);
}
.client-hero .hero-actions { display: flex; gap: 0.75rem; }

.btn-brand { background: var(--brand-100); color: var(--brand-900); padding: 0.5rem 1.25rem; border-radius: 0.5rem; font-weight: 500; border: none; cursor: pointer; font-size: 0.875rem; transition: all 0.2s; }
.btn-brand:hover { background: var(--brand-200); }
.btn-brand-outline { background: none; color: #fff; border: 2px solid rgba(255,255,255,0.5); padding: 0.5rem 1.25rem; border-radius: 0.5rem; font-weight: 500; cursor: pointer; font-size: 0.875rem; transition: all 0.2s; text-decoration: none; }
.btn-brand-outline:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

/* Order Tracking Card */
.tracking-card { border-left: 4px solid var(--brand-500); }
.tracking-card .progress-bar-wrap { width: 100%; background: #f3f4f6; height: 0.5rem; border-radius: 9999px; overflow: hidden; margin: 0.75rem 0 0.5rem; }
.tracking-card .progress-bar-fill { height: 100%; background: var(--brand-500); border-radius: 9999px; transition: width 0.5s ease; }
.tracking-steps { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); }
.tracking-steps .step-active { font-weight: 700; color: var(--brand-600); }
.tracking-eta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: #666; margin-top: 0.75rem; }

/* Popular Products */
.popular-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; }
.popular-item + .popular-item { border-top: 1px solid var(--border); }
.popular-item img { width: 3rem; height: 3rem; border-radius: 0.5rem; object-fit: cover; }
.popular-item .pop-placeholder { width: 3rem; height: 3rem; border-radius: 0.5rem; background: var(--brand-50); display: flex; align-items: center; justify-content: center; color: var(--brand-400); }
.popular-item .pop-info { flex: 1; }
.popular-item .pop-name { font-weight: 500; font-size: 0.875rem; }
.popular-item .pop-weight { font-size: 0.75rem; color: var(--muted); }
.popular-item .pop-add { background: var(--brand-100); color: var(--brand-800); border: none; width: 2rem; height: 2rem; border-radius: 0.375rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.popular-item .pop-add:hover { background: var(--brand-200); }

/* Client Catalog — Brand Styled */
.cat-search-wrap { position: relative; flex: 1; min-width: 200px; }
.cat-search-wrap i, .cat-search-wrap svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.cat-search-wrap input { padding-left: 2.5rem; border-radius: 0.75rem; }
.cat-filters { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.cat-pill { padding: 0.5rem 1rem; border-radius: 9999px; white-space: nowrap; font-size: 0.8125rem; font-weight: 500; border: 1px solid var(--border); background: var(--surface); color: #666; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.cat-pill:hover { border-color: var(--brand-400); color: var(--brand-700); }
.cat-pill.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* Catalog Card — Brand */
.catalog-card .cat-badge {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: var(--brand-100); color: var(--brand-800);
    padding: 0.15rem 0.5rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600;
}
.catalog-card .cat-img-wrap { position: relative; overflow: hidden; aspect-ratio: 1/1; border-radius: 0.75rem; background: #f9fafb; }
.catalog-card .cat-img-wrap img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition: transform 0.5s; }
.catalog-card:hover .cat-img-wrap img { transform: scale(1.05); }
.catalog-card .cat-meta { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.25rem; }
.catalog-card .cat-weight { font-size: 0.75rem; color: var(--muted); }
.catalog-card .cat-price { font-weight: 600; color: var(--brand-600); white-space: nowrap; }
.btn-brand-full { width: 100%; background: var(--brand-100); color: var(--brand-900); padding: 0.5rem; border-radius: 0.5rem; border: none; cursor: pointer; font-weight: 500; font-size: 0.8125rem; font-family: inherit; transition: all 0.2s; }
.btn-brand-full:hover { background: var(--brand-200); }

/* Cart Items — Card Style */
.cart-item-card { display: flex; gap: 1rem; align-items: center; }
.cart-item-card img { width: 4rem; height: 4rem; border-radius: 0.5rem; object-fit: cover; flex-shrink: 0; }
.cart-item-card .cart-placeholder { width: 4rem; height: 4rem; border-radius: 0.5rem; background: var(--brand-50); display: flex; align-items: center; justify-content: center; color: var(--brand-400); flex-shrink: 0; }
.cart-item-card .cart-item-info { flex: 1; }
.cart-item-card .cart-item-name { font-weight: 600; font-size: 0.9375rem; }
.cart-item-card .cart-item-price { font-size: 0.8125rem; color: var(--muted); }

.qty-control { display: inline-flex; align-items: center; gap: 0; background: #f3f4f6; border-radius: 0.5rem; overflow: hidden; }
.qty-control button { width: 2rem; height: 2rem; border: none; background: none; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.qty-control button:hover { background: #e5e7eb; }
.qty-control input { width: 2.5rem; text-align: center; border: none; background: none; font-weight: 600; font-size: 0.875rem; font-family: inherit; outline: none; -moz-appearance: textfield; }
.qty-control input::-webkit-inner-spin-button,
.qty-control input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Cart Summary — Dark */
.cart-summary {
    background: var(--primary);
    color: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: none;
}
.cart-summary .summary-total-label { color: #a1a1aa; font-size: 0.875rem; }
.cart-summary .summary-total-value { font-size: 1.5rem; font-weight: 700; }
.cart-summary .delivery-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; color: #a1a1aa; margin-bottom: 0.75rem; }
.delivery-dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.delivery-date-opt { text-align: center; padding: 0.5rem; border-radius: 0.5rem; border: 1px solid #52525b; cursor: pointer; transition: all 0.2s; background: none; color: #fff; font-family: inherit; }
.delivery-date-opt:hover, .delivery-date-opt.selected { background: #52525b; }
.delivery-date-opt .dd-weekday { font-size: 0.7rem; color: #a1a1aa; display: block; }
.delivery-date-opt .dd-day { font-weight: 700; font-size: 1rem; display: block; }
.btn-checkout { width: 100%; padding: 0.875rem; background: var(--brand-600); color: #fff; border: none; border-radius: 0.5rem; font-size: 1.1rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.btn-checkout:hover { background: var(--brand-700); }
.btn.btn-xs, .btn.btn-outline.btn-xs { padding: 0.25rem 0.6rem; font-size: 0.75rem; }

/* Multi-venue cart layout */
.cart-layout { display: flex; flex-direction: column; gap: 1.25rem; }
.cart-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.section-eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; color: var(--muted); font-weight: 700; }
.section-title { margin: 0.15rem 0; font-size: 1.4rem; font-weight: 700; }
.muted { color: var(--muted); }
.product-palette { background: #f8fafc; border: 1px solid var(--border); border-radius: 1rem; padding: 1rem; }
.palette-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.75rem; }
.product-chip { background: #fff; border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.75rem; display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; box-shadow: 0 6px 24px rgba(0,0,0,0.03); }
.chip-left { display: flex; gap: 0.75rem; align-items: center; }
.chip-thumb { width: 54px; height: 54px; border-radius: 0.65rem; background-size: cover; background-position: center; }
.chip-thumb.placeholder { background: var(--brand-50); display: flex; align-items: center; justify-content: center; color: var(--brand-400); }
.chip-name { font-weight: 700; }
.chip-price { color: var(--muted); font-size: 0.85rem; }
.chip-actions { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-end; }
.chip-qty { font-size: 0.8rem; color: var(--muted); }

.venue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.venue-card { background: #fff; border: 1px solid var(--border); border-radius: 1rem; padding: 1rem; box-shadow: 0 12px 32px rgba(0,0,0,0.04); display: flex; flex-direction: column; gap: 0.75rem; }
.venue-header { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.venue-name { font-size: 1.05rem; font-weight: 700; }
.venue-meta { color: var(--muted); font-size: 0.85rem; display:flex; align-items:center; gap:0.35rem; }
.venue-total { font-weight: 700; color: var(--secondary); }
.allocation-dropzone { border: 1px dashed var(--border); border-radius: 0.75rem; padding: 0.5rem; min-height: 120px; background: #fcfcfd; display: flex; flex-direction: column; gap: 0.5rem; }
.drop-hint { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 0.5rem; border-radius: 0.5rem; background: #f8fafc; }
.allocation-dropzone.drop-active { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(74,108,74,0.15); }
.allocation-dropzone.drop-hover { background: #eef5ee; }
.allocation-card { background: #fff; border: 1px solid var(--border); border-radius: 0.65rem; padding: 0.6rem 0.7rem; display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; cursor: grab; box-shadow: 0 4px 14px rgba(0,0,0,0.04); }
.allocation-card.dragging { opacity: 0.7; }
.alloc-left { display: flex; gap: 0.5rem; align-items: center; }
.alloc-thumb { width: 42px; height: 42px; border-radius: 0.55rem; background-size: cover; background-position: center; background-color: #f3f4f6; }
.alloc-thumb.placeholder { display:flex; align-items:center; justify-content:center; color: var(--brand-400); }
.alloc-name { font-weight: 600; font-size: 0.93rem; }
.alloc-price { color: var(--muted); font-size: 0.8rem; }
.alloc-actions { display: flex; align-items: center; gap: 0.35rem; }
.alloc-actions input { width: 4.5rem; padding: 0.35rem 0.45rem; border-radius: 0.5rem; border: 1px solid var(--border); font-weight: 600; min-width: 70px; }

@media (max-width: 640px) {
    .allocation-card { flex-direction: column; align-items: stretch; }
    .alloc-actions { justify-content: flex-end; }
}

.summary-panel { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; align-items: stretch; }
.summary-left textarea { min-height: 120px; }
.summary-right { background: #0f172a; color: #e2e8f0; border-radius: 0.9rem; padding: 1rem; box-shadow: 0 14px 36px rgba(15,23,42,0.2); }
.summary-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; font-weight: 600; }
.summary-row.subtle { font-weight: 500; color: #cbd5e1; }
.summary-venues { margin-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 0.5rem; display: flex; flex-direction: column; gap: 0.35rem; }

@media (max-width: 900px) {
    .summary-panel { grid-template-columns: 1fr; }
    .venue-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .palette-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* Order Cards — Brand */
.order-card { border-left: 4px solid #e5e7eb; transition: border-color 0.2s; }
.order-card:hover { border-left-color: var(--brand-400); }
.order-card .order-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.order-card .order-id { font-weight: 700; font-size: 1.1rem; }
.order-card .order-date { font-size: 0.8125rem; color: var(--muted); }
.order-card .order-total { font-weight: 700; color: var(--brand-600); }
.order-card .order-items-summary { background: #f9fafb; border-radius: 0.375rem; padding: 0.5rem 0.75rem; font-size: 0.8125rem; color: #666; }
.btn-reorder { background: none; border: none; color: var(--brand-600); font-size: 0.75rem; font-weight: 500; cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 0.25rem; transition: background 0.15s; }
.btn-reorder:hover { background: var(--brand-50); }

/* Order Detail — Progress */
.order-progress { margin: 1rem 0; }
.order-progress .progress-bar-wrap { width: 100%; background: #f3f4f6; height: 0.5rem; border-radius: 9999px; overflow: hidden; }
.order-progress .progress-bar-fill { height: 100%; background: var(--brand-500); border-radius: 9999px; }

/* Product Detail — Brand */
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 768px) {
    .product-detail-grid { grid-template-columns: 1fr; }
}
.product-detail-img { width: 100%; max-height: 400px; object-fit: cover; border-radius: 0.75rem; }
.pd-gallery { display:flex; flex-direction:column; gap:0.75rem; }
.pd-gallery-main { position:relative; border-radius:0.75rem; overflow:hidden; background:#f5f5f5; }
.pd-gallery-main img { width:100%; aspect-ratio:1/1; object-fit:cover; display:block; }
.pd-nav { position:absolute; top:50%; transform:translateY(-50%); background:rgba(255,255,255,0.9); border:none; width:2.25rem; height:2.25rem; border-radius:50%; cursor:pointer; font-weight:700; box-shadow:0 8px 24px rgba(0,0,0,0.08); }
.pd-nav.prev { left:0.5rem; }
.pd-nav.next { right:0.5rem; }
.pd-thumbs { display:grid; grid-template-columns:repeat(auto-fill, minmax(64px, 1fr)); gap:0.5rem; }
.pd-thumb { border:2px solid transparent; border-radius:0.5rem; overflow:hidden; padding:0; background:#f9fafb; cursor:pointer; }
.pd-thumb img { width:100%; aspect-ratio:1/1; object-fit:cover; display:block; }
.pd-thumb.active { border-color: var(--brand-500); box-shadow:0 0 0 2px rgba(74,108,74,0.2); }
.product-detail-info .pd-name { font-family: 'Playfair Display', serif; font-size: 1.75rem; margin-bottom: 0.5rem; }
.product-detail-info .pd-desc { color: #555; margin-bottom: 1.25rem; line-height: 1.6; }
.pd-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.pd-meta-box { background: #f9fafb; border-radius: 0.5rem; padding: 0.75rem; }
.pd-meta-box .pd-meta-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.25rem; }
.pd-meta-box .pd-meta-val { font-size: 0.8125rem; font-weight: 500; }
.pd-allergen { display: inline-block; background: #fef3c7; color: #92400e; padding: 0.15rem 0.5rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; margin-right: 0.25rem; margin-bottom: 0.25rem; }
.pd-price { font-size: 1.75rem; font-weight: 700; color: var(--brand-600); }
.pd-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Mobile bottom nav for client */
.client-bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-top: 1px solid var(--border);
    z-index: 40; padding: 0.5rem 0; padding-bottom: env(safe-area-inset-bottom, 0.5rem);
}
.client-bottom-nav .bnav-inner { display: flex; justify-content: space-around; }
.client-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; text-decoration: none; color: var(--muted); font-size: 0.625rem; font-weight: 500; padding: 0.25rem; position: relative; }
.client-bottom-nav a.active { color: var(--brand-600); }
.client-bottom-nav a i, .client-bottom-nav a svg { width: 20px; height: 20px; }
.client-bottom-nav .bnav-badge { position: absolute; top: -2px; right: -2px; width: 0.5rem; height: 0.5rem; background: var(--brand-600); border-radius: 50%; border: 2px solid var(--surface); }

@media (max-width: 768px) {
    .client-bottom-nav { display: block; }
    .cabinet-content { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 12px)); }
}

/* Establishment picker */
.est-picker { position: fixed; inset: 0; z-index: 99; display: none; }
.est-picker.open { display: block; }
.est-picker__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.est-picker__sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 14px 14px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 12px)); box-shadow: 0 -8px 24px rgba(0,0,0,0.12); }
.est-picker__title { font-weight: 700; font-size: 1rem; margin-bottom: 0.75rem; }
.est-picker__list { display: grid; gap: 0.5rem; max-height: 60vh; overflow-y: auto; }
.est-picker__item { width: 100%; text-align: left; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 10px; background: #f9fafb; font-weight: 600; cursor: pointer; }
.est-picker__item:hover { border-color: var(--secondary); }
.est-picker__cancel { margin-top: 0.75rem; width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--border); background: #fff; border-radius: 10px; font-weight: 600; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════
   BAKER CABINET — MOBILE RESPONSIVE (≤640px)
   ═══════════════════════════════════════════════════════════════ */

/* Baker stack card: stacked layout on mobile */
@media (max-width: 640px) {
    /* Card cards */
    .card { padding: 0.75rem; }

    /* Baker card: column on mobile */
    .baker-stack-card {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.65rem;
    }
    .baker-stack-left img,
    .baker-stack-left .baker-placeholder {
        width: 100%;
        height: 140px;
        border-radius: 0.5rem;
    }
    .baker-stack-left { width: 100%; }

    /* Stack header */
    .stack-head {
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .stack-name { font-size: 0.9rem; }
    .stack-sku  { font-size: 0.72rem; }

    /* Status track: smaller buttons */
    .status-track { gap: 0; }
    .status-btn {
        padding: 0.45rem 0.2rem;
        font-size: 0.7rem;
        min-height: 36px;
    }
    .status-line { width: 6px; }

    /* Stack tabs */
    .stack-tabs { width: 100%; }
    .stack-tab {
        flex: 1;
        text-align: center;
        font-size: 0.72rem;
        padding: 0.4rem 0.25rem;
    }

    /* Stack table */
    .stack-table { font-size: 0.78rem; }
    .stack-table th, .stack-table td { padding: 0.25rem 0.3rem; }

    /* Stat grid → 2 columns */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .stat-card { padding: 0.6rem; }

    /* Flex-between: wrap */
    .flex-between { flex-wrap: wrap; gap: 0.5rem; }

    /* Date + print button row */
    .no-print.flex-between > form,
    .no-print.flex-between > div {
        width: 100%;
    }
    .no-print.flex-between > div {
        display: flex;
        gap: 0.4rem;
    }
    .no-print.flex-between > div .btn {
        flex: 1;
        font-size: 0.72rem;
        padding: 0.45rem 0.5rem;
        justify-content: center;
    }

    /* Baker tabs */
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    .tab { font-size: 0.75rem; padding: 0.5rem 0.7rem; }

    /* BOM table on mobile */
    .baker-tab[data-tab="bom"] table { font-size: 0.75rem; }
    .baker-tab[data-tab="bom"] thead th { font-size: 0.65rem; padding: 0.3rem 0.35rem; }
    .baker-tab[data-tab="bom"] tbody td { padding: 0.3rem 0.35rem; }

    /* Sub-recipe block */
    .subrecipe-prereq-block { margin: 0.5rem 0; border-radius: 8px; }
    .subrecipe-prereq-title { font-size: 0.68rem; padding: 0.4rem 0.65rem; }
    .subrecipe-card { padding: 0.5rem 0.65rem; }
    .subrecipe-card-name { font-size: 0.82rem; }
    .subrecipe-badge { font-size: 0.65rem; padding: 0.12rem 0.4rem; }
    .subrecipe-leaf-table { font-size: 0.75rem; }
    .subrecipe-leaf-table th, .subrecipe-leaf-table td { padding: 0.2rem 0.35rem; }

    /* Production group blocks */
    .pg-block { border-radius: 10px; }
    .pg-block-head {
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
    .pg-block-name { font-size: 0.9rem; }
    .pg-block-badges { flex-wrap: wrap; gap: 0.25rem; }
    .pg-badge { font-size: 0.65rem; padding: 0.15rem 0.45rem; }
    .pg-block-body { padding: 0.55rem 0.75rem; }
    .pg-products-row { gap: 0.25rem; }
    .pg-product-chip { font-size: 0.68rem; padding: 0.15rem 0.4rem; }
    .pg-ing-table { font-size: 0.75rem; }
    .pg-ing-table th, .pg-ing-table td { padding: 0.2rem 0.35rem; }

    /* Group status track */
    .pg-status-btn {
        font-size: 0.68rem;
        padding: 0.4rem 0.2rem;
        min-height: 38px;
    }

    /* Section title */
    .pg-section-title { font-size: 0.7rem; }

    /* Group badge on product */
    .group-badge { font-size: 0.6rem; padding: 0.1rem 0.35rem; }
}

/* Extra small: 375px (iPhone SE) */
@media (max-width: 420px) {
    .cabinet-content { padding: 0.6rem; }
    .card { padding: 0.55rem; border-radius: 0.5rem; }

    .baker-stack-card { padding: 0.5rem; }

    /* Hide product image on very small screens to save space */
    .baker-stack-left { display: none; }

    /* Make qty-badge prominent */
    .qty-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.55rem;
    }

    /* Status track: even smaller */
    .status-btn { font-size: 0.65rem; padding: 0.4rem 0.1rem; }
}

/* Tablet (641–900px): two-column baker stack */
@media (min-width: 641px) and (max-width: 900px) {
    .baker-stack-card {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    .baker-stack-left img,
    .baker-stack-left .baker-placeholder {
        width: 100%;
        height: 120px;
    }
    .baker-stack-left { width: 100%; }
}
