/* =====================================================================
   DinePro — Design System
   One file, token-driven. Every page uses these tokens/components;
   avoid page-level inline styles for colors, spacing or type.
   ===================================================================== */

:root{
  /* Brand */
  /* Brand — DinePro "fire" palette, sampled from the logo flame/wordmark */
  --brand: #E65100;
  --brand-hover: #CC4800;
  --brand-dark: #A83B00;
  --brand-light: #FFF5EB;
  --brand-ring: rgba(230,81,0,.18);
  --brand-yellow: #FCCC08;
  --brand-amber: #FB9701;
  --brand-flame: #F35901;
  --brand-gradient: linear-gradient(135deg,#FCCC08 0%,#FB9701 48%,#F35901 100%);
  --brand-gradient-v: linear-gradient(180deg,#FCCC08 0%,#FB9701 50%,#F35901 100%);

  /* Neutrals */
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;          /* elevated/subtle surface: table heads, inputs hover */
  --border: #E6E8EC;
  --border-strong: #D5D9DF;
  --text: #111827;
  --text-2: #4B5563;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;

  /* Sidebar (dark, premium) */
  --sidebar-bg: #0B0B0D;
  --sidebar-bg-2: #161618;
  --sidebar-text: #A8A8B0;
  --sidebar-text-hover: #F3F4F6;
  --sidebar-label: #6E6E77;
  --sidebar-active-bg: rgba(251,151,1,.12);

  /* Status */
  --success: #15803D; --success-bg: #ECFDF3; --success-border: #BBF0CF;
  --warning: #B45309; --warning-bg: #FFF8EB; --warning-border: #FBE2B5;
  --danger:  #C62828; --danger-bg:  #FEF2F2; --danger-border:  #F8CFCF;
  --info:    #1D4ED8; --info-bg:    #EFF4FF; --info-border:    #C9D8FB;

  /* Legacy aliases (older markup) */
  --card: var(--surface);
  --green: var(--success);
  --yellow: var(--warning);
  --red: var(--danger);
  --sidebar-active: var(--brand);

  /* Typography */
  --font: 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 16px; --fs-xl: 18px; --fs-2xl: 22px; --fs-3xl: 26px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --lh-tight: 1.25; --lh-base: 1.5;

  /* Spacing (4px scale) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* Shape & depth */
  --radius-sm: 6px; --radius: 8px; --radius-md: 10px; --radius-lg: 12px; --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-md: 0 8px 24px -6px rgba(16,24,40,.12), 0 2px 6px rgba(16,24,40,.05);
  --shadow-lg: 0 20px 48px -12px rgba(16,24,40,.22);

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
  --t-fast: 120ms; --t-base: 180ms; --t-slow: 240ms;

  /* Layout */
  --sidebar-w: 248px; --sidebar-w-collapsed: 68px; --topbar-h: 60px;
  --control-h: 40px; --control-h-sm: 32px;

  /* Z-index */
  --z-sticky: 20; --z-topbar: 30; --z-sidebar: 40; --z-backdrop: 45; --z-drawer: 50; --z-dropdown: 60; --z-tooltip: 70;
}

/* ---------- Base ---------- */
*,*::before,*::after{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body{
  margin:0; font-family:var(--font); font-size:var(--fs-base); line-height:var(--lh-base);
  background:var(--bg); color:var(--text); -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
a{text-decoration:none; color:inherit;}
a.link, .content p a:not(.btn), .text-link{color:var(--brand); font-weight:var(--fw-medium);}
a.link:hover, .text-link:hover{color:var(--brand-hover); text-decoration:underline;}
h1,h2,h3,h4{margin:0 0 var(--sp-3); line-height:var(--lh-tight); color:var(--text);}
h3{font-size:var(--fs-lg); font-weight:var(--fw-semibold);}
h4{font-size:var(--fs-md); font-weight:var(--fw-semibold);}
p{margin:0 0 var(--sp-3);}
hr{border:none; border-top:1px solid var(--border); margin:var(--sp-5) 0;}
img{max-width:100%;}
:focus-visible{outline:2px solid var(--brand); outline-offset:2px;}
.icon{width:18px; height:18px; flex-shrink:0; display:inline-block; vertical-align:middle;}
.skip-link{position:absolute; left:-9999px; top:8px; z-index:100; background:var(--surface); padding:8px 12px; border-radius:var(--radius);}
.skip-link:focus{left:8px;}
.text-muted{color:var(--text-muted);} .text-faint{color:var(--text-faint);}
.text-success{color:var(--success);} .text-danger{color:var(--danger);} .text-warning{color:var(--warning);}
.text-sm{font-size:var(--fs-sm);} .text-xs{font-size:var(--fs-xs);}
.text-right{text-align:right;} .text-center{text-align:center;}
.fw-600{font-weight:var(--fw-semibold);}
.ml-auto{margin-left:auto;}
.mt-0{margin-top:0;} .mb-0{margin-bottom:0;} .mt-4{margin-top:var(--sp-4);} .mb-4{margin-bottom:var(--sp-4);} .mb-5{margin-bottom:var(--sp-5);}
.stack{display:flex; flex-direction:column; gap:var(--sp-4);}
.row-flex{display:flex; align-items:center; gap:var(--sp-2); flex-wrap:wrap;}
.nowrap{white-space:nowrap;}
.mono{font-variant-numeric:tabular-nums;}

/* ---------- App shell ---------- */
.app-shell{display:flex; min-height:100vh;}

.sidebar{
  width:var(--sidebar-w); background:var(--sidebar-bg); color:var(--sidebar-text);
  display:flex; flex-direction:column; flex-shrink:0; position:sticky; top:0; height:100vh;
  z-index:var(--z-sidebar); transition:width var(--t-slow) var(--ease);
  border-right:1px solid rgba(255,255,255,.04);
}
.sidebar-brand{height:var(--topbar-h); display:flex; align-items:center; justify-content:space-between; padding:0 var(--sp-4); border-bottom:1px solid rgba(255,255,255,.06);}
.brand-link{display:flex; align-items:center; gap:10px; min-width:0;}
.brand-logo{width:32px; height:32px; border-radius:var(--radius); flex-shrink:0; box-shadow:0 0 0 1px rgba(255,255,255,.08);}
.brand-text{display:flex; flex-direction:column; min-width:0; line-height:1.2;}
.brand-name{color:#fff; font-size:var(--fs-lg); font-weight:var(--fw-semibold); letter-spacing:-.01em; white-space:nowrap;}
.brand-name b{font-weight:var(--fw-bold); color:var(--brand-amber); background:var(--brand-gradient-v); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;}
.brand-sub{font-size:11.5px; color:var(--sidebar-label); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px;}
.sidebar-nav{flex:1; overflow-y:auto; overflow-x:hidden; padding:var(--sp-3) var(--sp-3) var(--sp-4); scrollbar-width:thin; scrollbar-color:#2A2A2E transparent;}
.nav-group + .nav-group{margin-top:var(--sp-4);}
.nav-group-label{font-size:11px; font-weight:var(--fw-semibold); text-transform:uppercase; letter-spacing:.08em; color:var(--sidebar-label); padding:0 var(--sp-3) var(--sp-2); white-space:nowrap;}
.nav-link{
  position:relative; display:flex; align-items:center; gap:12px; height:38px; padding:0 var(--sp-3);
  border-radius:var(--radius); color:var(--sidebar-text); font-size:13.5px; font-weight:var(--fw-medium);
  white-space:nowrap; transition:background var(--t-fast), color var(--t-fast); width:100%;
  background:none; border:0; font-family:inherit; cursor:pointer; text-align:left;
}
.nav-link + .nav-link{margin-top:2px;}
.nav-link .icon{width:18px; height:18px; opacity:.9;}
.nav-link:hover{background:rgba(255,255,255,.05); color:var(--sidebar-text-hover);}
.nav-link.active{background:var(--sidebar-active-bg); color:#fff;}
.nav-link.active .icon{color:var(--brand-amber); opacity:1;}
.nav-link.active::before{content:""; position:absolute; left:-12px; top:9px; bottom:9px; width:3px; border-radius:0 3px 3px 0; background:var(--brand-gradient-v);}
.sidebar-foot{padding:var(--sp-3); border-top:1px solid rgba(255,255,255,.06);}
.sidebar-version{font-size:11px; color:var(--sidebar-label); padding:var(--sp-2) var(--sp-3) 0;}
.collapse-toggle .icon{transition:transform var(--t-slow) var(--ease);}
.sidebar .sidebar-close{display:none;}
.sidebar-backdrop{display:none;}

/* Collapsed (desktop) */
.sidebar-collapsed .sidebar{width:var(--sidebar-w-collapsed);}
.sidebar-collapsed .sidebar .brand-text,
.sidebar-collapsed .sidebar .nav-label,
.sidebar-collapsed .sidebar .nav-group-label{display:none;}
.sidebar-collapsed .sidebar .sidebar-brand{justify-content:center; padding:0;}
.sidebar-collapsed .sidebar .nav-link{justify-content:center; padding:0;}
.sidebar-collapsed .sidebar .nav-group + .nav-group{margin-top:var(--sp-2); padding-top:var(--sp-2); border-top:1px solid rgba(255,255,255,.06);}
.sidebar-collapsed .sidebar .collapse-toggle .icon{transform:scaleX(-1);}
.nav-tooltip{
  position:fixed; z-index:var(--z-tooltip); background:#18181B; color:#fff; font-size:var(--fs-xs); font-weight:var(--fw-medium);
  padding:6px 10px; border-radius:var(--radius-sm); box-shadow:var(--shadow-md); pointer-events:none; white-space:nowrap;
  transform:translateY(-50%);
}

.main{flex:1; display:flex; flex-direction:column; min-width:0;}
.topbar{
  position:sticky; top:0; z-index:var(--z-topbar); height:var(--topbar-h);
  background:rgba(255,255,255,.92); backdrop-filter:saturate(180%) blur(8px);
  border-bottom:1px solid var(--border); padding:0 var(--sp-6);
  display:flex; align-items:center; justify-content:space-between; gap:var(--sp-4);
}
.topbar-left{display:flex; align-items:center; gap:var(--sp-3); min-width:0;}
.topbar-title{min-width:0;}
.topbar h1{font-size:var(--fs-xl); font-weight:var(--fw-semibold); margin:0; letter-spacing:-.01em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.topbar-sub{font-size:var(--fs-xs); color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.topbar-right{display:flex; align-items:center; gap:var(--sp-2); flex-shrink:0;}
.content{padding:var(--sp-6); flex:1; width:100%; max-width:1600px;}

.icon-btn{
  position:relative; display:inline-flex; align-items:center; justify-content:center; gap:6px;
  height:36px; min-width:36px; padding:0 8px; border-radius:var(--radius); border:1px solid transparent;
  background:transparent; color:var(--text-2); cursor:pointer; font:inherit; font-size:var(--fs-sm); font-weight:var(--fw-medium);
  transition:background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover{background:var(--surface-2); color:var(--text); border-color:var(--border);}
.icon-btn[aria-expanded="true"]{background:var(--surface-2); border-color:var(--border);}
.sidebar .icon-btn{color:var(--sidebar-text);} .sidebar .icon-btn:hover{background:rgba(255,255,255,.06); border-color:transparent; color:#fff;}
.icon-badge{
  position:absolute; top:3px; right:3px; min-width:16px; height:16px; padding:0 4px; border-radius:var(--radius-full);
  background:var(--brand); color:#fff; font-size:10px; font-weight:var(--fw-bold); line-height:16px; text-align:center; box-shadow:0 0 0 2px #fff;
}
.lang-code{font-size:12px; font-weight:var(--fw-semibold);}
.mobile-only{display:none;}

.outlet-switch{display:flex; align-items:center; gap:6px; height:36px; padding:0 4px 0 10px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); color:var(--text-muted); margin-right:var(--sp-1);}
.outlet-switch select{border:0; background:transparent; font:inherit; font-size:var(--fs-sm); font-weight:var(--fw-medium); color:var(--text); padding:0 4px; height:34px; cursor:pointer; max-width:180px;}
.outlet-switch select:focus{outline:none;}
.outlet-switch:focus-within{border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);}

.profile-btn{display:flex; align-items:center; gap:10px; height:40px; padding:0 8px 0 4px; border-radius:var(--radius-full); border:1px solid transparent; background:none; cursor:pointer; font:inherit; color:inherit; margin-left:var(--sp-1);}
.profile-btn:hover,.profile-btn[aria-expanded="true"]{background:var(--surface-2); border-color:var(--border);}
.avatar{width:32px; height:32px; border-radius:var(--radius-full); background:var(--brand-gradient); color:#fff; text-shadow:0 1px 1px rgba(120,40,0,.35); display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:var(--fw-semibold); flex-shrink:0;}
.avatar-lg{width:40px; height:40px; font-size:14px;}
.profile-meta{display:flex; flex-direction:column; text-align:left; line-height:1.2;}
.profile-name{font-size:var(--fs-sm); font-weight:var(--fw-semibold); color:var(--text);}
.profile-role{font-size:var(--fs-xs); color:var(--text-muted);}
.profile-email{font-size:var(--fs-xs); color:var(--text-muted);}
.profile-caret{width:16px; height:16px; color:var(--text-faint);}

/* ---------- Dropdown ---------- */
.dropdown{position:relative;}
.dropdown-menu{
  position:absolute; right:0; top:calc(100% + 8px); z-index:var(--z-dropdown); min-width:240px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  padding:6px; opacity:0; visibility:hidden; transform:translateY(-4px) scale(.98); transform-origin:top right;
  transition:opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility 0s linear var(--t-fast);
}
.dropdown.open .dropdown-menu{opacity:1; visibility:visible; transform:none; transition-delay:0s;}
.dropdown-menu-sm{min-width:180px;} .dropdown-menu-lg{width:360px; max-height:440px; overflow-y:auto;}
.dropdown-header{font-size:var(--fs-xs); font-weight:var(--fw-semibold); color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; padding:8px 10px 6px;}
.dropdown-header.split{display:flex; justify-content:space-between; align-items:center;}
.dropdown-item{display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--radius); font-size:var(--fs-sm); color:var(--text-2); font-weight:var(--fw-medium);}
.dropdown-item .icon{width:16px; height:16px; color:var(--text-muted);}
.dropdown-item:hover,.dropdown-item:focus-visible{background:var(--surface-2); color:var(--text);}
.dropdown-item.selected{color:var(--text);} .dropdown-item.selected .icon{color:var(--brand);}
.dropdown-item.danger{color:var(--danger);} .dropdown-item.danger .icon{color:var(--danger);}
.dropdown-item.danger:hover{background:var(--danger-bg);}
.dropdown-divider{height:1px; background:var(--border); margin:6px 0;}
.dropdown-profile{display:flex; gap:12px; align-items:center; padding:10px 10px 12px; border-bottom:1px solid var(--border); margin-bottom:6px;}
.dropdown-empty{padding:28px 12px; text-align:center; color:var(--text-muted); font-size:var(--fs-sm);}
.dropdown-empty .icon{width:28px; height:28px; color:var(--text-faint); margin-bottom:6px;}
.notif-item{display:flex; gap:12px; padding:10px; border-radius:var(--radius);}
.notif-item:hover{background:var(--surface-2);}
.notif-icon{width:32px; height:32px; border-radius:var(--radius); display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;}
.notif-icon .icon{width:16px; height:16px;}
.tone-success{background:var(--success-bg); color:var(--success);}
.tone-warning{background:var(--warning-bg); color:var(--warning);}
.tone-danger{background:var(--danger-bg); color:var(--danger);}
.tone-info{background:var(--info-bg); color:var(--info);}
.tone-brand{background:var(--brand-light); color:var(--brand);}
.notif-text{display:flex; flex-direction:column; min-width:0;}
.notif-title{font-size:var(--fs-sm); font-weight:var(--fw-semibold); color:var(--text);}
.notif-body{font-size:var(--fs-xs); color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:270px;}
.notif-time{font-size:11px; color:var(--text-faint); margin-top:2px;}

/* ---------- Page header ---------- */
.page-head{display:flex; align-items:flex-end; justify-content:space-between; gap:var(--sp-4); margin-bottom:var(--sp-5); flex-wrap:wrap;}
.page-title{font-size:var(--fs-2xl); font-weight:var(--fw-bold); letter-spacing:-.015em; margin:0;}
.page-desc{color:var(--text-muted); font-size:var(--fs-sm); margin:4px 0 0;}
.page-actions{display:flex; gap:var(--sp-2); flex-wrap:wrap;}
.breadcrumb{display:flex; align-items:center; gap:6px; font-size:var(--fs-sm); color:var(--text-muted); margin-bottom:var(--sp-4);}
.breadcrumb a:hover{color:var(--text);} .breadcrumb .icon{width:14px; height:14px;}

/* ---------- Cards & grids ---------- */
.card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-xs); padding:var(--sp-5);}
.card-head{display:flex; align-items:center; justify-content:space-between; gap:var(--sp-3); margin-bottom:var(--sp-4); flex-wrap:wrap;}
.card-title{font-size:var(--fs-md); font-weight:var(--fw-semibold); margin:0; display:flex; align-items:center; gap:8px;}
.card-title .count{font-size:var(--fs-xs); font-weight:var(--fw-semibold); color:var(--text-muted); background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-full); padding:1px 8px;}
.card-desc{font-size:var(--fs-sm); color:var(--text-muted); margin:2px 0 0;}
.card-section + .card-section{border-top:1px solid var(--border); margin-top:var(--sp-5); padding-top:var(--sp-5);}
.card-flush{padding:0; overflow:hidden;}
.card-flush > .card-head{padding:var(--sp-4) var(--sp-5); margin:0; border-bottom:1px solid var(--border);}
.card-foot{padding:var(--sp-3) var(--sp-5); border-top:1px solid var(--border); background:var(--surface-2);}
.card-note{font-size:var(--fs-xs); color:var(--text-muted); display:flex; gap:8px; align-items:flex-start; margin-top:var(--sp-4);}
.card-note .icon{width:14px; height:14px; margin-top:2px;}
.narrow{max-width:560px;} .narrow-sm{max-width:440px;} .narrow-md{max-width:720px;}
.center-x{margin-left:auto; margin-right:auto;}

.grid{display:grid; gap:var(--sp-4);}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr));}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr));}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr));}
.grid-aside{grid-template-columns:minmax(300px,380px) minmax(0,1fr); align-items:start;}
.grid-main{grid-template-columns:minmax(0,2fr) minmax(0,1fr); align-items:start;}
.align-start{align-items:start;}

.stat-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-xs); padding:var(--sp-4) var(--sp-5); display:flex; gap:var(--sp-4); align-items:flex-start;}
.stat-card .stat-icon{width:40px; height:40px; border-radius:var(--radius-md); display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;}
.stat-card .stat-icon .icon{width:20px; height:20px;}
.stat-card .label{font-size:var(--fs-xs); color:var(--text-muted); font-weight:var(--fw-medium);}
.stat-card .value{font-size:var(--fs-2xl); font-weight:var(--fw-bold); margin-top:2px; letter-spacing:-.02em; font-variant-numeric:tabular-nums; line-height:1.2;}
.stat-card .hint{font-size:var(--fs-xs); color:var(--text-muted); margin-top:2px;}
.stat-card .value.sm{font-size:var(--fs-lg);}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; height:var(--control-h); padding:0 var(--sp-4);
  border-radius:var(--radius); border:1px solid transparent; cursor:pointer; font-family:inherit;
  font-size:var(--fs-sm); font-weight:var(--fw-semibold); line-height:1; white-space:nowrap; text-decoration:none;
  transition:background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  position:relative; user-select:none;
}
.btn .icon{width:16px; height:16px;}
.btn:active:not(:disabled){transform:translateY(1px);}
.btn:focus-visible{outline:none; box-shadow:0 0 0 3px var(--brand-ring);}
.btn:disabled,.btn.disabled{opacity:.55; cursor:not-allowed; pointer-events:none;}
.btn-primary{background:var(--brand); color:#fff; box-shadow:0 1px 2px rgba(230,81,0,.28), inset 0 1px 0 rgba(255,255,255,.12);}
.btn-primary:hover{background:var(--brand-hover);}
.btn-outline,.btn-secondary{background:var(--surface); border-color:var(--border-strong); color:var(--text); box-shadow:var(--shadow-xs);}
.btn-outline:hover,.btn-secondary:hover{background:var(--surface-2); border-color:#C4C9D1;}
.btn-ghost{background:transparent; color:var(--text-2);} .btn-ghost:hover{background:var(--surface-2); color:var(--text);}
.btn-danger{background:var(--danger); color:#fff;} .btn-danger:hover{background:#A51F1F;}
.btn-danger-ghost{background:var(--surface); border-color:var(--border-strong); color:var(--danger);}
.btn-danger-ghost:hover{background:var(--danger-bg); border-color:var(--danger-border);}
.btn-block{width:100%;}
.btn-sm{height:var(--control-h-sm); padding:0 var(--sp-3); font-size:var(--fs-xs); border-radius:var(--radius-sm); gap:6px;}
.btn-sm .icon{width:14px; height:14px;}
.btn-lg{height:44px; padding:0 var(--sp-5); font-size:var(--fs-base);}
.btn-icon{width:var(--control-h-sm); padding:0;}
.btn.is-loading{color:transparent !important; pointer-events:none;}
.btn.is-loading::after{content:""; position:absolute; width:16px; height:16px; border-radius:50%; border:2px solid currentColor; border-color:rgba(255,255,255,.9) rgba(255,255,255,.9) rgba(255,255,255,.3) rgba(255,255,255,.3); animation:spin .7s linear infinite;}
.btn-outline.is-loading::after,.btn-secondary.is-loading::after,.btn-ghost.is-loading::after{border-color:var(--text-muted) var(--text-muted) var(--border) var(--border);}
@keyframes spin{to{transform:rotate(360deg);}}
.btn-group{display:inline-flex; gap:var(--sp-2); flex-wrap:wrap;}

/* ---------- Forms ---------- */
.form-group{margin-bottom:var(--sp-4);}
.form-group label,.form-label{display:block; font-size:var(--fs-sm); font-weight:var(--fw-medium); margin-bottom:6px; color:var(--text-2);}
.form-hint{font-size:var(--fs-xs); color:var(--text-muted); margin-top:6px;}
.form-hint-row{margin:-8px 0 var(--sp-4);}
.auth-foot span{display:inline-flex; align-items:center; gap:6px;}
.auth-foot .icon{width:14px; height:14px;}
.form-row{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 var(--sp-4);}
.form-section-title{font-size:var(--fs-sm); font-weight:var(--fw-semibold); color:var(--text); margin:0 0 var(--sp-3); display:flex; align-items:center; gap:8px;}
.form-section-title .icon{width:16px; height:16px; color:var(--text-muted);}
.input,
.form-group input:not([type=checkbox]):not([type=radio]), .form-group select, .form-group textarea,
.toolbar input:not([type=checkbox]):not([type=radio]), .toolbar select, .inline-form input, .inline-form select{
  width:100%; height:var(--control-h); padding:0 var(--sp-3); border:1px solid var(--border-strong); border-radius:var(--radius);
  font-family:inherit; font-size:var(--fs-sm); color:var(--text); background:var(--surface);
  transition:border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-group textarea, textarea.input{height:auto; min-height:96px; padding:10px var(--sp-3); line-height:var(--lh-base); resize:vertical;}
select.input, .form-group select, .toolbar select, .inline-form select{
  appearance:none; -webkit-appearance:none; padding-right:34px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
}
.input::placeholder, .form-group input::placeholder, .toolbar input::placeholder, textarea::placeholder{color:var(--text-faint);}
.input:hover, .form-group input:hover, .form-group select:hover, .form-group textarea:hover{border-color:#C4C9D1;}
.input:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus,
.toolbar input:focus, .toolbar select:focus, .inline-form input:focus, .inline-form select:focus{outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);}
.form-group input:user-invalid, .form-group select:user-invalid, .form-group textarea:user-invalid{border-color:var(--danger);}
.form-group input:user-invalid:focus{box-shadow:0 0 0 3px rgba(198,40,40,.15);}
.input-sm{height:var(--control-h-sm) !important; font-size:var(--fs-xs) !important;}
.check{display:flex; align-items:center; gap:8px; font-size:var(--fs-sm); color:var(--text-2); cursor:pointer;}
.check input{width:16px; height:16px; accent-color:var(--brand);}
.input-icon{position:relative;}
.input-icon > .icon{position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--text-faint); pointer-events:none;}
.input-icon > input{padding-left:36px !important;}
.password-toggle{position:absolute; right:6px; top:50%; transform:translateY(-50%); height:30px; padding:0 8px; border:0; background:none; color:var(--text-muted); font:inherit; font-size:var(--fs-xs); font-weight:var(--fw-semibold); cursor:pointer; border-radius:var(--radius-sm);}
.password-toggle:hover{color:var(--text); background:var(--surface-2);}
.choice{display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--border-strong); border-radius:var(--radius-md); margin-bottom:var(--sp-2); cursor:pointer; transition:border-color var(--t-fast), background var(--t-fast);}
.choice:hover{border-color:#C4C9D1; background:var(--surface-2);}
.choice:has(input:checked){border-color:var(--brand); background:var(--brand-light); box-shadow:0 0 0 3px var(--brand-ring);}
.choice input{accent-color:var(--brand);}

/* Toolbar (search + filters above tables) */
.toolbar{display:flex; gap:var(--sp-2); margin-bottom:var(--sp-4); flex-wrap:wrap; align-items:center;}
.toolbar .grow{flex:1; min-width:180px;}
.toolbar select{width:auto; min-width:140px;}
.inline-form{display:flex; gap:6px; align-items:center;}
.inline-form input{width:96px;}

/* Alerts */
.alert{display:flex; gap:10px; align-items:flex-start; padding:10px 14px; border-radius:var(--radius); border:1px solid; font-size:var(--fs-sm); margin-bottom:var(--sp-4);}
.alert .icon{width:18px; height:18px; margin-top:1px;}
.alert-success{background:var(--success-bg); border-color:var(--success-border); color:#14532D;}
.alert-danger{background:var(--danger-bg); border-color:var(--danger-border); color:#7F1D1D;}
.alert-warning{background:var(--warning-bg); border-color:var(--warning-border); color:#78350F;}
.alert-info{background:var(--info-bg); border-color:var(--info-border); color:#1E3A8A;}
.alert p{margin:0;}

/* ---------- Tables ---------- */
.table-wrap{width:100%; overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface);}
.card-flush .table-wrap{border:0; border-radius:0;}
table.data-table{width:100%; border-collapse:separate; border-spacing:0; background:var(--surface);}
table.data-table th{
  position:sticky; top:0; z-index:1; background:var(--surface-2); text-align:left; padding:0 var(--sp-4); height:40px;
  font-size:var(--fs-xs); font-weight:var(--fw-semibold); color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em;
  border-bottom:1px solid var(--border); white-space:nowrap;
}
table.data-table td{padding:10px var(--sp-4); height:48px; border-bottom:1px solid var(--border); font-size:var(--fs-sm); color:var(--text-2); vertical-align:middle;}
table.data-table tr:last-child td{border-bottom:0;}
table.data-table tbody tr, table.data-table tr:not(:first-child){transition:background var(--t-fast);}
table.data-table tr:hover td{background:#FBFBFC;}
table.data-table td.primary{color:var(--text); font-weight:var(--fw-medium);}
table.data-table td.num, table.data-table th.num{text-align:right; font-variant-numeric:tabular-nums;}
table.data-table td.actions{text-align:right; white-space:nowrap;}
table.data-table td.actions > *{display:inline-flex; vertical-align:middle;}
table.data-table td.actions > * + *{margin-left:6px;}
table.data-table td.empty{height:auto; padding:0;}
.cell-sub{display:block; font-size:var(--fs-xs); color:var(--text-muted);}

/* Badges */
.badge{display:inline-flex; align-items:center; gap:5px; height:22px; padding:0 8px; border-radius:var(--radius-full); font-size:11.5px; font-weight:var(--fw-semibold); border:1px solid transparent; white-space:nowrap; line-height:1;}
.badge::before{content:""; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.85;}
.badge-green,.badge-success{background:var(--success-bg); color:var(--success); border-color:var(--success-border);}
.badge-yellow,.badge-warning{background:var(--warning-bg); color:var(--warning); border-color:var(--warning-border);}
.badge-red,.badge-danger{background:var(--danger-bg); color:var(--danger); border-color:var(--danger-border);}
.badge-blue,.badge-info{background:var(--info-bg); color:var(--info); border-color:var(--info-border);}
.badge-neutral{background:var(--surface-2); color:var(--text-2); border-color:var(--border);}
.badge-neutral::before{display:none;}

/* Pagination */
.pagination{display:flex; justify-content:space-between; align-items:center; gap:var(--sp-3); margin-top:var(--sp-4); flex-wrap:wrap;}
.pagination .pages{display:flex; gap:4px; flex-wrap:wrap;}
.pagination .btn-sm{min-width:32px;}
.pagination-info{font-size:var(--fs-xs); color:var(--text-muted);}

/* Empty state */
.empty-state{text-align:center; padding:var(--sp-10) var(--sp-5); color:var(--text-muted);}
.empty-state > .icon{width:40px; height:40px; padding:9px; border-radius:var(--radius-md); background:var(--surface-2); border:1px solid var(--border); color:var(--text-muted); margin-bottom:var(--sp-3); box-sizing:content-box;}
.empty-title{font-size:var(--fs-md); font-weight:var(--fw-semibold); color:var(--text); margin-bottom:4px;}
.empty-state p{font-size:var(--fs-sm); max-width:360px; margin:0 auto var(--sp-4);}

/* Skeleton */
.skeleton{background:linear-gradient(90deg,#EEF0F3 25%,#F6F7F9 37%,#EEF0F3 63%); background-size:400% 100%; animation:shimmer 1.4s ease infinite; border-radius:var(--radius-sm);}
@keyframes shimmer{0%{background-position:100% 50%}100%{background-position:0 50%}}

/* Mini bar chart (dashboard) */
.bar-chart{display:flex; align-items:flex-end; gap:10px; height:180px; padding-top:var(--sp-2);}
.bar-col{flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; min-width:0;}
.bar-track{flex:1; width:100%; max-width:44px; display:flex; align-items:flex-end;}
.bar{width:100%; background:var(--brand-gradient-v); border-radius:4px 4px 0 0; min-height:2px; transition:opacity var(--t-fast);}
.bar.muted{background:#FDD9B5;}
.bar-col:hover .bar{opacity:.85;}
.bar-label{font-size:11px; color:var(--text-muted); white-space:nowrap;}
.bar-value{font-size:11px; color:var(--text-2); font-weight:var(--fw-semibold); font-variant-numeric:tabular-nums; white-space:nowrap;}
.bar-value.hover-only{visibility:hidden;} .bar-col:hover .bar-value.hover-only{visibility:visible;}

.list{list-style:none; margin:0; padding:0;}
.list-item{display:flex; align-items:center; gap:var(--sp-3); padding:10px 0; border-bottom:1px solid var(--border); font-size:var(--fs-sm);}
.list-item:last-child{border-bottom:0;}
.list-item .grow{flex:1; min-width:0;}
.list-item .title{color:var(--text); font-weight:var(--fw-medium); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.quick-actions{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--sp-2);}
.quick-action{display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--border); border-radius:var(--radius-md); font-size:var(--fs-sm); font-weight:var(--fw-medium); color:var(--text); transition:border-color var(--t-fast), background var(--t-fast);}
.quick-action:hover{border-color:var(--brand); background:var(--brand-light);}
.quick-action .icon{width:18px; height:18px; color:var(--brand);}

/* ---------- POS: table grid ---------- */
.legend{display:flex; gap:var(--sp-4); flex-wrap:wrap; font-size:var(--fs-xs); color:var(--text-muted);}
.legend span{display:inline-flex; align-items:center; gap:6px;}
.legend i{width:10px; height:10px; border-radius:3px; display:inline-block;}
.table-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:var(--sp-3);}
.table-tile{
  display:flex; flex-direction:column; gap:10px; border-radius:var(--radius-lg); padding:var(--sp-4); cursor:pointer;
  background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow-xs); position:relative; overflow:hidden;
  transition:transform var(--t-fast) var(--ease), box-shadow var(--t-fast), border-color var(--t-fast);
}
.table-tile::before{content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--border-strong);}
.table-tile:hover{transform:translateY(-2px); box-shadow:var(--shadow-md);}
.table-tile .t-top{display:flex; justify-content:space-between; align-items:center;}
.table-tile .t-no{font-size:var(--fs-xl); font-weight:var(--fw-bold); letter-spacing:-.01em; color:var(--text);}
.table-tile .t-status{font-size:var(--fs-xs); font-weight:var(--fw-semibold);}
.table-tile .t-meta{font-size:var(--fs-xs); color:var(--text-muted); display:flex; align-items:center; gap:4px;}
.table-tile .t-meta .icon{width:13px; height:13px;}
.table-tile.free::before{background:var(--success);} .table-tile.free .t-status{color:var(--success);}
.table-tile.occupied::before{background:var(--brand);} .table-tile.occupied{background:linear-gradient(0deg,var(--surface),var(--surface)) padding-box;} .table-tile.occupied .t-status{color:var(--brand-dark);}
.table-tile.reserved::before{background:var(--warning);} .table-tile.reserved .t-status{color:var(--warning);}

/* POS: billing layout */
.pos-layout{display:flex; gap:var(--sp-5); align-items:flex-start;}
.pos-menu{flex:2; min-width:0;}
.pos-cart{flex:1; min-width:320px; max-width:420px; position:sticky; top:calc(var(--topbar-h) + var(--sp-4));}
.category-tabs{display:flex; gap:6px; overflow-x:auto; margin-bottom:var(--sp-4); padding-bottom:4px; scrollbar-width:thin;}
.category-tabs a{
  height:32px; display:inline-flex; align-items:center; padding:0 14px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-full); font-size:var(--fs-sm); font-weight:var(--fw-medium); color:var(--text-2); white-space:nowrap;
  transition:all var(--t-fast);
}
.category-tabs a:hover{border-color:var(--border-strong); color:var(--text);}
.category-tabs a.active{background:var(--text); border-color:var(--text); color:#fff;}
.menu-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:var(--sp-3);}
.menu-cat-title{font-size:var(--fs-xs); font-weight:var(--fw-semibold); color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; margin:var(--sp-5) 0 var(--sp-2); scroll-margin-top:80px;}
.menu-cat-title:first-child{margin-top:0;}
.menu-item-card{
  display:flex; flex-direction:column; justify-content:space-between; gap:8px; width:100%; min-height:84px; text-align:left;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); box-shadow:var(--shadow-xs);
  padding:12px 14px; cursor:pointer; font:inherit; color:inherit; transition:border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
button.menu-item-card:hover{border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);}
button.menu-item-card:active{transform:scale(.99);}
.menu-item-card .name{font-weight:var(--fw-semibold); font-size:13.5px; color:var(--text); line-height:1.3;}
.menu-item-card .price{color:var(--brand-dark); font-weight:var(--fw-bold); font-size:var(--fs-sm); font-variant-numeric:tabular-nums;}
.menu-item-card .variants{display:flex; flex-wrap:wrap; gap:4px;}
.menu-item-card form{display:inline;}

.cart-box{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); overflow:hidden;}
.cart-box .cart-head{padding:14px var(--sp-4); border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:8px;}
.cart-head .cart-title{font-weight:var(--fw-semibold); font-size:var(--fs-md);}
.cart-head .cart-sub{font-size:var(--fs-xs); color:var(--text-muted);}
.cart-items{max-height:360px; overflow-y:auto; padding:4px var(--sp-4);}
.cart-row{display:flex; justify-content:space-between; align-items:center; gap:var(--sp-3); padding:10px 0; border-bottom:1px solid var(--border); font-size:var(--fs-sm);}
.cart-row:last-child{border-bottom:0;}
.cart-row .item{min-width:0; flex:1;}
.cart-row .item-name{color:var(--text); font-weight:var(--fw-medium);}
.cart-row .item-meta{color:var(--text-muted); font-size:var(--fs-xs);}
.qty-ctrl{display:inline-flex; align-items:center; border:1px solid var(--border-strong); border-radius:var(--radius); overflow:hidden; flex-shrink:0;}
.qty-ctrl form{display:flex;}
.qty-ctrl button{width:30px; height:30px; border:0; background:var(--surface); cursor:pointer; color:var(--text-2); display:inline-flex; align-items:center; justify-content:center;}
.qty-ctrl button:hover{background:var(--surface-2); color:var(--text);}
.qty-ctrl button .icon{width:14px; height:14px;}
.qty-ctrl .qty{min-width:28px; text-align:center; font-weight:var(--fw-semibold); font-size:var(--fs-sm); font-variant-numeric:tabular-nums;}
.cart-summary{padding:var(--sp-3) var(--sp-4); border-top:1px solid var(--border); background:var(--surface-2); font-size:var(--fs-sm); color:var(--text-2);}
.cart-summary .row{display:flex; justify-content:space-between; margin:4px 0; font-variant-numeric:tabular-nums;}
.cart-summary .total{font-size:var(--fs-lg); font-weight:var(--fw-bold); color:var(--text); border-top:1px dashed var(--border-strong); padding-top:10px; margin-top:8px;}
.cart-actions{padding:var(--sp-3) var(--sp-4) var(--sp-4); display:flex; gap:var(--sp-2); background:var(--surface-2);}
.cart-actions form{flex:1;}
.cart-empty{padding:var(--sp-8) 0; text-align:center; color:var(--text-muted); font-size:var(--fs-sm);}
.cart-empty .icon{width:28px; height:28px; color:var(--text-faint); display:block; margin:0 auto 8px;}

/* Kitchen display */
.kot-card{padding:0; overflow:hidden;}
.kot-card .kot-head{display:flex; justify-content:space-between; align-items:center; padding:12px var(--sp-4); border-bottom:1px solid var(--border); background:var(--surface-2);}
.kot-card .kot-body{padding:4px var(--sp-4);}

/* Checkout */
.amount-due{text-align:center; padding:var(--sp-5) 0; border-bottom:1px solid var(--border); margin-bottom:var(--sp-5);}
.amount-due .label{font-size:var(--fs-xs); color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; font-weight:var(--fw-semibold);}
.amount-due .amount{font-size:36px; font-weight:var(--fw-bold); letter-spacing:-.02em; color:var(--text); font-variant-numeric:tabular-nums;}
.qr-box{text-align:center; margin-bottom:var(--sp-5);}
.qr-box img{border:1px solid var(--border); border-radius:var(--radius-md); padding:8px; background:#fff;}

/* Support thread */
.thread{display:flex; flex-direction:column; gap:var(--sp-3);}
.msg{padding:12px 14px; border-radius:var(--radius-md); border:1px solid var(--border); background:var(--surface-2); max-width:88%;}
.msg.support{background:var(--brand-light); border-color:#FFDCC2; align-self:flex-start;}
.msg.mine{align-self:flex-end;}
.msg-meta{font-size:var(--fs-xs); color:var(--text-muted); margin-bottom:4px;}
.msg-meta b{color:var(--text);}
.msg-body{font-size:var(--fs-sm); white-space:pre-wrap; color:var(--text);}

/* Plans */
.plan-card .price{font-size:var(--fs-3xl); font-weight:var(--fw-bold); letter-spacing:-.02em; margin:var(--sp-2) 0;}
.plan-card .price small{font-size:var(--fs-xs); font-weight:var(--fw-regular); color:var(--text-muted);}
.plan-card .features{font-size:var(--fs-sm); color:var(--text-2); white-space:pre-line; margin-bottom:var(--sp-3); min-height:40px;}

/* Segmented filter (tabs as links) */
.segmented{display:inline-flex; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:3px; gap:2px; margin-bottom:var(--sp-4); flex-wrap:wrap;}
.segmented a{height:30px; display:inline-flex; align-items:center; padding:0 12px; border-radius:var(--radius-sm); font-size:var(--fs-sm); font-weight:var(--fw-medium); color:var(--text-muted);}
.segmented a:hover{color:var(--text);}
.segmented a.active{background:var(--text); color:#fff;}

/* ---------- Auth (login / signup) ---------- */
.auth-page{min-height:100vh; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); background:var(--surface);}
.auth-aside{
  position:relative; overflow:hidden; color:#E5E7EB; padding:var(--sp-10) var(--sp-12);
  display:flex; flex-direction:column; justify-content:space-between;
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(243,89,1,.38), transparent 60%),
    radial-gradient(700px 400px at -20% 110%, rgba(252,204,8,.14), transparent 60%),
    linear-gradient(160deg,#050506 0%,#0B0B0D 55%,#18181B 100%);
}
.auth-aside::after{content:""; position:absolute; inset:0; background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px); background-size:44px 44px; mask-image:linear-gradient(180deg,rgba(0,0,0,.9),transparent 85%); pointer-events:none;}
.auth-aside > *{position:relative; z-index:1;}
.auth-brand{display:flex; align-items:center; gap:12px;}
.auth-brand img{width:40px; height:40px; border-radius:var(--radius-md); box-shadow:0 0 0 1px rgba(255,255,255,.1);}
.auth-brand .brand-name{font-size:var(--fs-xl);}
.auth-hero{max-width:480px; margin:var(--sp-10) 0;}
.auth-eyebrow{display:inline-flex; align-items:center; gap:8px; font-size:var(--fs-xs); font-weight:var(--fw-semibold); color:#FFC94D; background:rgba(251,151,1,.12); border:1px solid rgba(251,151,1,.32); border-radius:var(--radius-full); padding:4px 12px; margin-bottom:var(--sp-5);}
.auth-eyebrow .icon{width:14px; height:14px;}
.auth-hero h1{color:#fff; font-size:34px; font-weight:var(--fw-bold); letter-spacing:-.025em; line-height:1.15; margin-bottom:var(--sp-4);}
.auth-hero p{color:#A8A8B0; font-size:var(--fs-md); line-height:1.6; margin-bottom:var(--sp-8);}
.auth-features{list-style:none; padding:0; margin:0; display:grid; gap:var(--sp-4);}
.auth-features li{display:flex; gap:14px; align-items:flex-start;}
.auth-features .f-icon{width:36px; height:36px; border-radius:var(--radius-md); background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08); display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; color:#FFC94D;}
.auth-features .f-icon .icon{width:18px; height:18px;}
.auth-features b{display:block; color:#F3F4F6; font-size:var(--fs-sm); font-weight:var(--fw-semibold);}
.auth-features span{font-size:var(--fs-sm); color:#8E8E96;}
.auth-foot{font-size:var(--fs-xs); color:#6E6E77; display:flex; gap:var(--sp-4); flex-wrap:wrap;}
.auth-main{display:flex; flex-direction:column; padding:var(--sp-6) var(--sp-8);}
.auth-topbar{display:flex; justify-content:flex-end; align-items:center; gap:var(--sp-2);}
.auth-form-wrap{flex:1; display:flex; align-items:center; justify-content:center; padding:var(--sp-8) 0;}
.auth-form{width:100%; max-width:400px;}
.auth-form.wide{max-width:480px;}
.auth-mobile-brand{display:none; align-items:center; gap:10px; margin-bottom:var(--sp-6);}
.auth-mobile-brand img{width:36px; height:36px; border-radius:var(--radius);}
.auth-mobile-brand .brand-name{color:var(--text);}
.auth-title{font-size:var(--fs-3xl); font-weight:var(--fw-bold); letter-spacing:-.02em; margin:0 0 6px;}
.auth-subtitle{color:var(--text-muted); font-size:var(--fs-sm); margin:0 0 var(--sp-6);}
.social-row{display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-2);}
.social-row.single{grid-template-columns:minmax(0,1fr);}
.btn-social{background:var(--surface); border:1px solid var(--border-strong); color:var(--text); box-shadow:var(--shadow-xs);}
.btn-social:hover{background:var(--surface-2);}
.btn-social .icon{width:18px; height:18px;}
.divider-text{display:flex; align-items:center; gap:var(--sp-3); color:var(--text-faint); font-size:var(--fs-xs); margin:var(--sp-5) 0; text-transform:uppercase; letter-spacing:.06em;}
.divider-text::before,.divider-text::after{content:""; flex:1; height:1px; background:var(--border);}
.form-inline-between{display:flex; justify-content:space-between; align-items:center; margin:-4px 0 var(--sp-5); gap:var(--sp-2); flex-wrap:wrap;}
.auth-switch{text-align:center; font-size:var(--fs-sm); color:var(--text-muted); margin-top:var(--sp-6);}
.auth-switch a{color:var(--brand); font-weight:var(--fw-semibold);}
.auth-switch a:hover{text-decoration:underline;}
.forgot-note{display:none; margin-bottom:var(--sp-4);}
.forgot-note.show{display:flex;}
.link-btn{background:none; border:0; padding:0; font:inherit; font-size:var(--fs-sm); color:var(--brand); font-weight:var(--fw-medium); cursor:pointer;}
.link-btn:hover{text-decoration:underline;}
.success-panel{text-align:center;}
.success-panel .s-icon{width:56px; height:56px; border-radius:50%; background:var(--success-bg); color:var(--success); display:inline-flex; align-items:center; justify-content:center; margin-bottom:var(--sp-4);}
.success-panel .s-icon .icon{width:28px; height:28px;}
.code-chip{display:inline-block; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:var(--fs-lg); font-weight:var(--fw-semibold); background:var(--surface-2); border:1px dashed var(--border-strong); border-radius:var(--radius); padding:8px 16px; margin:var(--sp-2) 0 var(--sp-4);}

/* Simple centered card pages (setup, errors, superadmin login) */
.login-wrap,.message-page{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:var(--sp-4); background:var(--bg);}
.login-card{background:var(--surface); border:1px solid var(--border); padding:var(--sp-8); border-radius:var(--radius-lg); width:100%; max-width:400px; box-shadow:var(--shadow-md);}
.login-card h2{margin-top:0;}
.login-card .brand-mark{color:var(--brand); font-weight:var(--fw-bold);}
.message-card{max-width:440px; text-align:center; padding:var(--sp-10) var(--sp-8);}
.message-icon{width:52px; height:52px; border-radius:50%; background:var(--warning-bg); color:var(--warning); display:inline-flex; align-items:center; justify-content:center; margin-bottom:var(--sp-4);}
.message-icon .icon{width:24px; height:24px;}
.message-card .page-title{font-size:var(--fs-xl); margin-bottom:var(--sp-2);}
.message-card p{margin-bottom:var(--sp-6);}

@media print{
  .no-print{display:none !important;}
  body{background:#fff;}
}

/* ===== Responsive ===== */
@media (max-width: 1279px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr));}
  .auth-aside{padding:var(--sp-8);}
}
@media (max-width: 1023px){
  .content{padding:var(--sp-5);}
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr));}
  .grid-aside,.grid-main{grid-template-columns:minmax(0,1fr);}
  .pos-layout{flex-direction:column; align-items:stretch;}  /* stretch: otherwise the menu grows to the width of the category strip */
  .pos-menu{min-width:0; width:100%;}
  .pos-cart{position:static; min-width:0; max-width:none; width:100%;}
  .cart-items{max-height:none;}
  .auth-page{grid-template-columns:minmax(0,1fr);}
  .auth-aside{display:none;}
  .auth-mobile-brand{display:flex;}
  .profile-meta{display:none;}
}

/* Tablet & mobile: sidebar becomes an off-canvas drawer */
@media (max-width: 1023px){
  .sidebar{position:fixed; left:0; top:0; bottom:0; width:280px !important; transform:translateX(-100%); transition:transform var(--t-slow) var(--ease); z-index:var(--z-drawer); box-shadow:var(--shadow-lg);}
  .sidebar .nav-label,.sidebar .nav-group-label{display:revert !important;}
  .sidebar .brand-text{display:flex !important;}
  .sidebar .nav-link{justify-content:flex-start !important; padding:0 var(--sp-3) !important;}
  .sidebar .sidebar-brand{justify-content:space-between !important; padding:0 var(--sp-4) !important;}
  .sidebar-collapsed .sidebar .nav-group + .nav-group{border-top:0; padding-top:0; margin-top:var(--sp-4);}
  .collapse-toggle{display:none;}
  .sidebar .sidebar-close{display:inline-flex;}
  .drawer-open .sidebar{transform:none;}
  .drawer-open .sidebar-backdrop{display:block; position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:var(--z-backdrop); animation:fade var(--t-base) var(--ease);}
  .drawer-open body, body.drawer-lock{overflow:hidden;}
  .mobile-only{display:inline-flex;}
}
@keyframes fade{from{opacity:0}to{opacity:1}}

@media (max-width: 767px){
  :root{--topbar-h:56px;}
  body{font-size:var(--fs-sm);}
  .content{padding:var(--sp-4);}
  .topbar{padding:0 var(--sp-3);}
  .topbar h1{font-size:var(--fs-lg);}
  .topbar-sub{display:none;}
  .hide-sm{display:none !important;}
  .grid-4,.grid-3{grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--sp-3);}
  .grid-2,.form-row{grid-template-columns:minmax(0,1fr);}
  .card{padding:var(--sp-4);}
  .card-flush > .card-head{padding:var(--sp-3) var(--sp-4);}
  .stat-card{padding:var(--sp-3) var(--sp-4); gap:var(--sp-3);}
  .stat-card .stat-icon{width:34px; height:34px;}
  .stat-card .value{font-size:var(--fs-xl);}
  .page-title{font-size:var(--fs-xl);}
  .toolbar .grow{min-width:100%;}
  .toolbar select,.toolbar .btn{flex:1;}
  .dropdown-menu-lg{width:calc(100vw - 24px); right:-60px;}
  .menu-grid{grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--sp-2);}
  .table-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .auth-main{padding:var(--sp-4);}
  .auth-form-wrap{padding:var(--sp-4) 0;}
  .auth-title{font-size:var(--fs-2xl);}
  .social-row{grid-template-columns:minmax(0,1fr);}
  .msg{max-width:100%;}
  .quick-actions{grid-template-columns:minmax(0,1fr);}
  .bar-chart{gap:6px; height:150px;}
  .bar-value{display:none;}
  .amount-due .amount{font-size:30px;}

  /* Responsive tables: stack rows as cards */
  table.data-table.stack-sm, table.data-table.stack-sm tbody, table.data-table.stack-sm tr, table.data-table.stack-sm td{display:block; width:100%;}
  table.data-table.stack-sm thead, table.data-table.stack-sm tr.head{display:none;}
  table.data-table.stack-sm tr{padding:10px var(--sp-4); border-bottom:1px solid var(--border);}
  table.data-table.stack-sm tr:last-child{border-bottom:0;}
  table.data-table.stack-sm td{height:auto; border:0; padding:3px 0; display:flex; justify-content:space-between; gap:var(--sp-3); text-align:right;}
  table.data-table.stack-sm td::before{content:attr(data-label); color:var(--text-muted); font-size:var(--fs-xs); font-weight:var(--fw-medium); text-align:left;}
  table.data-table.stack-sm td.primary{font-size:var(--fs-base); text-align:left;}
  table.data-table.stack-sm td.primary::before{display:none;}
  table.data-table.stack-sm td.actions{justify-content:flex-end; padding-top:8px;}
  table.data-table.stack-sm td.actions::before{display:none;}
  table.data-table.stack-sm td.empty::before{display:none;}
  table.data-table.stack-sm tr:hover td{background:transparent;}
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:1ms !important; transition-duration:1ms !important;}
}
.dot-free{background:var(--success);} .dot-occupied{background:var(--brand);} .dot-reserved{background:var(--warning);}
.row-flex > .grow{flex:1; min-width:0;}
.justify-end{justify-content:flex-end;}
.brand-row{display:flex; align-items:center; gap:10px; margin-bottom:var(--sp-6);}
.brand-row img{width:36px; height:36px; border-radius:var(--radius);}
.brand-row .brand-name, .auth-mobile-brand .brand-name{color:var(--text);}
.card-toolbar{padding:var(--sp-4) var(--sp-5) 0;}
.card-pager{padding:0 var(--sp-5);}
.card-pager .pagination{margin:var(--sp-4) 0;}
.variant-chip{display:inline-flex; align-items:center; gap:4px; height:24px; padding:0 4px 0 8px; border:1px solid var(--border); border-radius:var(--radius-full); background:var(--surface-2); font-size:var(--fs-xs); color:var(--text-2);}
.variant-chip button{border:0; background:none; padding:2px; border-radius:50%; cursor:pointer; color:var(--text-faint); display:inline-flex;}
.variant-chip button:hover{color:var(--danger); background:var(--danger-bg);}
.variant-chip .icon{width:12px; height:12px;}

/* ---------- Menu images & Menu Library ---------- */
.sr-only{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;}
.mt-2{margin-top:var(--sp-2);} .mt-6{margin-top:var(--sp-6);}
.input-xs{width:72px !important; flex:0 0 72px;}
.menu-thumb{width:56px; height:42px; border-radius:var(--radius-sm); object-fit:cover; background:var(--surface-2); border:1px solid var(--border); flex-shrink:0; display:inline-flex; align-items:center; justify-content:center;}
.menu-thumb.is-empty .icon{width:18px; height:18px; color:var(--text-faint);}
.menu-thumb-lg{width:160px; height:120px; border-radius:var(--radius-md); object-fit:cover; background:var(--surface-2); border:1px solid var(--border); display:inline-flex; align-items:center; justify-content:center;}
.menu-thumb-lg.is-empty .icon{width:32px; height:32px; color:var(--text-faint);}
.image-field{display:flex; gap:var(--sp-4); align-items:flex-start; margin-bottom:var(--sp-5); flex-wrap:wrap;}
.image-field label{display:block; font-size:var(--fs-sm); font-weight:var(--fw-medium); margin-bottom:6px;}
.image-field .grow{flex:1; min-width:200px;}
.item-cell{display:flex; align-items:center; gap:var(--sp-3); min-width:0;}
.item-cell-name{display:flex; align-items:center; gap:6px; font-weight:var(--fw-medium);}
.thumb-upload{margin:0;}
.thumb-upload label{position:relative; display:inline-flex; cursor:pointer; border-radius:var(--radius-sm);}
.thumb-upload label:focus-within{box-shadow:0 0 0 3px var(--brand-ring);}
.thumb-overlay{position:absolute; inset:0; display:flex; align-items:center; justify-content:center; border-radius:var(--radius-sm); background:rgba(17,24,39,.45); color:#fff; opacity:0; transition:opacity var(--t-fast);}
.thumb-overlay .icon{width:16px; height:16px;}
.thumb-upload label:hover .thumb-overlay, .thumb-upload label:focus-within .thumb-overlay, .thumb-upload.is-loading .thumb-overlay{opacity:1;}
.food-mark{display:inline-flex; align-items:center; justify-content:center; width:13px; height:13px; border:1.5px solid currentColor; border-radius:2px; flex-shrink:0;}
.food-mark::after{content:""; width:6px; height:6px; border-radius:50%; background:currentColor;}
.food-veg{color:#15803D;} .food-non_veg{color:#B91C1C;} .food-egg{color:#D97706;}
.lib-cat-list{list-style:none; margin:0 0 var(--sp-2); padding:0;}
.lib-cat-list li{display:flex; align-items:center; justify-content:space-between; gap:var(--sp-2); padding:6px 0; border-bottom:1px solid var(--border);}
.lib-cat-list li:last-child{border-bottom:0;}
.lib-cat-list li > form{flex:1;}
.lib-cat-list li.is-off .lib-cat-name{color:var(--text-muted);}
.lib-cat-name{flex:1; min-width:0; display:flex; align-items:center; gap:6px; padding:4px 8px; border-radius:var(--radius-sm); color:var(--text); font-size:var(--fs-sm); font-weight:var(--fw-medium); text-decoration:none;}
.lib-cat-name:hover{background:var(--surface-2);}
.lib-cat-name.active{background:var(--surface-2); color:var(--brand-dark);}
.lib-cat-name .count{font-size:var(--fs-xs); color:var(--text-muted); font-weight:var(--fw-regular);}
.library-card{border-color:var(--brand-ring);}
/* POS cards with photo */
.menu-item-card.has-image{padding:0 0 10px; overflow:hidden; justify-content:flex-start;}
.menu-item-card.has-image .mic-img{width:100%; aspect-ratio:4/3; object-fit:cover; display:block; background:var(--surface-2); border-bottom:1px solid var(--border);}
.menu-item-card.has-image .name, .menu-item-card.has-image .price, .menu-item-card.has-image .variants{padding:0 12px;}
.menu-item-card .name{display:flex; align-items:flex-start; gap:6px;}
.menu-item-card .name .food-mark{margin-top:2px;}
.stack-sm{display:flex; flex-direction:column; gap:var(--sp-2);}
.mb-2{margin-bottom:var(--sp-2);} .my-4{margin-top:var(--sp-4); margin-bottom:var(--sp-4);}

/* Browse default menu (admin/menu_library.php) */
.lib-chips{margin:var(--sp-3) 0 0; padding-bottom:var(--sp-1);}
.lib-browse{padding:var(--sp-4) var(--sp-5) 0;}
.lib-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:var(--sp-3);}
.lib-card{position:relative; display:flex; flex-direction:column; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); overflow:hidden; cursor:pointer; transition:border-color var(--t-fast), box-shadow var(--t-fast);}
.lib-card:hover{border-color:var(--border-strong); box-shadow:var(--shadow-sm);}
.lib-card .lib-check{position:absolute; opacity:0; pointer-events:none;}
.lib-card:has(.lib-check:checked){border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);}
.lib-card:has(.lib-check:focus-visible){box-shadow:0 0 0 3px var(--brand-ring);}
.lib-card.is-added{cursor:default;}
.lib-card.is-added .lib-photo img{filter:saturate(.5) brightness(.9);}
.lib-photo{position:relative; aspect-ratio:4/3; background:var(--surface-2); display:flex; align-items:center; justify-content:center; color:var(--text-faint);}
.lib-photo img{width:100%; height:100%; object-fit:cover;}
.lib-tick{position:absolute; top:8px; right:8px; width:24px; height:24px; border-radius:50%; border:2px solid #fff; background:rgba(17,24,39,.35); display:flex; align-items:center; justify-content:center; color:transparent; transition:all var(--t-fast);}
.lib-tick .icon{width:14px; height:14px;}
.lib-card:has(.lib-check:checked) .lib-tick{background:var(--brand); border-color:var(--brand); color:#fff;}
.lib-card.is-added .lib-tick{display:none;}
.lib-added{position:absolute; top:8px; left:8px; gap:4px;}
.lib-added .icon{width:12px; height:12px;}
.lib-body{display:flex; flex-direction:column; gap:4px; padding:10px 12px 12px; flex:1;}
.lib-name{display:flex; align-items:flex-start; gap:6px; font-weight:var(--fw-semibold); font-size:var(--fs-sm); color:var(--text); line-height:1.3;}
.lib-name .food-mark{margin-top:2px;}
.lib-desc{font-size:var(--fs-xs); color:var(--text-muted); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
.lib-meta{display:flex; justify-content:space-between; align-items:center; margin-top:auto; padding-top:4px; font-size:var(--fs-xs);}
.lib-meta b{color:var(--brand-dark); font-size:var(--fs-sm);}
.lib-actionbar{position:sticky; bottom:0; z-index:5; display:flex; align-items:center; gap:var(--sp-3); flex-wrap:wrap; margin:var(--sp-4) calc(-1 * var(--sp-5)) 0; padding:var(--sp-3) var(--sp-5); background:var(--surface); border-top:1px solid var(--border); box-shadow:0 -6px 16px rgba(17,24,39,.06);}
.lib-actionbar .grow{flex:1;}

/* Print menu card (admin/menu_print.php) */
.print-layout{grid-template-columns:minmax(280px,340px) minmax(0,1fr);}
.print-options .form-section-title .icon{width:16px; height:16px;}
.tpl-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(88px,1fr)); gap:var(--sp-2);}
.tpl-option{display:flex; flex-direction:column; gap:6px; cursor:pointer;}
.tpl-option input{position:absolute; opacity:0;}
.tpl-swatch{display:flex; flex-direction:column; gap:4px; height:72px; padding:10px; border-radius:var(--radius); border:1px solid var(--border); transition:box-shadow var(--t-fast), border-color var(--t-fast);}
.tpl-swatch i{display:block; width:60%; height:6px; border-radius:2px; margin:0 auto 4px;}
.tpl-swatch b{display:block; height:3px; border-radius:2px; opacity:.55;}
.tpl-swatch b.short{width:60%;}
.tpl-option input:checked + .tpl-swatch{border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);}
.tpl-option input:focus-visible + .tpl-swatch{box-shadow:0 0 0 3px var(--brand-ring);}
.tpl-name{font-size:var(--fs-xs); font-weight:var(--fw-medium); text-align:center; color:var(--text-2);}
.print-cats{max-height:260px; overflow:auto; padding-right:4px;}
.print-cats .check .grow{flex:1;}
.print-preview{position:sticky; top:84px; overflow:hidden; background:#D6D7DA;}
.print-preview iframe{display:block; width:100%; height:calc(100vh - 140px); min-height:560px; border:0;}
@media (max-width:1023px){ .print-layout{grid-template-columns:minmax(0,1fr);} .print-preview{position:static;} }

/* ---------- Phones: desktop POS stays usable (the mobile app at /m/ is the better fit) ---------- */
.show-sm{display:none !important;}
@media (max-width: 767px){
  .show-sm{display:flex !important;}
  a.alert.show-sm{text-decoration:none; color:inherit; margin-bottom:var(--sp-4);}
  .menu-item-card.has-image .mic-img{aspect-ratio:16/10;}
  .menu-item-card{min-height:0;}
  .pos-cart-jump{position:fixed; left:var(--sp-3); right:var(--sp-3); bottom:calc(var(--sp-3) + env(safe-area-inset-bottom, 0px)); z-index:var(--z-sticky);
    align-items:center; gap:var(--sp-2); height:52px; padding:0 var(--sp-4); border-radius:var(--radius-lg); background:var(--brand); color:#fff;
    font-weight:var(--fw-semibold); text-decoration:none; box-shadow:0 10px 24px -8px rgba(230,81,0,.55);}
  .pos-cart-jump b{margin-left:auto; font-size:var(--fs-lg);}
  .pos-cart-jump svg{width:18px; height:18px;}
  .pos-menu{padding-bottom:72px;}
  #cart{scroll-margin-top:calc(var(--topbar-h) + var(--sp-3));}
}

/* Product type (Super Admin plans / tenants) */
.choice-row{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--sp-2);}
.choice-row .choice{margin-bottom:0; align-items:flex-start;}
.choice-row .choice > svg{width:20px; height:20px; color:var(--text-muted); flex:none; margin-top:1px;}
.choice-row .choice > span{display:flex; flex-direction:column; gap:2px;}
.choice-row .form-hint{margin:0;}
.product-badge{display:inline-flex; align-items:center; gap:4px;}
.product-badge svg{width:13px; height:13px;}
@media (max-width:767px){ .choice-row{grid-template-columns:minmax(0,1fr);} }

/* Several bills on one table (desktop POS) */
.bill-tabs{display:flex; gap:6px; overflow-x:auto; padding:10px var(--sp-4); border-bottom:1px solid var(--border); background:var(--surface-2); scrollbar-width:thin;}
.bill-tabs form{display:flex;}
.bill-tab{flex:none; display:flex; flex-direction:column; justify-content:center; min-width:76px; max-width:140px; height:42px; padding:0 10px; border-radius:var(--radius);
  border:1px solid var(--border); background:var(--surface); color:var(--text-2); text-decoration:none; font:inherit; cursor:pointer; text-align:left;}
.bill-tab.active{border-color:var(--brand); background:var(--brand-light); color:var(--brand-dark); box-shadow:0 0 0 2px var(--brand-ring);}
.bill-tab-name{font-size:var(--fs-sm); font-weight:var(--fw-semibold); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.bill-tab-amt{font-size:11px; opacity:.8;}
.bill-tab-new{align-items:center; border-style:dashed; color:var(--brand); font-weight:var(--fw-semibold); font-size:var(--fs-sm);}
.cart-row{flex-wrap:wrap;}
.bill-remove{display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px; padding:6px var(--sp-4); border-bottom:1px solid var(--border); background:var(--surface-2);}
.bill-remove select{height:28px; font-size:var(--fs-xs); padding:0 6px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:var(--text-2); max-width:170px;}
.move-form{flex-basis:100%; display:flex; gap:6px; justify-content:flex-end; margin-top:-4px;}
.move-form select, .move-form input{height:28px; font-size:var(--fs-xs); padding:0 6px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:var(--text-2);}
.move-form input{width:52px;}
.move-form select{max-width:170px;}

/* ============================================================
   Phase 11 — onboarding wizard, setup, packages, templates
   ============================================================ */
.data-table .right, .data-table th.right{text-align:right;}
.is-muted{opacity:.55;}
.icon.rot-180{transform:rotate(180deg);}
.onb-body{background:var(--bg); min-height:100vh;}
.onb-header{display:flex; align-items:center; gap:var(--sp-3); padding:12px var(--sp-5); background:var(--surface); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:30;}
.onb-brand{display:flex; align-items:center; gap:8px; color:var(--text); text-decoration:none; font-weight:var(--fw-bold);}
.onb-header-actions{margin-left:auto; display:flex; gap:var(--sp-2); align-items:center;}
.onb-steps{background:var(--surface); border-bottom:1px solid var(--border); padding:10px var(--sp-5) 0;}
.onb-steps ol{display:flex; gap:var(--sp-2); list-style:none; margin:0 auto; padding:0 0 10px; max-width:1100px; overflow-x:auto; scrollbar-width:none;}
.onb-steps ol::-webkit-scrollbar{display:none;}
.onb-steps li{flex:none;}
.onb-steps li > a, .onb-steps li > span{display:flex; align-items:center; gap:6px; padding:6px 10px; border-radius:var(--radius-full); font-size:var(--fs-sm); color:var(--text-muted); text-decoration:none; white-space:nowrap;}
.onb-steps li > a:hover{background:var(--surface-2); color:var(--text);}
.onb-step-dot{display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; border:1.5px solid var(--border-strong); font-size:11px; font-weight:var(--fw-semibold);}
.onb-step-dot .icon{width:12px; height:12px;}
.onb-steps li.is-done .onb-step-dot{background:var(--success); border-color:var(--success); color:#fff;}
.onb-steps li.is-current > span{background:var(--brand-light); color:var(--brand-dark); font-weight:var(--fw-semibold);}
.onb-steps li.is-current .onb-step-dot{background:var(--brand); border-color:var(--brand); color:#fff;}
.onb-progress-bar{height:3px; background:var(--surface-2); margin:0 calc(var(--sp-5) * -1);}
.onb-progress-bar span{display:block; height:100%; background:var(--brand); transition:width .3s;}
.onb-main{max-width:720px; margin:0 auto; padding:var(--sp-6) var(--sp-4) var(--sp-12);}
.onb-main.is-wide{max-width:1100px;}
.onb-card{padding:var(--sp-6);}
.onb-head{margin-bottom:var(--sp-5);}
.onb-actions{display:flex; gap:var(--sp-3); justify-content:space-between; align-items:center; margin-top:var(--sp-5); flex-wrap:wrap;}
.onb-actions > :only-child{margin-left:auto;}
.onb-sticky{position:sticky; bottom:0; background:linear-gradient(transparent, var(--bg) 30%); padding:var(--sp-4) 0 var(--sp-2); z-index:5;}
.onb-otp-input{font-size:24px; letter-spacing:8px; text-align:center; max-width:220px; font-weight:var(--fw-semibold);}
.onb-tiles{display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:var(--sp-3);}
.onb-tile, .onb-platform{position:relative; display:flex; flex-direction:column; gap:6px; padding:var(--sp-4); background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius-lg); cursor:pointer; transition:border-color .15s, box-shadow .15s;}
.onb-tile:hover, .onb-platform:hover{border-color:var(--border-strong);}
.onb-tile input, .onb-platform input{position:absolute; opacity:0; pointer-events:none;}
.onb-tile:has(input:checked), .onb-platform:has(input:checked){border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);}
.onb-tile:has(input:focus-visible), .onb-platform:has(input:focus-visible){outline:2px solid var(--brand); outline-offset:2px;}
.onb-tile-icon{display:grid; place-items:center; width:44px; height:44px; border-radius:var(--radius-md); background:var(--brand-light); color:var(--brand-dark);}
.onb-tile-icon img{width:44px; height:44px; object-fit:cover; border-radius:var(--radius-md);}
.onb-tile-name{font-weight:var(--fw-semibold);}
.onb-tile-desc{font-size:var(--fs-xs); color:var(--text-muted);}
.onb-chips{display:flex; flex-wrap:wrap; gap:var(--sp-2);}
.onb-chip{position:relative; cursor:pointer;}
.onb-chip input{position:absolute; opacity:0;}
.onb-chip > span{display:inline-flex; flex-direction:column; padding:8px 14px; border:1.5px solid var(--border-strong); border-radius:var(--radius-full); font-size:var(--fs-sm); background:var(--surface);}
.onb-chip > span small{color:var(--text-muted); font-size:var(--fs-xs);}
.onb-chip input:checked + span{border-color:var(--brand); background:var(--brand-light); color:var(--brand-dark); font-weight:var(--fw-semibold);}
.onb-chip input:focus-visible + span{outline:2px solid var(--brand); outline-offset:2px;}
.onb-chip-icon > span{padding:8px;}
.onb-chip-icon .icon{width:18px; height:18px;}
.onb-templates{display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:var(--sp-4);}
.onb-template{display:flex; flex-direction:column; gap:var(--sp-2);}
.onb-template .btn{margin-top:auto;}
.onb-template-imgs{display:grid; grid-template-columns:repeat(4, 1fr); gap:4px; border-radius:var(--radius-md); overflow:hidden; min-height:8px;}
.onb-template-imgs img{width:100%; aspect-ratio:1; object-fit:cover; display:block;}
.onb-template-meta{display:flex; gap:6px; flex-wrap:wrap;}
.onb-modes{display:flex; gap:var(--sp-2); flex-wrap:wrap; border:0; padding:0; margin:0 0 var(--sp-4);}
.onb-modes .choice{margin:0;}
.onb-preview-cat{border:1px solid var(--border); border-radius:var(--radius-md); margin-bottom:var(--sp-3); overflow:hidden;}
.onb-preview-cat-head{display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--surface-2); cursor:pointer;}
.onb-preview-cat-head .text-xs{margin-left:auto;}
.onb-preview-cat ul{list-style:none; margin:0; padding:0;}
.onb-preview-cat li label{display:flex; align-items:center; gap:10px; padding:8px 14px; border-top:1px solid var(--border); cursor:pointer;}
.onb-item-text{display:flex; flex-direction:column; min-width:0; flex:1;}
.onb-item-text small{color:var(--text-muted); font-size:var(--fs-xs); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.onb-price{font-weight:var(--fw-semibold); white-space:nowrap;}
.onb-thumb{width:40px; height:40px; border-radius:8px; object-fit:cover; flex:none;}
#importForm.mode-full .js-item, #importForm.mode-full .js-cat{opacity:.4;}
.onb-summary{display:grid; grid-template-columns:repeat(5, 1fr); gap:var(--sp-2); margin:var(--sp-3) 0;}
.onb-summary > div{background:var(--surface-2); border-radius:var(--radius-md); padding:10px; text-align:center; display:flex; flex-direction:column;}
.onb-summary b{font-size:var(--fs-xl);}
.onb-summary span{font-size:var(--fs-xs); color:var(--text-muted);}
.onb-summary .is-bad b{color:var(--danger);}
.onb-platforms{display:grid; grid-template-columns:1fr 1fr; gap:var(--sp-4);}
.onb-platform{padding:var(--sp-5);}
.onb-platform-list{list-style:none; padding:0; margin:var(--sp-2) 0; display:flex; flex-direction:column; gap:6px; font-size:var(--fs-sm);}
.onb-platform-list li{display:flex; gap:8px; align-items:flex-start;}
.onb-platform-list .icon{width:16px; height:16px; color:var(--success); flex:none; margin-top:2px;}
.onb-packages{display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:var(--sp-4); align-items:start;}
.onb-package{display:flex; flex-direction:column; gap:var(--sp-2); border-width:1.5px;}
.onb-package.is-selected{border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);}
.onb-package .price{font-size:var(--fs-2xl); font-weight:var(--fw-bold);}
.onb-package .price small{font-size:var(--fs-sm); color:var(--text-muted); font-weight:var(--fw-regular);}
.onb-limits, .onb-features{list-style:none; margin:0; padding:0; font-size:var(--fs-sm); display:flex; flex-direction:column; gap:4px;}
.onb-limits{color:var(--text-2);}
.onb-features li{display:flex; gap:6px; align-items:center;}
.onb-features .icon{width:14px; height:14px; color:var(--success);}
.onb-features li.is-off{color:var(--text-faint); text-decoration:line-through;}
.onb-features li.is-off .icon{color:var(--text-faint);}
.onb-periods{border:0; padding:0; margin:var(--sp-2) 0 0;}
.onb-periods .choice{margin-bottom:6px;}
.onb-bill{margin:0 0 var(--sp-4); display:flex; flex-direction:column;}
.onb-bill > div{display:flex; justify-content:space-between; gap:var(--sp-3); padding:8px 0; border-bottom:1px dashed var(--border); font-size:var(--fs-sm);}
.onb-bill dt{color:var(--text-muted);}
.onb-bill dd{margin:0; font-weight:var(--fw-medium); text-align:right;}
.onb-bill-total{font-size:var(--fs-md) !important; border-bottom:0 !important;}
.onb-bill-total dt, .onb-bill-total dd{color:var(--text); font-weight:var(--fw-bold);}
.onb-logo-preview{display:block; width:72px; height:72px; object-fit:cover; border-radius:var(--radius-md); margin-bottom:6px; border:1px solid var(--border);}
.onb-menu-table tr.is-unconfirmed{background:var(--warning-bg);}
.onb-price-input{width:96px; text-align:right;}
.onb-staff-list{list-style:none; margin:0 0 var(--sp-4); padding:0; display:flex; flex-direction:column; gap:8px;}
.onb-staff-list li{display:flex; align-items:center; gap:10px;}
.onb-checklist{list-style:none; padding:0; margin:0 0 var(--sp-4); display:flex; flex-direction:column; gap:6px;}
.onb-checklist li{display:flex; gap:8px; align-items:center; font-size:var(--fs-sm);}
.onb-checklist .is-ok .icon{color:var(--success);}
.onb-checklist .is-missing{color:var(--warning);}
.sub-plan{border:1px solid var(--border); border-radius:var(--radius-md); padding:var(--sp-3); margin-bottom:var(--sp-3);}
.sub-plan.is-current{border-color:var(--success-border); background:var(--success-bg);}
.sub-plan-head{display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-bottom:var(--sp-2);}
.sub-plan-head .text-xs{flex-basis:100%;}
.sub-plan .choice-row{display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:6px;}
.sub-plan .choice{margin:0;}
.plan-periods{list-style:none; padding:0; margin:0 0 var(--sp-2);}
.tpl-help{padding:0 var(--sp-5);}
.tpl-groups{padding:0 var(--sp-5) var(--sp-5); max-height:70vh; overflow:auto;}
.tpl-group{border:1px solid var(--border); border-radius:var(--radius-md); margin-bottom:var(--sp-2);}
.tpl-group summary{display:flex; align-items:center; gap:8px; padding:8px 12px; cursor:pointer; background:var(--surface-2);}
.tpl-group ul{list-style:none; margin:0; padding:0;}
.tpl-item{display:flex; align-items:center; justify-content:space-between; gap:var(--sp-2); padding:6px 12px; border-top:1px solid var(--border);}
.tpl-item .check{display:flex; align-items:center; gap:8px; min-width:0;}
.tpl-item .input-xs{width:90px;}
@media (max-width: 767px){
  .onb-header{padding:10px var(--sp-3);}
  .onb-steps{padding:8px var(--sp-3) 0;}
  .onb-step-label{display:none;}
  .onb-steps li.is-current .onb-step-label{display:inline;}
  .onb-main{padding:var(--sp-4) var(--sp-3) var(--sp-10);}
  .onb-card{padding:var(--sp-4);}
  .onb-tiles{grid-template-columns:1fr 1fr;}
  .onb-platforms{grid-template-columns:1fr;}
  .onb-summary{grid-template-columns:repeat(3, 1fr);}
  .onb-actions .btn-lg{flex:1;}
}
.onb-brand .brand-name{color:var(--text);} .onb-brand .brand-name b{color:var(--brand);}
.onb-limits li::first-letter{text-transform:uppercase;}

/* Phase 12: menu edit mode + category rows */
.card-editing{border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-ring);}
.data-table tr.row-editing td{background:var(--brand-light);}
.cat-row{gap:6px; align-items:center;}
.cat-row form{gap:6px; align-items:center; margin:0;}

/* Super Admin: permanent-delete section (tenant view) */
.danger-zone{border-color:var(--danger-border); background:var(--danger-bg);}
.danger-zone .card-title{color:var(--danger);}
.danger-zone-form{display:flex; flex-wrap:wrap; align-items:center; gap:var(--sp-2) var(--sp-3);}
.danger-zone-form label{flex-basis:100%;}
.danger-zone-form input[type=text]{max-width:260px;}
.mail-transcript{white-space:pre-wrap; word-break:break-all; font-size:12px; background:var(--surface-2, #f6f7f9); padding:var(--sp-3); border-radius:8px; max-height:360px; overflow:auto; margin:var(--sp-2) 0;}

/* ---------- Package tabs (Subscription page, web + mobile app): Web + Mobile | Mobile only ---------- */
.plan-tabs{display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:4px; padding:4px; margin-bottom:var(--sp-3);
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-lg);}
.plan-tab{display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:0 10px; border:0; border-radius:var(--radius-md);
  background:none; color:var(--text-muted); font:inherit; font-weight:600; cursor:pointer; transition:background var(--t-fast), color var(--t-fast);}
.plan-tab svg{width:18px; height:18px; flex:none;}
.plan-tab span:not(.plan-tab-count){white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.plan-tab.active{background:var(--surface); color:var(--brand-dark); box-shadow:var(--shadow-xs);}
.plan-tab.active svg{color:var(--brand);}
.plan-tab-count{min-width:20px; height:20px; padding:0 6px; border-radius:10px; font-size:11px; line-height:20px; text-align:center;
  background:var(--border); color:var(--text-muted);}
.plan-tab.active .plan-tab-count{background:var(--brand-light); color:var(--brand-dark);}
.plan-tab:focus-visible{outline:2px solid var(--brand); outline-offset:2px;}
.plan-tab-panel[hidden]{display:none;}
.plan-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:var(--sp-3);}
.plan-grid .sub-plan{margin:0; display:flex; flex-direction:column;}
.plan-grid .sub-plan .choice-row{margin-top:auto;}
.sub-plan-head .badge svg{width:12px; height:12px;}
.sub-plan.is-blocked{opacity:.75;}
.plan-price{font-size:var(--fs-xl, 20px); font-weight:700; margin:2px 0 8px;}
.plan-price small, .m-plan-from small{font-size:var(--fs-xs); font-weight:600; color:var(--text-muted); margin-left:4px;}
.plan-features{list-style:none; margin:0 0 6px; padding:0; display:flex; flex-direction:column; gap:4px; font-size:var(--fs-sm);}
.plan-features li{display:flex; gap:8px; align-items:flex-start;}
.plan-features svg{width:16px; height:16px; color:var(--success); flex:none; margin-top:2px;}
.plan-limits{margin:0 0 10px;}
.plan-blocked{display:flex; gap:6px; align-items:flex-start; margin:0;}
.plan-blocked svg{width:14px; height:14px; flex:none; margin-top:1px;}

/* Signup: package picked on the landing page */
.signup-plan{display:flex; gap:12px; align-items:flex-start; flex-wrap:wrap; padding:14px; margin-bottom:var(--sp-4); border:1px solid rgba(230,81,0,.35); border-radius:var(--radius-lg); background:var(--brand-light);}
.signup-plan-ic{display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; flex:none; border-radius:10px; background:var(--brand-gradient); color:#fff;}
.signup-plan-ic svg{width:20px; height:20px;}
.signup-plan-actions{display:flex; flex-direction:column; gap:2px; margin-left:auto;}
@media (max-width:520px){ .signup-plan-actions{flex-direction:row; width:100%; margin-left:52px;} }

/* Pricing (includes/pricing_ui.php): launch vs regular, renewal, trial, offer banner */
.price-block{margin:6px 0 10px;}
.price-tags{display:flex; align-items:center; gap:8px; margin-bottom:2px;}
.price-tag{display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px; background:var(--brand-light); color:var(--brand-dark); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em;}
.price-tag svg{width:12px; height:12px;}
.price-was{color:var(--text-muted); font-weight:500; text-decoration-thickness:1.5px;}
.price-main{font-size:28px; font-weight:800; letter-spacing:-.02em; line-height:1.15;}
.price-main small{font-size:13px; font-weight:600; color:var(--text-muted); margin-left:4px; letter-spacing:0;}
.price-sub{font-size:12.5px; color:var(--text-muted); margin-top:2px;}
.price-renew, .price-trial, .price-extra{display:flex; align-items:flex-start; gap:6px; font-size:12.5px; color:var(--text-2); margin-top:6px;}
.price-renew svg, .price-trial svg, .price-extra svg{width:14px; height:14px; flex:none; margin-top:2px; color:var(--text-muted);}
.price-now{color:var(--text);}
.price-offer{display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius:var(--radius-lg); border:1px solid rgba(230,81,0,.35); background:var(--brand-light); color:var(--text); font-size:var(--fs-sm); line-height:1.5;}
.price-offer > svg{width:20px; height:20px; flex:none; color:var(--brand); margin-top:1px;}
.price-offer-renew{color:var(--text-2);}
.price-preview{padding:14px; margin-bottom:var(--sp-4); background:var(--bg); border:1px dashed var(--border);}
.m-plan .price-block{margin:8px 0;}
.m-plan .price-main{font-size:22px;}

/* Payment receipt (billing/receipt.php) */
.receipt-page{background:var(--bg); padding:24px 12px;}
.receipt{max-width:640px; margin:0 auto;}
.receipt-head{display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:16px; padding-bottom:12px; border-bottom:1px solid var(--border);}
.receipt-brand{font-size:20px;}
.receipt-title{text-align:right;}
.receipt-title h1{font-size:20px; margin:0;}
@media print{ .receipt-page{background:#fff; padding:0;} .receipt{box-shadow:none; border:0;} .no-print{display:none !important;} }
.receipt-party{margin-top:6px; line-height:1.5;}
.receipt-parties{display:grid; grid-template-columns:1fr auto; gap:16px; margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid var(--border);}
@media (max-width:520px){ .receipt-parties{grid-template-columns:1fr;} .receipt-head{flex-direction:column;} .receipt-title{text-align:left;} }
