/* =====================================================================
   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);}
.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;}
  .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;}
