/* ── 1. BASE & THEME VARIABLES ── */
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

:root {
    /* Light Theme (Premium Stationery / Cafe Aesthetic) */
    --bg:       #F4F1EC;
    --bg-el:    #FFFFFF;
    --bg-panel: rgba(255, 255, 255, 0.92);
    --bg-h:     rgba(0, 0, 0, 0.04);
    --ink:      #1A1A1A;
    --ink-inv:  #FFFFFF;
    --muted:    #8C857B;
    --accent:   #D94630;
    --ok:       #22C55E;
    --warn:     #D97706;
    --blue:     #2563EB;
    --bdr:      rgba(0, 0, 0, 0.08);
    --bdr-d:    rgba(0, 0, 0, 0.15);
    
    /* Shadows & Curves */
    --shsm:     0 4px 24px rgba(0,0,0,0.04);
    --shmd:     0 32px 64px -12px rgba(0,0,0,0.12);
    --sh-toast: 0 40px 80px rgba(0,0,0,0.15);
    
    /* Typography */
    --sans:     'Plus Jakarta Sans', sans-serif;
    --mono:     'IBM Plex Mono', monospace;
    --disp:     'Playfair Display', serif;
    
    /* Animation Easing */
    --spring:   cubic-bezier(0.175, 0.885, 0.32, 1.1);
    --ease:     cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Layout */
    --sidebar-w: 260px;
    --header-h:  72px;
}

[data-theme="dark"] {
    /* Dark Theme (High-End Console) */
    --bg:       #111111;
    --bg-el:    #1C1C1C;
    --bg-panel: rgba(28, 28, 28, 0.92);
    --bg-h:     rgba(255, 255, 255, 0.06);
    --ink:      #EDEDED;
    --ink-inv:  #111111;
    --muted:    #9CA3AF;
    --accent:   #E05C45;
    --bdr:      rgba(255, 255, 255, 0.1);
    --bdr-d:    rgba(255, 255, 255, 0.18);
    --shsm:     0 8px 32px rgba(0,0,0,0.4);
    --shmd:     0 32px 64px -12px rgba(0,0,0,0.8);
    --sh-toast: 0 40px 80px rgba(0,0,0,0.6);
}

html { 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
}

body {
    background: var(--bg) url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(0,0,0,0.04)'/%3E%3C/svg%3E");
    color: var(--ink); 
    font-family: var(--sans);
    display: grid; 
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh; 
    overflow-x: hidden;
    transition: background-color 0.4s, color 0.4s;
}

[data-theme="dark"] body {
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(255,255,255,0.03)'/%3E%3C/svg%3E");
}

/* Hide scrollbars for slick UI */
::-webkit-scrollbar { width: 0; height: 0; background: transparent; }

/* Keyboard hint styling */
kbd { 
    font-family: var(--mono); font-size: 0.65rem; font-weight: 700; 
    background: var(--bg-h); color: var(--muted); 
    padding: 2px 7px; border-radius: 6px; 
    border: 1px solid var(--bdr); box-shadow: 0 1px 0 var(--bdr-d); 
    display: inline-flex; align-items: center; justify-content: center; 
    min-width: 22px; 
}

/* ── 2. APP SHELL & SIDEBAR ── */
.app-sidebar { 
    position: sticky; top: 0; height: 100vh; 
    background: var(--bg-el); border-right: 1px solid var(--bdr); 
    display: flex; flex-direction: column; padding: 1.5rem; 
    z-index: 100; overflow: hidden; 
}
.sidebar-header { 
    display: flex; align-items: center; justify-content: space-between; 
    margin-bottom: 2.5rem; flex-shrink: 0; 
}
.logo-wrap { display: flex; align-items: center; gap: 8px; }
.logo { font-family: var(--disp); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; }
.cafe { font-style: italic; font-weight: 500; color: var(--muted); }
.logo-tag { 
    font-family: var(--mono); font-size: 0.6rem; font-weight: 700; 
    background: var(--ink); color: var(--ink-inv); 
    padding: 3px 9px; border-radius: 999px; letter-spacing: 0.08em; 
    text-transform: uppercase; margin-left: 8px; 
}
.sidebar-close { display: none; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-section { 
    font-family: var(--mono); font-size: 0.6rem; font-weight: 700; 
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; 
    margin: 1.5rem 0 0.5rem; padding-left: 0.75rem; 
}
.nav-item { 
    display: flex; align-items: center; gap: 0.75rem; 
    padding: 0.7rem 0.75rem; border-radius: 14px; 
    font-family: var(--sans); font-size: 0.88rem; font-weight: 700; 
    color: var(--muted); text-decoration: none; 
    transition: all 0.2s var(--ease); position: relative; 
}
.nav-item:hover { background: var(--bg-h); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--ink-inv); box-shadow: var(--shsm); }
.nav-item.active .nav-kbd { background: rgba(255,255,255,0.15); color: var(--ink-inv); border-color: transparent; }
.nav-icon { flex-shrink: 0; opacity: 0.7; transition: opacity 0.2s; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 1; }
.nav-kbd { margin-left: auto; opacity: 0; transition: opacity 0.2s; }
.nav-item:hover .nav-kbd, .nav-item.active .nav-kbd { opacity: 1; }
.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--bdr); display: flex; flex-direction: column; gap: 0.5rem; flex-shrink: 0; }

/* ── 3. HEADER & LAYOUT ── */
.app-layout { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-header { 
    position: sticky; top: 0; z-index: 90; height: var(--header-h); 
    background: var(--bg-panel); backdrop-filter: blur(24px); 
    border-bottom: 1px solid var(--bdr); 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 2rem; gap: 1rem; 
}
.header-search { position: relative; width: 320px; }
.header-search .search-icon { 
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); 
    color: var(--muted); pointer-events: none; 
}
.fsearch { 
    width: 100%; padding: 10px 14px 10px 40px; 
    border: 1.5px solid var(--bdr); border-radius: 999px; 
    background: var(--bg-el); color: var(--ink); outline: none; 
    font-family: var(--sans); font-size: 0.88rem; transition: 0.25s; 
}
.fsearch:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }
.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.app-content { flex: 1; padding: 0 2rem 2rem; max-width: 1400px; width: 100%; margin: 0 auto; }
.mobile-header { display: none; }

/* ── 4. BUTTONS, PILLS & ICONS ── */
.icon-btn { 
    background: var(--bg-h); border: none; width: 38px; height: 38px; 
    border-radius: 999px; cursor: pointer; color: var(--ink); 
    display: flex; align-items: center; justify-content: center; 
    transition: transform 0.2s, background 0.2s; 
}
.icon-btn:hover { transform: scale(1.08); background: var(--ink); color: var(--ink-inv); }

.pill { 
    font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; 
    background: var(--bg-el); border: 1px solid var(--bdr); 
    padding: 7px 14px; border-radius: 999px; color: var(--ink); 
    display: flex; align-items: center; gap: 6px; 
}
.pill.live-clock { cursor: default; min-width: 90px; justify-content: center; }
.ws-pill { display: flex; align-items: center; gap: 6px; }
.ws-dot { 
    width: 7px; height: 7px; border-radius: 50%; 
    background: var(--muted); flex-shrink: 0; 
    transition: background 0.4s, box-shadow 0.4s; 
}
.ws-dot.on  { background: var(--ok); box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.ws-dot.off { background: var(--accent); box-shadow: 0 0 8px rgba(217,70,48,0.4); }

.theme-btn { 
    background: var(--bg-h); border: none; width: 38px; height: 38px; 
    border-radius: 999px; cursor: pointer; position: relative; 
    overflow: hidden; outline: none; transition: transform 0.2s; 
}
.theme-btn:hover { transform: scale(1.08); }
.ticon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: transform 0.6s var(--spring), opacity 0.4s; }
.ticon.sun { opacity: 1; transform: translateY(0); color: var(--ok); }
.ticon.moon { opacity: 0; transform: translateY(-100%); color: #A66A38; }
[data-theme="dark"] .ticon.sun  { opacity: 0; transform: translateY(100%); }
[data-theme="dark"] .ticon.moon { opacity: 1; transform: translateY(0); }

/* ── 5. STATS & PANELS ── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 2rem 0; }
.stat-card { 
    background: var(--bg-el); border: 1px solid var(--bdr); border-radius: 28px; 
    padding: 2rem; box-shadow: var(--shsm); 
    transition: transform 0.4s var(--spring), box-shadow 0.4s; 
    position: relative; overflow: hidden; 
}
.stat-card::before { 
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; 
    background: var(--muted); opacity: 0; transition: opacity 0.4s; 
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shmd); }
.stat-card:hover::before { opacity: 1; }
.stat-lbl { font-family: var(--mono); font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.6rem; }
.stat-val { font-family: var(--disp); font-size: 3.2rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
.stat-sub { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin-top: 1rem; border-top: 1px solid var(--bdr); padding-top: 1rem; }

.printer-row { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.8rem; }
.pdot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; background: var(--muted); transition: background 0.4s, box-shadow 0.4s; }
.pdot.on  { background: var(--ok); box-shadow: 0 0 16px rgba(34,197,94,0.5); }
.pdot.off { background: var(--accent); box-shadow: 0 0 16px rgba(217,70,48,0.4); }
.pdot.chk { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

.panel-wrap { 
    background: var(--bg-el); border-radius: 28px; border: 1px solid var(--bdr); 
    box-shadow: var(--shsm); overflow: hidden; margin-bottom: 1.5rem; transition: box-shadow 0.3s; 
}
.panel-wrap:hover { box-shadow: var(--shmd); }
.panel-top { padding: 1.4rem 2rem; border-bottom: 1px solid var(--bdr); display: flex; justify-content: space-between; align-items: center; }
.panel-top.click { cursor: pointer; user-select: none; transition: background 0.2s; }
.panel-top.click:hover { background: var(--bg-h); }
.panel-top h2 { font-family: var(--sans); font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.panel-meta { display: flex; align-items: center; gap: 0.75rem; }
.chevron { font-size: 0.9rem; color: var(--muted); transition: transform 0.4s var(--spring); display: inline-block; }
.sync-row { display: flex; align-items: center; gap: 0.6rem; font-family: var(--mono); font-size: 0.7rem; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; }
.sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 7px var(--blue); animation: pulse 2s infinite; }

/* ── 5.1 BUSINESS INTELLIGENCE GRID FIXES ── */
.bi-inner { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 1.5rem; 
    padding: 2rem; 
    background: var(--bg); 
}
.bi-card {
    background: var(--bg-el); 
    border: 1px solid var(--bdr); 
    border-radius: 20px;
    padding: 1.5rem; 
    box-shadow: var(--shsm);
    display: flex;
    flex-direction: column;
}
.donut-wrap { 
    position: relative; 
    width: 140px; 
    height: 140px; 
    margin: 1rem auto 0; 
}
.donut-lbl { 
    position: absolute; inset: 0; 
    display: flex; align-items: center; justify-content: center; 
    font-family: var(--disp); font-size: 1.8rem; font-weight: 700; color: var(--ink); 
}
.funnel-row { display: flex; align-items: center; margin-bottom: 14px; font-family: var(--sans); font-size: 0.83rem; }
.fn-lbl { width: 80px; font-weight: 600; color: var(--muted); font-size: 0.75rem; }
.fn-bar-bg { flex-grow: 1; height: 7px; background: var(--bg-h); border-radius: 999px; overflow: hidden; margin: 0 12px; }
.fn-bar { height: 100%; border-radius: 999px; }
.fn-val { width: 36px; text-align: right; font-family: var(--mono); font-weight: 700; color: var(--ink); font-size: 0.8rem; }
.kv-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.8rem; padding: 8px 0; border-bottom: 1px solid var(--bdr); color: var(--muted); }
.kv-row:last-child { border: none; }
.kv-row strong { color: var(--ink); }

/* ── 6. DATA TABLES & BADGES ── */
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.filter-group { display: flex; gap: 0.5rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.filter-group::-webkit-scrollbar { display: none; }
.fbtn { 
    font-family: var(--sans); font-size: 0.82rem; font-weight: 700; 
    padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--bdr); 
    background: transparent; color: var(--muted); cursor: pointer; transition: all 0.25s; 
    display: flex; align-items: center; gap: 6px; scroll-snap-align: start; flex-shrink: 0; position: relative; 
}
.fbtn:hover { border-color: var(--ink); color: var(--ink); }
.fbtn.active { background: var(--ink); color: var(--ink-inv); border-color: var(--ink); }
.fbadge { font-family: var(--mono); font-size: 0.65rem; font-weight: 700; background: rgba(255,255,255,0.2); color: inherit; padding: 2px 7px; border-radius: 999px; }
.fbtn:not(.active) .fbadge { background: var(--bg-h); color: var(--muted); }
.btn-kbd { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); opacity: 0; font-size: 0.55rem; padding: 1px 5px; }
.fbtn:hover .btn-kbd { opacity: 1; }

.tbl-scroll { width: 100%; overflow-x: auto; padding-bottom: 4px; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
thead th { 
    padding: 1.2rem 2rem; font-family: var(--mono); font-size: 0.68rem; font-weight: 700; 
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.09em; 
    border-bottom: 1px solid var(--bdr); background: var(--bg-el); 
    text-align: left; position: sticky; top: 0; z-index: 2; 
}
tbody td { padding: 1.2rem 2rem; border-bottom: 1px solid var(--bdr); vertical-align: middle; }
tbody tr.mrow { cursor: pointer; transition: background 0.18s; }
tbody tr.mrow:hover { background: var(--bg-h); }
.c-tok { font-family: var(--mono); font-size: 1rem; font-weight: 700; color: var(--ink); }
.c-time { font-family: var(--sans); color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.c-amt  { font-family: var(--mono); font-weight: 700; font-size: 1.1rem; color: var(--ink); }

.sbadge { 
    display: inline-flex; padding: 6px 14px; border-radius: 999px; 
    font-family: var(--sans); font-size: 0.72rem; font-weight: 700; 
    text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; 
    border: 1.5px solid transparent; 
}
.sbadge.ok   { background: var(--ink); color: var(--ink-inv); }
.sbadge.hot  { color: var(--warn); border-color: var(--warn); animation: pulse 2s infinite; }
.sbadge.err  { color: var(--accent); background: rgba(217,70,48,0.1); }
.sbadge.mix  { color: var(--blue); background: rgba(37,99,235,0.1); border-color: rgba(37,99,235,0.3); }
.sbadge.pend { color: var(--muted); border-color: var(--bdr); }
.sbadge.gone { color: var(--muted); border-color: var(--bdr-d); }
.abtn { background: var(--ink); color: var(--ink-inv); border: none; padding: 10px 20px; border-radius: 999px; font-family: var(--sans); font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: transform 0.2s var(--spring); }
.abtn:hover { transform: scale(1.06); }

/* ── 7. VEBLEN TOAST (MIXED PAYMENT) ── */
.toast-panel { 
    position: fixed; top: 20px; left: 50%; transform: translate(-50%, -150%); 
    z-index: 9999; background: var(--bg-panel); backdrop-filter: blur(24px); 
    border: 2px solid var(--bdr-d); border-radius: 24px; padding: 2.5rem; 
    box-shadow: var(--sh-toast); width: 90%; max-width: 480px; text-align: center; 
    transition: transform 0.6s var(--spring); 
}
.toast-panel.on { transform: translate(-50%, 0); }
.toast-lbl { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.toast-collect-lbl { font-family: var(--sans); font-weight: 800; color: var(--ink); font-size: 1.2rem; }
.toast-val { font-family: var(--disp); font-size: 5rem; font-weight: 800; color: var(--ink); line-height: 1; margin-bottom: 0.2rem; }
.toast-sub { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--ok); margin-bottom: 2rem; }
.toast-btn { 
    width: 100%; background: var(--ok); color: #fff; border: none; 
    border-radius: 999px; padding: 18px; font-family: var(--sans); 
    font-size: 1.1rem; font-weight: 800; letter-spacing: 0.05em; 
    text-transform: uppercase; cursor: pointer; transition: transform 0.2s; 
    box-shadow: 0 8px 24px rgba(34,197,94,0.3); margin-bottom: 1rem; 
}
.toast-btn:hover { transform: scale(1.03); }
.toast-btn.reject { background: transparent; color: var(--muted); box-shadow: none; border: 2px solid var(--bdr); padding: 14px; font-size: 0.9rem;}
.toast-btn.reject:hover { background: var(--bdr); color: var(--ink); }

/* ── 8. SLIDE PANELS & MODALS ── */
#overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); z-index: 1999; opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease); }
#overlay.on { opacity: 1; pointer-events: auto; }

.slide-panel { 
    position: fixed; z-index: 2000; background: var(--bg-panel); backdrop-filter: blur(40px); 
    display: flex; flex-direction: column; transition: transform 0.5s var(--spring), opacity 0.4s; 
    box-shadow: var(--shmd); border: 1px solid var(--bdr); 
}
.ph { padding: 1.8rem; border-bottom: 1px solid var(--bdr); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.ph h2 { font-family: var(--sans); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.ph-close { background: var(--bg-h); border: none; width: 38px; height: 38px; border-radius: 999px; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.ph-close:hover { background: var(--ink); color: var(--ink-inv); }
.pb { padding: 1.8rem; overflow-y: auto; flex-grow: 1; }
.pf { padding: 1.8rem; border-top: 1px solid var(--bdr); flex-shrink: 0; }

/* Quick Prints Dropzone */
.qp-dropzone {
    border: 2px dashed var(--bdr-d); border-radius: 20px; padding: 2.5rem 1.5rem;
    text-align: center; transition: all 0.2s; background: var(--bg-h);
}
.qp-dropzone.dragover { border-color: var(--blue); background: rgba(37,99,235,0.05); transform: scale(1.02); }
.qp-title { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 0.5rem; }
.qp-inst { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-bottom: 1.5rem; line-height: 1.4; }
.qp-browse-btn {
    background: var(--ink); color: var(--ink-inv); border: none; padding: 10px 20px;
    border-radius: 999px; font-family: var(--sans); font-size: 0.85rem; font-weight: 700;
    cursor: pointer; transition: transform 0.2s var(--spring);
}
.qp-browse-btn:hover { transform: scale(1.05); }
.qp-list-header { font-family: var(--mono); font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin: 2rem 0 1rem; }
.qp-list { display: flex; flex-direction: column; gap: 0.8rem; }
.qp-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-el); border: 1px solid var(--bdr); border-radius: 12px; padding: 1rem;
}
.qp-item-name { font-family: var(--sans); font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.qp-item-meta { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.qp-item-del { background: transparent; border: none; color: var(--accent); cursor: pointer; font-size: 0.8rem; font-weight: 700; padding: 5px; opacity: 0.6; transition: 0.2s; }
.qp-item-del:hover { opacity: 1; }

/* Settings & Pricing Inputs */
.pr-sec { font-family: var(--sans); font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 2rem 0 1.2rem; }
.pr-sec:first-child { margin-top: 0; }
.pr-grp { margin-bottom: 1rem; }
.pr-lbl { display: block; font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 0.45rem; }
.pr-wrap { display: flex; align-items: center; background: var(--bg-el); border: 1.5px solid var(--bdr); border-radius: 14px; overflow: hidden; transition: 0.2s; }
.pr-wrap:focus-within { border-color: var(--ink); }
.pr-in { flex: 1; border: none; background: transparent; padding: 14px; font-family: var(--mono); font-size: 0.95rem; font-weight: 700; color: var(--ink); outline: none; }
.pr-select { cursor: pointer; font-family: var(--sans); appearance: none; -webkit-appearance: none; }
.pr-sfx { padding: 0 14px; font-family: var(--sans); font-weight: 700; color: var(--muted); font-size: 0.95rem; border-left: 1px solid var(--bdr); display: flex; align-items: center; height: 100%; }
.pr-row2 { display: flex; gap: 0.8rem; }
.pr-row2 .pr-grp { flex: 1; }

.strat-wrap { background: var(--bg-h); padding: 1.2rem; border-radius: 16px; margin-bottom: 1.5rem; border: 1px solid var(--bdr); }
.add-tier-btn { background: transparent; border: 1.5px dashed var(--bdr); padding: 10px; border-radius: 10px; color: var(--muted); font-family: var(--sans); font-weight: 700; cursor: pointer; width: 100%; transition: 0.2s; }
.add-tier-btn:hover { border-color: var(--ink); color: var(--ink); }
.tier-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.tog-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding: 14px; background: var(--bg-el); border: 1.5px solid var(--bdr); border-radius: 14px; cursor: pointer; }
.tog-lbl { font-family: var(--sans); font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.tog { position: relative; width: 46px; height: 27px; background: var(--bdr-d); border-radius: 999px; transition: 0.3s; }
.tog::after { content:''; position:absolute; top:2px; left:2px; width:23px; height:23px; background:#fff; border-radius:50%; transition:0.3s var(--spring); box-shadow:0 2px 4px rgba(0,0,0,0.2); }
input:checked + .tog { background: var(--ok); }
input:checked + .tog::after { transform: translateX(19px); }

.save-btn { width: 100%; background: var(--ink); color: var(--ink-inv); font-family: var(--sans); font-size: 0.95rem; font-weight: 700; padding: 18px; border: none; border-radius: 999px; cursor: pointer; transition: transform 0.2s var(--spring); letter-spacing: 0.04em; text-transform: uppercase; }
.save-btn:hover { transform: scale(1.02); }

/* Modals */
#keyModal, #kbdModal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(16px); z-index: 3000; display: none; align-items: center; justify-content: center; }
#keyModal.on, #kbdModal.on { display: flex; }
.key-box, .kbd-box { background: var(--bg-el); border-radius: 28px; padding: 2.5rem; width: 380px; border: 1px solid var(--bdr); box-shadow: var(--shmd); text-align: center; }
.key-box h2 { font-family: var(--disp); font-size: 1.8rem; font-weight: 800; color: var(--ink); margin-bottom: 0.5rem; }
.key-box p { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.key-in { width: 100%; font-family: var(--mono); font-size: 1.5rem; text-align: center; font-weight: 700; border: 2px solid var(--bdr); border-radius: 14px; padding: 14px; background: var(--bg); color: var(--ink); outline: none; margin-bottom: 0.5rem; letter-spacing: 0.2em; }
.key-err { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); margin-bottom: 1rem; min-height: 1em; }
.key-btn { width: 100%; background: var(--ink); color: var(--ink-inv); font-family: var(--sans); font-size: 1rem; font-weight: 800; padding: 18px; border: none; border-radius: 999px; cursor: pointer; text-transform: uppercase; transition: transform 0.2s; }
.key-btn:hover { transform: scale(1.03); }

/* ── 9. RESPONSIVE DESIGN ── */
@media (max-width: 1200px) {
    :root { --sidebar-w: 76px; }
    .app-sidebar { padding: 1rem; align-items: center; }
    .logo, .cafe, .logo-tag, .nav-item span, .nav-kbd, .nav-section { display: none !important; }
    .sidebar-header .logo-wrap::before {
        content: 'P.'; font-family: var(--disp); font-size: 1.5rem; font-weight: 800; color: var(--ink);
        width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
        background: var(--bg-h); border-radius: 14px;
    }
    .nav-item { justify-content: center; padding: 12px; border-radius: 12px; }
    .sidebar-footer { align-items: center; width: 100%; }
}

@media (max-width: 860px) {
    body { display: flex; flex-direction: column; }
    .app-sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 280px;
        transform: translateX(-100%); transition: transform 0.4s var(--spring);
        z-index: 500; padding: 1.5rem; align-items: stretch; border-right: none;
    }
    body.drawer-open .app-sidebar { transform: translateX(0); box-shadow: var(--shmd); }
    .logo, .cafe, .logo-tag, .nav-item span, .nav-kbd, .nav-section { display: flex !important; }
    .sidebar-header .logo-wrap::before { display: none; }
    .sidebar-close { display: flex; }
    
    .app-header { display: none; }
    .mobile-header {
        display: flex; align-items: center; justify-content: space-between;
        padding: 1rem; background: var(--bg-panel); backdrop-filter: blur(24px);
        border-bottom: 1px solid var(--bdr); position: sticky; top: 0; z-index: 95;
    }
    .menu-toggle { background: var(--bg-h); border: none; width: 40px; height: 40px; border-radius: 12px; color: var(--ink); display: flex; align-items: center; justify-content: center; }
    
    .app-content { padding: 1rem; padding-bottom: 100px; }
    .stats-grid { grid-template-columns: 1fr; }
    
    .toast-panel { top: auto; bottom: 90px; transform: translate(-50%, 150%); }
    .toast-panel.on { transform: translate(-50%, 0); }
    
    .slide-panel { top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 90vh; border-radius: 32px 32px 0 0; transform: translateY(100%); }
    .slide-panel.on { transform: translateY(0); }
    
    /* Mobile Table Override */
    thead { display: none; }
    tbody, tbody tr, tbody td { display: block; }
    tbody tr.mrow {
        display: flex; flex-wrap: wrap; justify-content: space-between;
        padding: 1.25rem; margin-bottom: 0.75rem; background: var(--bg-el);
        border-radius: 20px; border: 1px solid var(--bdr); box-shadow: var(--shsm);
    }
    tbody tr.mrow td { border: none !important; padding: 0 !important; }
    .hide-m { display: none !important; }
    
    /* Mobile Dock */
    #mainDock {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        justify-content: space-around; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
        background: var(--bg-panel); backdrop-filter: blur(24px);
        border-top: 1px solid var(--bdr); z-index: 500;
    }
    .dpill {
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        background: transparent; border: none; color: var(--ink); font-family: var(--sans);
    }
    .dock-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; }
}

@media (min-width: 861px) {
    .slide-panel { top: 1.5rem; right: 1.5rem; width: 460px; height: calc(100vh - 3rem); border-radius: 28px; }
    .slide-panel.off { transform: translateX(120%); opacity: 0; }
    .slide-panel.on  { transform: translateX(0); opacity: 1; }
    #mainDock { display: none; }
}