/* ==========================================================
   ANDROID MATERIAL UI – FULL CSS (NO GRADIENT)
   Rules followed:
   - NO change in any existing class/id names
   - NO gradients; solid Android feel
   - All theme colors controllable via :root
   - Mobile-first + fast
   ========================================================== */

/* =========================
   1) THEME VARIABLES
   ========================= */
:root{
  /* Base surfaces */
  --bg-main:#f3f6f9;
  --bg-card:#ffffff;

  /* Text */
  --text-main:#1f2937;
  --text-muted:#6b7280;

  /* Brand (Change these 3 for full theme control) */
  --primary:#9d0220;
  --primary-rgb: 157,2,32;       /* same as --primary but RGB (for rgba tints) */
  --primary-light:#f8c4ce;

  /* System */
  --border-color:#e5e7eb;
  --border2-color:#d00774;
  --success:#16a34a;
  --danger:#dc2626;
  --warning:#f59e0b;

  /* Radius & shadows */
  --radius:18px;
  --radius-sm:14px;
  --radius-lg:22px;

  --shadow: 0 12px 28px rgba(17,24,39,0.08);
  --shadow-sm: 0 6px 16px rgba(17,24,39,0.08);

  /* Motion */
  --tap: 140ms cubic-bezier(.2,.8,.2,1);

  /* Compatibility vars (kept; now solid/tints – NO gradients) */
  --primary-2: var(--primary);
  --accent: var(--primary);
  --grad-app: var(--primary); /* kept name but solid */
  --grad-card-1: rgba(var(--primary-rgb),0.10);
  --grad-card-2: rgba(22,163,74,0.10);
  --grad-card-3: rgba(245,158,11,0.10);
  --grad-card-4: rgba(220,38,38,0.10);

  /* Common tints */
  --tint-1: rgba(var(--primary-rgb),0.08);
  --tint-2: rgba(var(--primary-rgb),0.12);
  --tint-3: rgba(var(--primary-rgb),0.18);

  --surface: rgba(243,246,249,0.95);
  --surface-2: rgba(255,255,255,0.92);
  
  /* Margin scale (px) – change once, effect everywhere */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  
  }

/* =========================
   2) BASE RESET
   ========================= */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue";
  background:var(--bg-main);
  color:var(--text-main);
}
a{ color:inherit; text-decoration:none; }
small,.small{ font-size:12px; }
.muted{ color:var(--text-muted); }
.sub{ color:var(--text-muted); font-size:13px; margin-top:4px; font-weight:700; }
hr.sep{ border:0; height:1px; background:var(--border-color); margin:14px 0; }
.sep{ border:0; border-top:1px solid var(--border-color); margin:14px 0; }
.right{ text-align:right; }

/* =========================
   3) APP LAYOUT
   ========================= */
.app-shell{ display:flex; min-height:100vh; }

/* =========================
   4) HEADER (Solid App Bar)
   ========================= */
.app-header{
  position:fixed; top:0; left:0; right:0;
  height:56px;
  background: var(--primary);
  border-bottom:1px solid rgba(255,255,255,0.18);
  display:flex; align-items:center; gap:10px;
  padding:0 14px;
  z-index:50;
  color:#fff;
  box-shadow: 0 10px 22px rgba(17,24,39,0.16);
}
.app-title{ font-weight:900; letter-spacing:.2px; }
.app-actions{ margin-left:auto; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* =========================
   5) ICON BUTTON (Header)
   ========================= */
.icon-btn{
  width:42px; height:42px;
  border:1px solid rgba(255,255,255,0.24);
  background:rgba(255,255,255,0.14);
  border-radius:14px;
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer;
  color:#fff;
  transition: transform var(--tap), background var(--tap), filter var(--tap);
}
.icon-btn:hover{
  background:rgba(255,255,255,0.20);
  filter:none;
}
.icon-btn:active{ transform: translateY(1px); }

.hamburger,.xicon{
  position:relative; width:18px; height:12px; display:block;
}
.hamburger:before,.hamburger:after,.hamburger span{
  content:""; position:absolute; left:0; right:0; height:2px;
  background:#fff; border-radius:2px;
}
.hamburger:before{ top:0; }
.hamburger span{ top:5px; }
.hamburger:after{ bottom:0; }

.xicon:before,.xicon:after{
  content:""; position:absolute; left:0; right:0; top:5px; height:2px;
  background:#fff; border-radius:2px;
}
.xicon:before{ transform:rotate(45deg); }
.xicon:after{ transform:rotate(-45deg); }

/* =========================
   6) SIDEBAR / DRAWER
   ========================= */
.app-sidebar{
  position:fixed; top:56px; left:0; bottom:0;
  width:280px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-right:1px solid var(--border-color);
  transform:translateX(-100%);
  transition:transform .2s ease;
  z-index:60;
  display:flex; flex-direction:column;
  box-shadow: var(--shadow);
}
.app-sidebar.open{ transform:translateX(0); }
.drawer-open{ overflow:hidden; }

.drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid var(--border-color);
}
.drawer-title{ font-weight:900; color:var(--text-main); }

.nav{ padding:10px 8px; overflow:auto; height: calc(100% - 150px);}
.nav-section{
  margin:10px 10px 6px;
  font-size:11px;
  font-weight:900;
  color:var(--text-muted);
  text-transform:uppercase;
  letter-spacing:.6px;
}
.nav-link{
  display:flex;
  padding:10px 12px;
  margin:4px 6px;
  border-radius:14px;
  color:var(--text-main);
  border:1px solid transparent;
  transition: background var(--tap), transform var(--tap), border-color var(--tap);
}
.nav-link:hover{
  background:var(--primary-light);
  color:var(--primary);
  border-color: rgba(var(--primary-rgb),0.18);
  transform: translateY(-1px);
}

/* =========================
   7) MAIN
   ========================= */
.app-main{
  flex:1;
  padding:72px 14px 18px 14px;
  width:100%;
}
body.has-bottom-nav .app-main{ padding-bottom: 86px; }

@media(min-width:1024px){
  .app-sidebar{ transform:translateX(0); }
  .app-main{ margin-left:280px; padding:72px 18px 18px 18px; }
  #btnDrawer{ display:none; }
  #btnDrawerClose{ display:none; }
}

/* =========================
   8) CARD
   ========================= */
.card{
  background:var(--bg-card);
  border:1px solid var(--border-color);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  padding:14px;
  margin-bottom:14px;
}
.card h2{ margin:0; font-size:18px; }
.card h3{ margin:0 0 6px 0; font-size:16px; }
.card-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.card-title{ font-weight:900; }

/* KPI */
.kpi{
  background: var(--surface-2);
  border:1px solid var(--border-color);
  border-radius:var(--radius);
  padding:12px;
}
.kpi .v{ font-size:18px; font-weight:900; }
.kpi .k{ color:var(--text-muted); font-size:12px; margin-top:4px; font-weight:800; }

/* =========================
   9) GRID
   ========================= */
.grid{ display:flex; flex-wrap:wrap; margin:-8px; }
.col-12{ width:100%; padding:8px; }
.col-6{ width:100%; padding:8px; }
.col-4{ width:100%; padding:8px; }
@media(min-width:768px){
  .col-6{ width:50%; }
  .col-4{ width:33.333%; }
}

/* Legacy helpers (kept) */
.col-8{ flex:0 0 calc(66.666% - 6px); }
.col-3{ flex:0 0 calc(25% - 9px); }
@media (max-width: 900px){
  .col-8,.col-3{ flex:0 0 100%; }
}
.actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }

/* =========================
   10) FORMS / INPUTS
   ========================= */
label{ display:block; font-size:12px; font-weight:900; color:var(--text-muted); margin:10px 0 6px; }

.input, input[type="text"], input[type="date"], input[type="month"], input[type="number"], textarea, select{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--border-color);
  border-radius:14px;
  background:#fff;
  color:var(--text-main);
  outline:none;
  transition: box-shadow var(--tap), border-color var(--tap), background var(--tap);
}
textarea{ min-height:96px; resize:vertical; }

.input:focus, input:focus, textarea:focus, select:focus{
  border-color: rgba(var(--primary-rgb),0.55);
  box-shadow:0 0 0 4px rgba(var(--primary-rgb),0.12);
}

.form-row{ display:grid; gap:10px; }
.form-row.cols-2{ grid-template-columns:1fr; }
.form-row.cols-3{ grid-template-columns:1fr; }
@media(min-width:768px){
  .form-row.cols-2{ grid-template-columns:1fr 1fr; }
  .form-row.cols-3{ grid-template-columns:1fr 1fr 1fr; }
}

/* =========================
   11) BUTTONS (Consistent)
   ========================= */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(var(--primary-rgb),0.14);
  cursor:pointer;
  font-weight: 900;
  background: var(--surface);
  color: var(--text-main);
  transition: transform var(--tap), box-shadow var(--tap), background var(--tap), border-color var(--tap);
  box-shadow: 0 6px 14px rgba(17,24,39,0.06);
}
.btn:hover{
  background: rgba(var(--primary-rgb),0.10);
  border-color: rgba(var(--primary-rgb),0.18);
}
.btn:active{ transform: translateY(1px) scale(0.99); }

.btn-primary{
  border: 0;
  color:#fff;
  background: var(--primary);
  box-shadow: 0 10px 18px rgba(var(--primary-rgb),0.22);
}
.btn-primary:hover{
  background: rgba(var(--primary-rgb),1);
  filter:none;
}

.btn-secondary{
  background: rgba(var(--primary-rgb),0.10);
  border-color: rgba(var(--primary-rgb),0.18);
  color: var(--primary);
  box-shadow: 0 6px 14px rgba(17,24,39,0.05);
}
.btn-secondary:hover{
  background: rgba(var(--primary-rgb),0.14);
  border-color: rgba(var(--primary-rgb),0.24);
}

.btn-danger{
  background:rgba(220,38,38,.10);
  border-color:rgba(220,38,38,.20);
  color:var(--danger);
  box-shadow: 0 6px 14px rgba(17,24,39,0.05);
}
.btn-danger:hover{ background:rgba(220,38,38,.14); }

/* ANDROID TEXT BUTTON (Ghost) */
.btn-ghost{
  background: transparent;
  border: none;
  color: var(--primary);
  box-shadow: none;
    border: 1px solid rgba(var(--border2-color),0.14);

}
.btn-ghost:hover{
  background: rgba(var(--primary-rgb),0.12);
  color: var(--primary);
}
.btn-ghost:active{
  background: rgba(var(--primary-rgb),0.18);
  transform: translateY(1px);
}

/* Ghost on header (white text) */
.app-header .btn-ghost{
  color:#fff;
}
.app-header .btn-ghost:hover{
  background: rgba(255,255,255,0.18);
  color:#fff;
}
.app-header .btn-ghost:active{
  background: rgba(255,255,255,0.26);
}

/* Make inputs/buttons consistent if used as input[type=submit] */
input.btn, button.btn{
  -webkit-appearance: none;
  appearance: none;
}

/* =========================
   12) BADGES / CHIPS
   ========================= */
.badge{
  display:inline-flex; align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border-color);
  background:#fff;
  font-size:12px;
  font-weight:900;
  margin-right:6px;
}
.badge.ok{ background:rgba(22,163,74,.10); border-color:rgba(22,163,74,.18); color:var(--success); }
.badge.bad{ background:rgba(220,38,38,.10); border-color:rgba(220,38,38,.18); color:var(--danger); }

.chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px;
  background: rgba(255,255,255,0.85);
  border:1px solid var(--border-color);
  border-radius:999px;
  color:var(--text-main);
  font-size:12px;
  font-weight:900;
}
.chip--info{ background: rgba(var(--primary-rgb),0.10); color: var(--primary); border-color: rgba(var(--primary-rgb),0.18); }
.chip--ok{ background: rgba(22,163,74,0.12); color: var(--success); border-color: rgba(22,163,74,0.18); }
.chip--bad{ background: rgba(220,38,38,0.10); color: var(--danger); border-color: rgba(220,38,38,0.18); }
.chip--soft{ background: rgba(243,246,249,0.8); color: var(--text-main); }

/* =========================
   13) ALERTS
   ========================= */
.alert{
  padding:12px 14px;
  border-radius:16px;
  margin-bottom:12px;
  font-weight:900;
  border: 1px solid var(--border-color);
  background:#fff;
}
.alert-success{ background: rgba(22,163,74,0.12); color: var(--success); border-color: rgba(22,163,74,0.18); }
.alert-danger{ background: rgba(220,38,38,0.10); color: var(--danger); border-color: rgba(220,38,38,0.18); }
.alert-warning{ background: rgba(245,158,11,0.12); color: var(--warning); border-color: rgba(245,158,11,0.18); }
.alert-info{ background: rgba(var(--primary-rgb),0.10); color: var(--primary); border-color: rgba(var(--primary-rgb),0.18); }

/* =========================
   14) TABLES
   ========================= */
.table-wrapper{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  border:1px solid var(--border-color);
  border-radius:16px;
  background:#fff;
}
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:760px;
}
thead th{
  position:sticky; top:0;
  background: rgba(var(--primary-rgb),0.10);
  border-bottom:1px solid var(--border-color);
  padding:10px 12px;
  text-align:left;
  font-size:12px;
  color:var(--text-muted);
  font-weight:900;
}
tbody td{
  padding:10px 12px;
  border-bottom:1px solid var(--border-color);
  vertical-align:top;
  font-size:13px;
}
tbody tr:hover td{ background: rgba(243,246,249,0.9); }

/* class="table" alias (kept) */
.table{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
  background:#fff;
}
.table th, .table td{
  padding:10px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align:left;
  font-size:13px;
}
.table th{
  position:sticky; top:0;
  background: rgba(var(--primary-rgb),0.10);
  font-weight:900;
}
.table tr:hover td{ background: rgba(243,246,249,0.9); }

@media (max-width: 900px){
  table{ min-width: 860px; }
  .table{ min-width: 860px; }
}

/* =========================
   15) QTY GRID + ADDON BOX
   ========================= */
.qty-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:6px;
  min-width:200px;
}
.qty-input{ text-align:center; padding:8px 10px; border-radius:14px; }

.addon-box{
  margin-top:10px;
  border:1px solid var(--border-color);
  border-radius:14px;
  padding:10px;
  background: rgba(243,246,249,0.8);
}
.addon-meal{ margin-bottom:10px; }
.addon-meal:last-child{ margin-bottom:0; }
.addon-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:6px 0;
  border-bottom:1px dashed rgba(229,231,235,.9);
}
.addon-row:last-child{ border-bottom:0; }
.addon-name{ font-size:13px; font-weight:800; }
.addon-qty{ max-width:90px; text-align:center; }

/* =========================
   16) MODAL
   ========================= */
.modal{
  position:fixed; inset:0;
  background:rgba(15,23,42,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  z-index:100;
}
.modal-card{
  width:100%;
  max-width:520px;
  background:var(--bg-card);
  border:1px solid var(--border-color);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  padding:14px;
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom:10px;
}
.modal-title{ font-weight:1000; font-size:16px; }

/* =========================
   17) DETAILS
   ========================= */
details summary{ cursor:pointer; list-style:none; }
details summary::-webkit-details-marker{ display:none; }

/* =========================
   18) METRICS
   ========================= */
.metric-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 1100px){ .metric-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .metric-grid{ grid-template-columns: 1fr; } }

.metric-card{
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: #fff;
  overflow:hidden;
  position:relative;
}
.metric-card:before{
  content:"";
  position:absolute; inset:0;
  opacity:1;
  pointer-events:none;
}
.metric-card.grad-1:before{ background: var(--grad-card-1); }
.metric-card.grad-2:before{ background: var(--grad-card-2); }
.metric-card.grad-3:before{ background: var(--grad-card-3); }
.metric-card.grad-4:before{ background: var(--grad-card-4); }
.metric-card > *{ position:relative; }
.metric-label{ font-size:12px; font-weight:900; color: var(--text-muted); }
.metric-value{ font-size:22px; font-weight:1000; margin-top:8px; }
.metric-sub{ font-size:12px; color: var(--text-muted); margin-top:6px; }

/* =========================
   19) TODAY BREAKDOWN CARDS
   ========================= */
.mobile-cards{ display:grid; gap:10px; }
.desktop-table{ display:none; }
@media (min-width: 900px){
  .mobile-cards{ display:none; }
  .desktop-table{ display:block; }
}

.mini-card{
  border:1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background:#fff;
  box-shadow: var(--shadow-sm);
  padding:12px;
  transition: transform var(--tap), box-shadow var(--tap);
}
.mini-card:hover{ transform: translateY(-1px); box-shadow: var(--shadow); }
.mini-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.mini-name{ font-weight:1000; }
.mini-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
  margin-top:10px;
  font-size:13px;
}
.mini-grid .right{ text-align:right; }
.mini-total{
  display:flex; align-items:center; justify-content:space-between;
  margin-top:10px;
  padding-top:10px;
  border-top:1px dashed var(--border-color);
}
.amount{ font-weight:1000; color: var(--primary); }

/* =========================
   20) EMPTY STATE
   ========================= */
.empty-card{ padding:18px; }
.empty-state{ text-align:center; padding:12px; }
.empty-emoji{
  width:54px; height:54px; border-radius:18px;
  display:inline-flex; align-items:center; justify-content:center;
  background: rgba(var(--primary-rgb),0.12);
  border: 1px solid rgba(var(--primary-rgb),0.18);
  font-size:26px;
}
.empty-title{ margin-top:10px; font-weight:1000; }
.empty-text{ margin-top:6px; color:var(--text-muted); }
.empty-actions{ margin-top:12px; }

/* =========================
   21) BOTTOM NAV (Active = solid)
   ========================= */
.bottom-nav{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  width: calc(100% - 20px);
  max-width: 560px;
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(17,24,39,0.14);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 80;
  padding: 8px 6px;
}
.bottom-nav__item{
  text-decoration:none;
  color: var(--text-muted);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 18px;
  transition: background var(--tap), transform var(--tap), color var(--tap);
  user-select:none;
}
.bottom-nav__icon{ font-size:18px; line-height:1; }
.bottom-nav__label{ font-size:11px; font-weight:900; }
.bottom-nav__item:active{ transform: translateY(1px); }
.bottom-nav__item:hover{ background: rgba(var(--primary-rgb),0.10); color: var(--primary); }

.bottom-nav__item.is-active{
  background: var(--primary);
  color:#fff;
}
.bottom-nav__item.is-active .bottom-nav__label{ color:#fff; }

/* =========================
   22) AUTH / LOGIN UI
   ========================= */
.auth-wrap{ max-width:1100px; margin:0 auto; padding:18px; }
.auth-grid{ display:grid; grid-template-columns:1fr; gap:14px; }
@media (min-width: 900px){
  .auth-grid{ grid-template-columns:1fr 1fr; align-items:start; }
}

.menu-card{
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.menu-card__head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px;
  background: rgba(var(--primary-rgb),0.08);
  border-bottom: 1px solid var(--border-color);
}
.menu-card__title{ display:flex; align-items:center; gap:10px; font-weight:1000; }
.menu-card__icon{
  width: 38px; height: 38px; border-radius: 14px;
  display:inline-flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.badge--updated{
  background: rgba(22,163,74,0.10);
  border-color: rgba(22,163,74,0.18);
  color: var(--success);
}
.badge--date{
  background: rgba(var(--primary-rgb),0.10);
  border-color: rgba(var(--primary-rgb),0.18);
  color: var(--primary);
}

.menu-card__body{ padding:12px 14px; }
.meal-row{
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px;
  padding: 12px 10px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  transition: transform var(--tap), box-shadow var(--tap);
}
.meal-row + .meal-row{ margin-top:10px; }
.meal-row:hover{ transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.meal-row__left{ display:flex; align-items:center; gap:10px; min-width: 180px; }
.meal-emoji{
  width: 36px; height: 36px; border-radius: 14px;
  display:inline-flex; align-items:center; justify-content:center;
  border: 1px solid var(--border-color);
  background: rgba(243,246,249,0.9);
  font-size: 18px;
}
.meal-name{ font-weight: 1000; font-size: 13px; }
.meal-sub{ font-size: 12px; color: var(--text-muted); margin-top:2px; font-weight:800; }
.meal-row__right{ flex:1; text-align:right; }
.meal-text{ font-size: 13px; font-weight: 900; word-break: break-word; }

.menu-empty{ text-align:center; padding: 18px 16px; }
.menu-empty__icon{
  width: 52px; height: 52px; border-radius: 18px;
  margin: 0 auto 10px;
  display:inline-flex; align-items:center; justify-content:center;
  background: rgba(var(--primary-rgb),0.12);
  border: 1px solid rgba(var(--primary-rgb),0.18);
  font-size: 24px;
}
.menu-empty__title{ font-weight: 1000; }
.menu-empty__text{ color: var(--text-muted); font-size: 13px; margin-top: 4px; font-weight:800; }

/* =========================
   23) PAGE HEAD + FILTERS
   ========================= */
.page-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:12px;
  margin: 6px 0 12px;
}
.h1{ margin:0; font-size:22px; font-weight:1000; letter-spacing:.2px; }
.h2{ margin:0; font-size:20px; font-weight:1000; letter-spacing:.2px; }
.page-actions{ display:flex; gap:10px; flex-wrap:wrap; }

.filters-card{ padding:12px; }
.filters{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:10px;
}
.form-row--btn{ display:flex; flex-direction:column; justify-content:flex-end; }
@media (max-width: 900px){
  .filters{ grid-template-columns: 1fr 1fr; }
}

.kbd{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 2px 8px; border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.75);
  font-weight: 900; font-size: 12px;
}
/* ==========================================================
   SPECIAL THEME: when BOTH classes are used together
   <a class="btn btn-ghost"> or <button class="btn btn-ghost">
   ========================================================== */

.btn.btn-ghost{
  /* Make it "outlined-tonal" (different from normal btn) */
  background: rgba(var(--primary-rgb), 0.08) !important;
  border: 1px solid rgba(var(--primary-rgb), 0.30) !important;
  color: var(--primary) !important;

  /* bring back button feel (since .btn-ghost removes) */
  box-shadow: 0 6px 14px rgba(17,24,39,0.06) !important;
}

.btn.btn-ghost:hover{
  background: rgba(var(--primary-rgb), 0.12) !important;
  border-color: rgba(var(--primary-rgb), 0.38) !important;
}

.btn.btn-ghost:active{
  background: rgba(var(--primary-rgb), 0.16) !important;
  transform: translateY(1px) scale(0.99) !important;
}

/* If the same is used inside header, keep it readable */
.app-header .btn.btn-ghost{
  background: rgba(255,255,255,0.16) !important;
  border-color: rgba(255,255,255,0.30) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.app-header .btn.btn-ghost:hover{
  background: rgba(255,255,255,0.22) !important;
}
/* ===== ALL SIDES ===== */
.m-0{margin:var(--space-0)}
.m-1{margin:var(--space-1)}
.m-2{margin:var(--space-2)}
.m-3{margin:var(--space-3)}
.m-4{margin:var(--space-4)}
.m-5{margin:var(--space-5)}
.m-6{margin:var(--space-6)}
.m-8{margin:var(--space-8)}
.m-10{margin:var(--space-10)}

/* ===== TOP ===== */
.mt-0{margin-top:var(--space-0)}
.mt-1{margin-top:var(--space-1)}
.mt-2{margin-top:var(--space-2)}
.mt-3{margin-top:var(--space-3)}
.mt-4{margin-top:var(--space-4)}
.mt-5{margin-top:var(--space-5)}
.mt-6{margin-top:var(--space-6)}
.mt-8{margin-top:var(--space-8)}

/* ===== BOTTOM ===== */
.mb-0{margin-bottom:var(--space-0)}
.mb-1{margin-bottom:var(--space-1)}
.mb-2{margin-bottom:var(--space-2)}
.mb-3{margin-bottom:var(--space-3)}
.mb-4{margin-bottom:var(--space-4)}
.mb-5{margin-bottom:var(--space-5)}
.mb-6{margin-bottom:var(--space-6)}
.mb-8{margin-bottom:var(--space-8)}

/* ===== LEFT ===== */
.ml-0{margin-left:var(--space-0)}
.ml-1{margin-left:var(--space-1)}
.ml-2{margin-left:var(--space-2)}
.ml-3{margin-left:var(--space-3)}
.ml-4{margin-left:var(--space-4)}
.ml-5{margin-left:var(--space-5)}

/* ===== RIGHT ===== */
.mr-0{margin-right:var(--space-0)}
.mr-1{margin-right:var(--space-1)}
.mr-2{margin-right:var(--space-2)}
.mr-3{margin-right:var(--space-3)}
.mr-4{margin-right:var(--space-4)}
.mr-5{margin-right:var(--space-5)}

/* ===== AXIS ===== */
.mx-1{margin-left:var(--space-1);margin-right:var(--space-1)}
.mx-2{margin-left:var(--space-2);margin-right:var(--space-2)}
.mx-3{margin-left:var(--space-3);margin-right:var(--space-3)}
.mx-4{margin-left:var(--space-4);margin-right:var(--space-4)}

.my-1{margin-top:var(--space-1);margin-bottom:var(--space-1)}
.my-2{margin-top:var(--space-2);margin-bottom:var(--space-2)}
.my-3{margin-top:var(--space-3);margin-bottom:var(--space-3)}
.my-4{margin-top:var(--space-4);margin-bottom:var(--space-4)}
/* =========================================================
   MOBILE TABLE UX (PLAN-1 CSS-ONLY)
   Goal: No horizontal scroll on mobile. Convert tables into
   stacked "card rows" WITHOUT changing HTML/JS/back-end.
   NOTE: Since we are not adding data-label attributes,
   we style the FIRST cell as the row title, and show each
   remaining cell as a value line.
   ========================================================= */
@media (max-width: 768px){
  /* Make wrapper not force wide tables */
  .table-wrapper{
    overflow: visible !important;
    border-radius: 16px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .table-wrapper table{
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0 10px; /* space between row cards */
  }

  /* Hide header on mobile to reduce clutter */
  .table-wrapper thead{
    display:none;
  }

  /* Each row becomes a card */
  .table-wrapper tbody tr{
    display:block;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(15,23,42,.06);
    padding: 10px 12px;
  }

  /* Cells become stacked lines */
  .table-wrapper tbody td{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(229,231,235,.9);
    font-size: 13px;
    white-space: normal !important;
    word-break: break-word;
  }
  .table-wrapper tbody td:last-child{
    border-bottom: 0;
    padding-bottom: 2px;
  }

  /* First cell = row title (bigger + bold) */
  .table-wrapper tbody td:first-child{
    border-bottom: 1px solid rgba(229,231,235,.9);
    padding-bottom: 10px;
    margin-bottom: 6px;
    font-weight: 900;
    font-size: 14px;
    color: var(--text-main, #1f2937);
  }

  /* Align common action buttons nicely */
  .table-wrapper tbody td .btn,
  .table-wrapper tbody td button,
  .table-wrapper tbody td a.btn{
    width: auto;
  }

  /* If table has checkboxes/inputs, keep them usable */
  .table-wrapper input,
  .table-wrapper select,
  .table-wrapper textarea{
    max-width: 170px;
  }
}

/* OPTIONAL: For very small screens, tighten spacing */
@media (max-width: 420px){
  .table-wrapper tbody tr{ padding: 10px 10px; }
  .table-wrapper tbody td{ gap: 10px; }
}