/* ============================================================
   ECHELON BREW — ERP & Cafe Management
   Theme: Coffee Brown · Black · Gold · White
   ============================================================ */

:root {
  --gold: #c9a227;
  --gold-soft: #d9bd5e;
  --coffee: #6f4e2e;
  --coffee-deep: #4a3420;
  --coffee-light: #a9784a;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px rgba(0,0,0,.18);
  --shadow-sm: 0 4px 14px rgba(0,0,0,.10);
  --tr: .22s cubic-bezier(.4,0,.2,1);
  --sidebar-w: 256px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Bungee', 'Arial Black', var(--font);
}

/* ===== Themes (Admin/Master selectable) ===== */
/* Espresso — warm charcoal + gold (default dark) */
[data-theme="espresso"], [data-theme="dark"] {
  --gold: #dab64c; --gold-soft: #efd483; --coffee-light: #c08f5a;
  --bg: #0b0b0d; --bg-2: #111114; --surface: #17181b; --surface-2: #1e2024; --surface-3: #282a30;
  --border: #30323a; --text: #f4f1e9; --text-2: #b2ac9f; --text-3: #7f7a70;
  --sidebar: #0a0a0c; --sidebar-active: #1d1f25;
  --shadow: 0 18px 48px rgba(0,0,0,.55); --shadow-sm: 0 6px 18px rgba(0,0,0,.40); --glass: rgba(18,19,22,.72);
}
/* Ivory — warm cream (default light) */
[data-theme="ivory"], [data-theme="light"] {
  --gold: #b7891b; --gold-soft: #d9b755; --coffee-light: #9c6f43;
  --bg: #f6f2ea; --bg-2: #ece3d4; --surface: #ffffff; --surface-2: #faf6ee; --surface-3: #f0e9dc;
  --border: #e6ddcd; --text: #221b13; --text-2: #6b5e4c; --text-3: #9b8d77;
  --sidebar: #15120e; --sidebar-active: #271f17;
  --shadow: 0 16px 40px rgba(74,52,32,.16); --shadow-sm: 0 6px 18px rgba(74,52,32,.10); --glass: rgba(255,255,255,.80);
}
/* Midnight — deep navy + gold */
[data-theme="midnight"] {
  --gold: #e3c95f; --gold-soft: #f3e093; --coffee-light: #8aa0c8;
  --bg: #080b14; --bg-2: #0d1220; --surface: #121829; --surface-2: #192134; --surface-3: #232d44;
  --border: #2a3552; --text: #eef2fb; --text-2: #a9b4cc; --text-3: #74809c;
  --sidebar: #070a12; --sidebar-active: #1a2239;
  --shadow: 0 18px 48px rgba(0,0,0,.6); --shadow-sm: 0 6px 18px rgba(0,0,0,.45); --glass: rgba(13,18,32,.74);
}
/* Mocha — creamy latte (light, warm) */
[data-theme="mocha"] {
  --gold: #a9742f; --gold-soft: #cf9d52; --coffee-light: #9c6f43;
  --bg: #efe5d6; --bg-2: #e6d8c4; --surface: #fbf4e9; --surface-2: #f3e8d6; --surface-3: #ead9c1;
  --border: #dcc9ad; --text: #3a2a1b; --text-2: #7a6448; --text-3: #a58a68;
  --sidebar: #2b1d12; --sidebar-active: #3c2a1a;
  --shadow: 0 16px 40px rgba(80,55,30,.18); --shadow-sm: 0 6px 18px rgba(80,55,30,.12); --glass: rgba(251,244,233,.82);
}
/* Forest — dark emerald + gold */
[data-theme="forest"] {
  --gold: #d9bf63; --gold-soft: #eed98f; --coffee-light: #7fae8c;
  --bg: #07110d; --bg-2: #0b1812; --surface: #10201a; --surface-2: #172a22; --surface-3: #1f372c;
  --border: #274236; --text: #ecf4ee; --text-2: #a7c0b2; --text-3: #6f8a7c;
  --sidebar: #06100b; --sidebar-active: #16271f;
  --shadow: 0 18px 48px rgba(0,0,0,.55); --shadow-sm: 0 6px 18px rgba(0,0,0,.4); --glass: rgba(16,32,26,.72);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background var(--tr), color var(--tr);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
::selection { background: var(--gold); color: #1a1209; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--coffee-light); }
::-webkit-scrollbar-track { background: transparent; }

/* ============ Boot screen ============ */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 28px;
  background: radial-gradient(circle at 50% 35%, #1c1409, #0b0805 70%);
  justify-items: center; z-index: 999;
}
.boot-logo { width: 220px; max-width: 60vw; filter: drop-shadow(0 0 30px rgba(201,162,39,.35)); }
/* Brand logo images */
.brand-logo { display: block; height: auto; }
img.logo-white { content: url("../assets/logo-white.png"); }
.sidebar-logo { width: 160px; }
.hero-logo { width: 220px; }
.login-logo { width: 150px; margin-bottom: 18px; }
.report-logo { height: 40px; }

/* Simplified login hero — centered animated logo + ambient orbs */
.auth-hero-center { flex: 1; display: grid; place-content: center; position: relative; z-index: 2; }
.float-logo { width: 300px; max-width: 72%; animation: floaty 5.5s ease-in-out infinite, glowPulse 4.5s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes glowPulse { 0%, 100% { filter: drop-shadow(0 0 16px rgba(201,162,39,.22)); } 50% { filter: drop-shadow(0 0 44px rgba(201,162,39,.55)); } }
.auth-orbs { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.auth-orbs span { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .5; }
.auth-orbs span:nth-child(1) { width: 250px; height: 250px; background: rgba(201,162,39,.55); top: 8%; left: 6%; animation: drift1 15s ease-in-out infinite; }
.auth-orbs span:nth-child(2) { width: 210px; height: 210px; background: rgba(169,120,74,.55); bottom: 10%; right: 8%; animation: drift2 17s ease-in-out infinite; }
.auth-orbs span:nth-child(3) { width: 170px; height: 170px; background: rgba(201,162,39,.35); top: 52%; left: 54%; animation: drift3 19s ease-in-out infinite; }
@keyframes drift1 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(46px,34px); } }
@keyframes drift2 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-52px,-30px); } }
@keyframes drift3 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(24px,-44px); } }
.boot-spin {
  width: 42px; height: 42px; border: 4px solid rgba(201,162,39,.25);
  border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Auth / Login — immersive ============ */
.auth-screen { position: fixed; inset: 0; overflow: hidden; display: grid; place-items: center; background: #08070a; padding: 20px; }
.auth-bg { position: absolute; inset: -3%; z-index: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 25%; gap: 6px; transform: scale(1.06); animation: bgdrift 55s ease-in-out infinite alternate; }
.auth-bg span { background-size: cover; background-position: center; border-radius: 4px; }
@keyframes bgdrift { from { transform: scale(1.06) translate(0, 0); } to { transform: scale(1.17) translate(-3%, -2%); } }
.auth-bg-veil { position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(circle at 28% 24%, rgba(14,10,7,.42), rgba(8,7,10,.93) 78%),
    linear-gradient(120deg, rgba(8,7,10,.95) 0%, rgba(40,26,12,.5) 52%, rgba(8,7,10,.92) 100%);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.auth-stage { position: relative; z-index: 3; width: min(440px, 94vw); display: flex; flex-direction: column; align-items: center; gap: 16px; animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.auth-card {
  width: 100%; padding: 32px 30px 28px; border-radius: 26px; color: #f4ece0;
  background: linear-gradient(160deg, rgba(32,25,19,.76), rgba(13,10,9,.85));
  border: 1px solid rgba(218,182,76,.24);
  box-shadow: 0 44px 110px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.07);
  -webkit-backdrop-filter: blur(22px) saturate(1.25); backdrop-filter: blur(22px) saturate(1.25);
}
.auth-logo-top { display: block; width: 158px; margin: 2px auto 20px; filter: drop-shadow(0 6px 26px rgba(218,182,76,.42)); animation: floaty 6s ease-in-out infinite; }
.auth-card h2 { color: #fff; font-size: 23px; text-align: center; margin: 0 0 4px; }
.auth-card .sub { color: rgba(244,236,224,.62); font-size: 14px; text-align: center; margin-bottom: 22px; }
.auth-card label { color: rgba(244,236,224,.72); }
.auth-card .input, .auth-card .select, .auth-card textarea.input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff; }
.auth-card .input::placeholder { color: rgba(255,255,255,.38); }
.auth-card .input:focus, .auth-card .select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(218,182,76,.22); background: rgba(255,255,255,.09); }
.auth-card .input-group .prefix { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.82); }
.auth-card .otp-boxes input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #fff; }
.auth-card .otp-demo { background: rgba(218,182,76,.13); border-color: rgba(218,182,76,.5); color: #f4ece0; }
.auth-card .hint { color: rgba(255,255,255,.5); }
.auth-foot { position: relative; z-index: 3; color: rgba(255,255,255,.45); font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; }
.demo-accounts { border-top-color: rgba(255,255,255,.12); }
.demo-accounts summary { color: var(--gold-soft); }
.demo-accounts table { color: rgba(255,255,255,.62); }
.demo-accounts th { color: rgba(255,255,255,.5); }
.demo-accounts td { color: rgba(255,255,255,.62); border-color: rgba(255,255,255,.1); }
.demo-accounts td:first-child { color: #fff; }
.demo-accounts .use { color: var(--gold-soft); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.input, .select, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: border var(--tr), box-shadow var(--tr); outline: none;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.18);
}
.input-group { display: flex; }
.input-group .prefix {
  display: grid; place-content: center; padding: 0 12px; border: 1px solid var(--border);
  border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface-3);
  color: var(--text-2); font-weight: 600; white-space: nowrap;
}
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.otp-boxes { display: flex; gap: 10px; justify-content: space-between; }
.otp-boxes input {
  width: 100%; aspect-ratio: 1; text-align: center; font-size: 22px; font-weight: 700;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.otp-boxes input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.18); outline: none; }
.otp-demo {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px;
  background: rgba(201,162,39,.12); border: 1px dashed var(--gold); color: var(--text);
}
.demo-accounts { margin-top: 22px; border-top: 1px dashed var(--border); padding-top: 16px; }
.demo-accounts summary { cursor: pointer; font-size: 13px; color: var(--gold); font-weight: 600; }
.demo-accounts table { width: 100%; font-size: 12px; margin-top: 10px; border-collapse: collapse; }
.demo-accounts td { padding: 4px 6px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.demo-accounts td:first-child { color: var(--text); font-weight: 600; }
.demo-accounts .use { cursor: pointer; color: var(--gold); }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; cursor: pointer; transition: var(--tr); white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-soft)); color: #2a1d09; }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(201,162,39,.4); }
.btn-coffee { background: var(--coffee); color: #fff; }
.btn-coffee:hover { background: var(--coffee-deep); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--coffee-light); }
.btn-danger { background: #b3382f; color: #fff; }
.btn-danger:hover { background: #962e26; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-icon { padding: 9px; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer; transition: var(--tr); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ============ App layout ============ */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar); color: #e9ddca; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; border-right: 1px solid rgba(255,255,255,.06); z-index: 50;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px;
  font-family: var(--display); font-size: 17px; line-height: 1; letter-spacing: 1px; color: #fff;
}
.sidebar-brand .mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-content: center; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--gold), var(--coffee-light)); color: #1a1209;
}
.sidebar-brand small { display: block; font-family: var(--font); font-size: 9px; letter-spacing: 3px; color: var(--gold); margin-top: 4px; font-weight: 700; }
.nav { flex: 1; overflow-y: auto; padding: 8px 12px 24px; }
.nav-group-label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: #8c7c64; padding: 16px 12px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #c8baa3; cursor: pointer; transition: var(--tr); font-size: 14px; font-weight: 500; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
.nav-item .nav-badge { margin-left: auto; background: var(--gold); color: #1a1209; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; transition: var(--tr); }
.sidebar-user:hover { background: rgba(255,255,255,.05); }
.sidebar-user .meta { overflow: hidden; }
.sidebar-user .meta b { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta span { font-size: 11px; color: var(--gold); text-transform: capitalize; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 14px 24px; background: var(--glass); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar .crumb { font-size: 12px; color: var(--text-3); }
.topbar .spacer { flex: 1; }
.topbar-search { position: relative; max-width: 320px; flex: 1; }
.topbar-search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.topbar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.hamburger { display: none; }
.btn-icon svg { width: 20px; height: 20px; display: block; }
.hamburger svg { width: 24px; height: 24px; }
.hamburger { color: var(--text); }

.content { padding: 24px; flex: 1; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 23px; font-weight: 800; }
.page-head p { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ Notifications / dropdowns ============ */
.popover { position: relative; }
.popover-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 340px; max-width: 90vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); z-index: 60; overflow: hidden; animation: fade .15s ease;
}
.popover-panel .ph { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.popover-panel .ph b { font-size: 14px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif {
  display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--tr);
}
.notif:hover { background: var(--surface-2); }
.notif.unread { background: rgba(201,162,39,.07); }
.notif .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex: 0 0 auto; }
.notif.read .dot { background: var(--border); }
.notif .n-body b { font-size: 13px; display: block; }
.notif .n-body p { font-size: 12px; color: var(--text-2); }
.notif .n-body time { font-size: 11px; color: var(--text-3); }
.notif-bell { position: relative; }
.notif-bell .count {
  position: absolute; top: -2px; right: -2px; background: #d6453a; color: #fff; font-size: 10px;
  font-weight: 700; min-width: 16px; height: 16px; border-radius: 10px; display: grid; place-content: center; padding: 0 3px;
}

/* ============ Cards & grid ============ */
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); transition: var(--tr);
}
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--text-3); }

.stat { position: relative; overflow: hidden; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-content: center; margin-bottom: 14px; }
.stat .ico svg { width: 22px; height: 22px; }
.stat .val { font-size: 28px; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.stat .trend { font-size: 12px; margin-top: 8px; font-weight: 600; }
.trend.up { color: #4caf6d; } .trend.down { color: #e0655a; }
.ico.gold { background: rgba(201,162,39,.16); color: var(--gold); }
.ico.coffee { background: rgba(111,78,46,.2); color: var(--coffee-light); }
.ico.green { background: rgba(76,175,109,.16); color: #4caf6d; }
.ico.red { background: rgba(214,69,58,.16); color: #e0655a; }
.ico.blue { background: rgba(82,139,201,.16); color: #6ba2e0; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
table.tbl th {
  text-align: left; padding: 13px 16px; background: var(--surface-2); color: var(--text-2);
  font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--border);
}
table.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: var(--tr); }
table.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .row-actions { display: flex; gap: 6px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty svg { width: 46px; height: 46px; opacity: .5; margin-bottom: 12px; }

/* ============ Badges ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 30px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-green { background: rgba(76,175,109,.15); color: #4caf6d; }
.b-red { background: rgba(214,69,58,.15); color: #e0655a; }
.b-gold { background: rgba(201,162,39,.16); color: var(--gold); }
.b-blue { background: rgba(107,162,224,.16); color: #6ba2e0; }
.b-coffee { background: rgba(169,120,74,.18); color: var(--coffee-light); }
.b-gray { background: var(--surface-3); color: var(--text-2); }
.badge.solid::before { display: none; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); display: inline-block; }

.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-content: center; font-weight: 700; color: #1a1209; background: linear-gradient(135deg, var(--gold), var(--coffee-light)); flex: 0 0 auto; font-size: 14px; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.user-cell { display: flex; align-items: center; gap: 11px; }
.user-cell .meta b { display: block; font-size: 14px; }
.user-cell .meta span { font-size: 12px; color: var(--text-3); }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8,5,3,.6); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 200; padding: 20px; animation: fade .15s ease;
}
.modal {
  width: min(560px, 96vw); max-height: 92vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  animation: pop .2s cubic-bezier(.2,.8,.3,1.2);
}
.modal.wide { width: min(820px, 96vw); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* ============ Toast ============ */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 260px; max-width: 380px;
  animation: slidein .25s ease; border-left: 4px solid var(--gold);
}
@keyframes slidein { from { transform: translateX(120%); } to { transform: none; } }
.toast.ok { border-left-color: #4caf6d; }
.toast.err { border-left-color: #d6453a; }
.toast.info { border-left-color: #6ba2e0; }
.toast b { font-size: 14px; } .toast p { font-size: 12px; color: var(--text-2); }

/* ============ Misc utilities ============ */
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 16px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; transition: var(--tr); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 30px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 6px 14px; border-radius: 30px; cursor: pointer; font-weight: 600; font-size: 13px; transition: var(--tr); }
.seg button.active { background: var(--gold); color: #1a1209; }

.progress { height: 8px; background: var(--surface-3); border-radius: 20px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--coffee-light)); border-radius: 20px; transition: width .4s ease; }

.kpi-mini { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.kpi-mini .v { font-size: 18px; font-weight: 800; } .kpi-mini .l { font-size: 12px; color: var(--text-2); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline .ev { position: relative; padding: 0 0 18px 0; }
.timeline .ev::before { content: ""; position: absolute; left: -22px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); border: 2px solid var(--surface); }
.timeline .ev b { font-size: 13px; } .timeline .ev p { font-size: 12px; color: var(--text-2); } .timeline .ev time { font-size: 11px; color: var(--text-3); }

/* Table grid for floor / menu / kanban */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 14px; }
.table-tile {
  aspect-ratio: 1; border-radius: var(--radius); border: 2px solid var(--border); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: var(--tr); background: var(--surface); position: relative;
}
.table-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.table-tile .tnum { font-size: 22px; font-weight: 800; }
.table-tile .tcap { font-size: 11px; color: var(--text-3); }
.table-tile .tval { font-size: 13px; font-weight: 800; color: var(--gold); }
.table-tile .ttime { font-size: 10px; color: var(--text-2); }
.table-tile.available { border-color: #4caf6d; } .table-tile.available .tnum { color: #4caf6d; }
.table-tile.occupied { border-color: #d6453a; background: rgba(214,69,58,.06); } .table-tile.occupied .tnum { color: #e0655a; }
.table-tile.reserved { border-color: var(--gold); background: rgba(201,162,39,.06); } .table-tile.reserved .tnum { color: var(--gold); }
.table-tile.cleaning { border-color: #6ba2e0; background: rgba(107,162,224,.06); } .table-tile.cleaning .tnum { color: #6ba2e0; }

.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: start; }
.kanban .col { background: var(--surface-2); border-radius: var(--radius); padding: 12px; border: 1px solid var(--border); }
.kanban .col h4 { font-size: 13px; margin-bottom: 12px; display: flex; justify-content: space-between; }
.kanban .kc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.kanban .kc b { font-size: 13px; } .kanban .kc p { font-size: 12px; color: var(--text-2); }

.menu-card { overflow: hidden; padding: 0; }
.menu-card .thumb { height: 150px; display: grid; place-content: center; font-size: 44px; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); background-size: cover; background-position: center; transition: transform .5s cubic-bezier(.2,.7,.2,1); position: relative; }
.menu-card .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.32), transparent 55%); opacity: .55; }
.menu-card:hover .thumb { transform: scale(1.06); }
.menu-card .mc-body { padding: 14px; }
.menu-card .mc-body .price { color: var(--gold); font-weight: 800; }
.mini-thumb { width: 40px; height: 40px; border-radius: 9px; background-size: cover; background-position: center; flex: 0 0 auto; border: 1px solid var(--border); }
.seg-scroll { display: flex; overflow-x: auto; max-width: 100%; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.seg-scroll button { white-space: nowrap; flex: 0 0 auto; }
/* grid/flex children must be allowed to shrink, otherwise wide content overflows the screen */
.form-grid > *, .field { min-width: 0; }
.menu-cart { position: sticky; bottom: 16px; margin-top: 18px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-radius: 16px; background: linear-gradient(135deg, var(--coffee-deep), var(--surface-2));
  border: 1px solid var(--gold); box-shadow: 0 16px 40px rgba(0,0,0,.35); animation: rise .3s ease both; }
.menu-cart .mc-info { display: flex; flex-direction: column; line-height: 1.2; }
.menu-cart .mc-info b { font-size: 15px; } .menu-cart .mc-info span { color: var(--gold); font-weight: 800; font-size: 15px; }

/* ============ Customer Portal ============ */
.cust-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.cust-top .clogo { height: 28px; }
.cust-top nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.cust-top nav button { background: transparent; border: 0; color: var(--text-2); font-weight: 600; padding: 8px 14px; border-radius: 30px; cursor: pointer; transition: var(--tr); font-size: 14px; }
.cust-top nav button:hover { color: var(--text); }
.cust-top nav button.active { background: var(--gold); color: #1a1209; }
.cust-hero { position: relative; min-height: 340px; display: grid; place-items: center; text-align: center; overflow: hidden; padding: 48px 20px; }
.cust-hero .hbg { position: absolute; inset: 0; z-index: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 50%; gap: 6px; transform: scale(1.06); animation: bgdrift 50s ease-in-out infinite alternate; }
.cust-hero .hbg span { background-size: cover; background-position: center; }
.cust-hero .hveil { position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle at 50% 30%, rgba(8,7,10,.55), rgba(8,7,10,.9)); }
.cust-hero .hcontent { position: relative; z-index: 2; color: #fff; }
.cust-hero img.hlogo { width: 210px; max-width: 70vw; filter: drop-shadow(0 0 26px rgba(218,182,76,.45)); animation: floaty 6s ease-in-out infinite; }
.cust-hero h1 { font-size: 30px; margin: 16px 0 6px; color: #fff; }
.cust-hero p { color: rgba(255,255,255,.78); max-width: 540px; margin: 0 auto 20px; }
.cust-wrap { max-width: 1120px; margin: 0 auto; padding: 24px; animation: rise .4s ease both; }
.cust-foot { text-align: center; color: var(--text-3); font-size: 12px; padding: 30px; }

/* ============ Chat / Assistant ============ */
.chat-wrap { display: flex; flex-direction: column; height: min(62vh, 580px); }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 82%; padding: 12px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; animation: riseSm .25s ease both; }
.bubble.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--gold), var(--coffee-light)); color: #1a1209; border-bottom-right-radius: 5px; font-weight: 500; }
.bubble .list-row { border-color: rgba(140,140,140,.18); padding: 6px 0; }
.chat-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--border); }
.chip-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); padding: 6px 12px; border-radius: 30px; cursor: pointer; font-size: 12px; font-weight: 600; transition: var(--tr); white-space: nowrap; }
.chip-btn:hover { border-color: var(--gold); color: var(--text); transform: translateY(-1px); }
.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; padding: 11px 16px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); outline: none; transition: var(--tr); }
.chat-input input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.16); }
.chat-input .btn { border-radius: 50%; width: 44px; height: 44px; padding: 0; flex: 0 0 auto; }
.chat-input .btn svg { width: 18px; height: 18px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(120deg, rgba(218,182,76,.10), transparent 70%); }
.chat-head-meta b { font-size: 15px; }
.ai-orb { position: relative; width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; }
.ai-orb.sm { width: 26px; height: 26px; }
.ai-orb .ai-face { width: 100%; height: 100%; animation: floaty 4s ease-in-out infinite; }
.ai-orb .ai-face svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 8px rgba(218,182,76,.45)); }
.ai-orb .ai-ring { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(218,182,76,.55); animation: aipulse 2.4s ease-out infinite; }
.ai-orb .ai-ring.r2 { animation-delay: 1.2s; }
@keyframes aipulse { 0% { transform: scale(.65); opacity: .85; } 100% { transform: scale(1.55); opacity: 0; } }
.ai-eye { animation: aiblink 4.5s infinite; transform-origin: center; }
@keyframes aiblink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.12); } }
.ai-spark { animation: aispin 7s linear infinite; transform-origin: 24px 24px; }
@keyframes aispin { to { transform: rotate(360deg); } }
.bubble.bot { display: flex; gap: 8px; align-items: flex-start; }
.bubble.bot .b-ava { flex: 0 0 auto; margin-top: 1px; }
.bubble.bot .b-body { flex: 1; min-width: 0; }
.typing { display: flex; gap: 4px; align-items: center; padding: 5px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: typedot 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typedot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.chat-input .mic { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); }
.chat-input .mic:hover { color: var(--gold); border-color: var(--gold); }
.chat-input .mic.on { background: #d6453a; color: #fff; border-color: #d6453a; animation: micpulse 1.1s infinite; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(214,69,58,.5); } 50% { box-shadow: 0 0 0 9px rgba(214,69,58,0); } }
.ai-orb.listening .ai-ring { border-color: rgba(214,69,58,.75); animation-duration: 1s; }
.ai-orb.speaking .ai-face { animation: floaty 1s ease-in-out infinite; }
.ai-orb.speaking .ai-ring { border-color: rgba(76,175,109,.75); animation-duration: 1.1s; }
.chat-lang { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 5px 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chat-lang:focus { outline: none; border-color: var(--gold); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }

/* Login responsive */
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* App responsive */
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2,1fr); } .kanban { grid-template-columns: 1fr; } }
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%);
    transition: transform var(--tr); box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 45; }
  .hamburger { display: grid; }
  .topbar-search { display: none; }
}
@media (max-width: 680px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .floor { grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); }
}
.hide-sm { }
@media (max-width: 680px) { .hide-sm { display: none !important; } }

[data-theme="light"] .sidebar-brand small { color: var(--gold-soft); }

/* ============ Smooth animations ============ */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes riseSm { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes glowin { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

.content { animation: rise .42s cubic-bezier(.2,.7,.2,1) both; }
.content .page-head { animation: riseSm .4s ease both; }
.content .grid > * { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.content .grid > *:nth-child(1) { animation-delay: .03s; }
.content .grid > *:nth-child(2) { animation-delay: .07s; }
.content .grid > *:nth-child(3) { animation-delay: .11s; }
.content .grid > *:nth-child(4) { animation-delay: .15s; }
.content .grid > *:nth-child(5) { animation-delay: .19s; }
.content .grid > *:nth-child(6) { animation-delay: .23s; }
.content .grid > *:nth-child(7) { animation-delay: .27s; }
.content .grid > *:nth-child(8) { animation-delay: .31s; }
.content > .card, .content > .table-wrap, .content > .tabs { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.content #emp-table, .content #inv-table, .content [id$="-table"], .content [id$="-body"], .content [id$="-grid"] { animation: glowin .4s ease both; }

.btn { transition: transform var(--tr), box-shadow var(--tr), background var(--tr), border-color var(--tr); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.stat, .menu-card, .table-tile, .kpi-mini { transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr); }
.stat:hover, .menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat .ico { transition: transform var(--tr); }
.stat:hover .ico { transform: scale(1.08) rotate(-4deg); }
.nav-item, .tab, .badge, .chip, .avatar { transition: var(--tr); }
.popover-panel, .modal { will-change: transform, opacity; }
.notif { transition: background var(--tr), transform var(--tr); }
.progress > span { transition: width .6s cubic-bezier(.2,.7,.2,1); }
.boot-logo { animation: glowin .6s ease both; }

/* ============ Premium polish ============ */
body { background-image: radial-gradient(circle at 100% 0%, rgba(218,182,76,.06), transparent 520px), radial-gradient(circle at 0% 100%, rgba(169,120,74,.05), transparent 480px); background-attachment: fixed; }
.sidebar { box-shadow: inset -1px 0 0 rgba(255,255,255,.04); }
.sidebar-brand .mark { box-shadow: 0 8px 20px rgba(218,182,76,.35); }
.nav-item.active { background: linear-gradient(90deg, rgba(218,182,76,.18), rgba(218,182,76,.02)); box-shadow: inset 3px 0 0 var(--gold); }
.nav-item.active svg { color: var(--gold); }
.card { background-image: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,0) 140px); border-radius: 16px; }
.card-head h3 { letter-spacing: -.2px; }
.stat { overflow: hidden; }
.stat::after { content: ""; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(218,182,76,.12), transparent 70%); pointer-events: none; }
.stat .val { font-size: 30px; letter-spacing: -.5px; }
.stat .ico { box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.topbar { box-shadow: 0 6px 24px -16px rgba(0,0,0,.5); }
.topbar h1 { letter-spacing: -.3px; }
.page-head h2 { letter-spacing: -.5px; }
.btn-primary { box-shadow: 0 8px 22px -8px rgba(218,182,76,.5); }
.btn-primary:hover { box-shadow: 0 12px 28px -6px rgba(218,182,76,.6); transform: translateY(-2px); }
.menu-card { border-radius: 16px; }
.menu-card .mc-body b { letter-spacing: -.2px; }
table.tbl tbody tr:hover { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--gold); }
.badge { letter-spacing: .2px; }
.modal { border-radius: 24px; }
.input, .select, textarea.input { border-radius: 11px; }
.avatar { box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.table-tile { border-radius: 16px; }
::-webkit-scrollbar { width: 9px; height: 9px; }

/* Theme picker swatches */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.theme-swatch { cursor: pointer; border: 2px solid var(--border); border-radius: 14px; overflow: hidden; transition: var(--tr); background: var(--surface-2); }
.theme-swatch:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.theme-swatch.active { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(218,182,76,.22); }
.theme-swatch .sw-prev { height: 56px; display: flex; }
.theme-swatch .sw-prev span { flex: 1; }
.theme-swatch .sw-name { padding: 8px 10px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.theme-swatch .sw-dot { width: 10px; height: 10px; border-radius: 50%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

.print-only { display: none; }
@media print {
  .sidebar, .topbar, .page-actions, .no-print { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; }
  .print-only { display: block; }
}

/* ============================================================
   Real logo · PWA · mobile-first polish
   ============================================================ */
html, body { overflow-x: hidden; }
.sidebar-brand { flex-direction: column; align-items: flex-start; gap: 5px; }
.sidebar-brand .brand-logo { width: 158px; max-width: 78%; height: auto; display: block; }
.sidebar-brand .brand-cap { font-family: var(--font); font-size: 9px; letter-spacing: 3px; color: var(--gold); font-weight: 700; padding-left: 2px; }

/* PWA standalone — respect notches / home indicators */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .topbar { padding-top: calc(14px + env(safe-area-inset-top)); }
  .sidebar { padding-top: env(safe-area-inset-top); }
  .content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .toast-stack { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* Tablet / small laptop */
@media (max-width: 920px) {
  .sidebar { width: min(86vw, 320px); }
  .topbar .crumb { display: none; }
  #install-btn { padding: 8px 11px; font-size: 12px; }
}

/* Phones */
@media (max-width: 680px) {
  .topbar { gap: 8px; padding: 12px 14px; flex-wrap: nowrap; }
  .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #install-btn { font-size: 0; padding: 9px; }           /* show as icon-only ⬇ */
  #install-btn::before { content: "⬇"; font-size: 15px; }

  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .page-actions .btn { flex: 0 0 auto; }   /* natural width — no chunky full-width buttons */

  /* bigger, finger-friendly touch targets */
  .btn, .btn-sm { min-height: 44px; }
  .btn-icon { min-width: 42px; min-height: 42px; display: inline-grid; place-content: center; }
  .nav-item { padding: 13px 12px; font-size: 15px; }
  .input, .select, textarea.input { font-size: 16px; }    /* 16px stops iOS auto-zoom */

  /* modals become bottom sheets with a sticky action bar */
  .modal-overlay { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; max-width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; animation: sheetUp .25s cubic-bezier(.2,.8,.3,1); }
  .modal-body { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
  .modal-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }

  /* kanban / orders: swipeable columns instead of a tall stack */
  .kanban { grid-auto-flow: column; grid-auto-columns: 84%; grid-template-columns: none; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .kanban .col { scroll-snap-align: start; }

  table.tbl { font-size: 13px; }
  .stat .val { font-size: 24px; }
  .content { padding: 14px; }
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ===== Bottom thumb navigation (mobile only) ===== */
.bottom-nav { display: none; }
@media (max-width: 680px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--sidebar); border-top: 1px solid rgba(255,255,255,.08);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 22px rgba(0,0,0,.28);
  }
  .bottom-nav button {
    flex: 1; min-width: 0; background: none; border: none; color: #c8baa3; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 9px 2px 8px; font-size: 10px; font-weight: 700; letter-spacing: .2px;
  }
  .bottom-nav button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bottom-nav button svg { width: 22px; height: 22px; }
  .bottom-nav button.active { color: var(--gold); }
  .bottom-nav button:active { background: rgba(255,255,255,.06); }
  /* keep content clear of the fixed bar */
  .content { padding-bottom: 82px !important; }
  #cmain { padding-bottom: 80px; }
  .cust-foot { margin-bottom: 60px; }
  .menu-cart { bottom: 64px !important; }
}

/* ===== Quantity stepper (menu cards & editors) ===== */
.qty-step { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 30px; padding: 2px; }
.qty-step .btn-icon { min-width: 32px; min-height: 32px; padding: 4px 8px; font-size: 18px; line-height: 1; }
.qty-step b { min-width: 22px; text-align: center; font-size: 14px; }

/* ===== Drawer above the bottom nav so the user/name isn't hidden ===== */
@media (max-width: 920px) {
  .sidebar { z-index: 70; }
  .scrim { z-index: 65 !important; }
  .sidebar-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ===== Tables → clean stacked cards on phones (no cut-off columns) ===== */
@media (max-width: 680px) {
  .table-wrap { border: none; overflow: visible; background: transparent; }
  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr { border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; padding: 4px 14px; background: var(--surface); }
  table.tbl td { display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: right !important; padding: 9px 0; border: none; border-bottom: 1px solid rgba(140,140,140,.14); min-height: 0; }
  table.tbl tr td:last-child { border-bottom: none; }
  table.tbl td::before { content: attr(data-label); font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; text-align: left; flex: 0 0 auto; }
  table.tbl td:not([data-label])::before { content: ""; }
}

/* ===== Customer portal: compact header on mobile (bottom nav takes over) ===== */
#capp { overflow-x: hidden; }
.cust-top .clogo { cursor: pointer; }
@media (max-width: 680px) {
  .cust-top { gap: 10px; padding: 10px 14px; }
  #cnav { display: none; }                 /* hide the tall top tab block */
  .cust-top .btn { margin-left: auto; }     /* push Staff Login to the right */
  .cust-wrap { padding: 16px; }
}
