/* TORQE Kitchen theme — Yellow, Blue, Charcoal Grey, White
   Built on top of Bootstrap 5 (Reboot already gives us cross-browser reset).
   All colours via CSS variables. Old --rasoi-* names kept (re-mapped to new palette)
   so the entire existing UI rebrands without renaming a single class. */

:root {
  /* New TORQE brand */
  --torqe-yellow:      #FFD93D;
  --torqe-yellow-dark: #E6BE16;
  --torqe-yellow-50:   #FFF6CC;
  --torqe-blue:        #1DB8FF;
  --torqe-blue-dark:   #0E91D0;
  --torqe-blue-50:     #DBF1FF;
  --torqe-charcoal:    #2C2C2C;
  --torqe-charcoal-2:  #3A3A3A;
  --torqe-white:       #FFFFFF;

  /* Legacy --rasoi-* names mapped to the new palette so existing classes work.
     PRIMARY = yellow. SECONDARY accent (was turquoise) = blue. */
  --rasoi-crimson:       var(--torqe-yellow);
  --rasoi-crimson-dark:  var(--torqe-yellow-dark);
  --rasoi-crimson-50:    var(--torqe-yellow-50);
  --rasoi-turquoise:     var(--torqe-blue);
  --rasoi-turquoise-dark:var(--torqe-blue-dark);
  --rasoi-turquoise-50:  var(--torqe-blue-50);
  --rasoi-white:         #FFFFFF;
  --rasoi-bg:            #F4F5F7;
  --rasoi-text:          var(--torqe-charcoal);
  --rasoi-muted:         #6B7280;
  --rasoi-border:        #E2E5EA;

  /* Bootstrap variable overrides */
  --bs-primary:           var(--torqe-yellow);
  --bs-primary-rgb:       255, 217, 61;
  --bs-link-color:        var(--torqe-blue-dark);
  --bs-link-hover-color:  var(--torqe-blue);
}

/* Cross-browser baseline (in addition to Bootstrap Reboot) */
html, body {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: var(--rasoi-bg);
  color: var(--rasoi-text);
}

* { box-sizing: border-box; }

img, svg, video { max-width: 100%; height: auto; }

a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* Brand bits — TORQE Kitchen wordmark */
.rasoi-brand {
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--torqe-yellow);
}
.rasoi-brand .dot { color: var(--torqe-blue); }

/* Compact topbar brand: icon + "TORQÉ" + "KITCHEN" subtitle */
.tk-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 900; letter-spacing: 1px;
  color: var(--torqe-yellow);
  line-height: 1;
}
.tk-brand .tk-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--torqe-yellow);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--torqe-charcoal); font-size: 18px;
  box-shadow: 0 0 0 2px rgba(255,217,61,0.25);
}
.tk-brand .tk-text { display: inline-flex; flex-direction: column; }
.tk-brand .tk-text strong { font-size: 1.05rem; }
.tk-brand .tk-text small {
  font-size: 0.55rem; letter-spacing: 3px; opacity: 0.85;
  margin-top: 1px; color: var(--torqe-white);
}

/* Buttons */
.btn-rasoi-primary {
  background: var(--torqe-yellow);
  border-color: var(--torqe-yellow);
  color: var(--torqe-charcoal);
  font-weight: 600;
}
.btn-rasoi-primary:hover, .btn-rasoi-primary:focus {
  background: var(--torqe-yellow-dark);
  border-color: var(--torqe-yellow-dark);
  color: var(--torqe-charcoal);
}
.btn-rasoi-secondary {
  background: var(--rasoi-turquoise);
  border-color: var(--rasoi-turquoise);
  color: #fff;
}
.btn-rasoi-secondary:hover, .btn-rasoi-secondary:focus {
  background: var(--rasoi-turquoise-dark);
  border-color: var(--rasoi-turquoise-dark);
  color: #fff;
}
.btn-outline-rasoi {
  border-color: var(--torqe-blue-dark);
  color: var(--torqe-blue-dark);
  background: #fff;
}
.btn-outline-rasoi:hover {
  background: var(--torqe-blue);
  color: #fff;
  border-color: var(--torqe-blue);
}

/* Inputs — touch-friendly height on mobile */
.form-control, .form-select {
  min-height: 44px;
  border-color: var(--rasoi-border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--torqe-blue);
  box-shadow: 0 0 0 0.2rem rgba(29, 184, 255, 0.22);
}

/* Login screen */
.rasoi-login-bg {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(29,184,255,0.25), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255,217,61,0.22), transparent 60%),
    var(--torqe-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rasoi-login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 420px;
  padding: 32px 28px;
}
.rasoi-login-card h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
  color: var(--torqe-charcoal);
  font-weight: 700;
}
.rasoi-login-card .subtitle {
  color: var(--rasoi-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* App shell */
.rasoi-shell { min-height: 100vh; display: flex; flex-direction: column; }
.rasoi-topbar {
  background: var(--torqe-charcoal);
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.rasoi-topbar .brand {
  color: var(--torqe-yellow); font-weight: 900;
  font-size: 1.05rem; letter-spacing: 1px;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.rasoi-topbar .brand .dot {
  display: inline-block; width: 24px; height: 24px; border-radius: 50%;
  background: var(--torqe-yellow); margin-right: 6px;
  vertical-align: middle;
}
.rasoi-topbar .brand small {
  color: #fff; font-weight: 700; font-size: 0.55rem;
  letter-spacing: 2.5px; opacity: 0.85;
}
.rasoi-topbar .btn-link {
  color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 6px;
}
.rasoi-topbar .btn-link:hover { background: rgba(255,255,255,0.12); }

.rasoi-body { display: flex; flex: 1; min-height: 0; }
.rasoi-sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--rasoi-border);
  padding: 16px 0;
  flex-shrink: 0;
}
.rasoi-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  color: var(--rasoi-text);
  border-left: 3px solid transparent;
}
.rasoi-nav-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--rasoi-muted);
  padding: 12px 18px 4px;
}
.rasoi-sidebar a:hover { background: var(--torqe-yellow-50); text-decoration: none; }
.rasoi-sidebar a.active {
  background: var(--torqe-yellow-50);
  border-left-color: var(--torqe-yellow);
  color: var(--torqe-charcoal);
  font-weight: 700;
}
.rasoi-sidebar i { width: 20px; text-align: center; }
.rasoi-content { flex: 1; padding: 24px; min-width: 0; }

/* Cards */
.rasoi-card {
  background: #fff;
  border: 1px solid var(--rasoi-border);
  border-radius: 12px;
  padding: 20px;
}
.rasoi-card .label { color: var(--rasoi-muted); font-size: 0.85rem; }
.rasoi-card .value { font-size: 1.6rem; font-weight: 700; color: var(--rasoi-text); }

/* Tables */
.table thead th {
  background: var(--rasoi-crimson-50);
  color: var(--rasoi-crimson);
  border-bottom: 2px solid var(--rasoi-crimson);
}
.badge-role-Admin    { background: var(--rasoi-crimson); color: #fff; }
.badge-role-Manager  { background: #6f42c1; color: #fff; }
.badge-role-Cashier  { background: var(--rasoi-turquoise); color: #fff; }
.badge-role-Waiter   { background: #f59e0b; color: #fff; }
.badge-role-Kitchen  { background: #374151; color: #fff; }

/* ===== Mobile breakpoints =====
   Approach: sidebar collapses into an off-canvas drawer below 992px,
   form/cards reflow. Bootstrap grid handles most of it. */

@media (max-width: 991.98px) {
  .rasoi-sidebar {
    position: fixed; top: 52px; bottom: 0; left: -260px;
    width: 260px; transition: left .25s ease;
    z-index: 1040;
  }
  .rasoi-sidebar.show { left: 0; box-shadow: 4px 0 16px rgba(0,0,0,0.15); }
  .rasoi-sidebar-backdrop {
    display: none; position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); z-index: 1035;
  }
  .rasoi-sidebar.show + .rasoi-sidebar-backdrop { display: block; }
  .rasoi-content { padding: 16px; }
  .rasoi-toggle-sidebar { display: inline-flex !important; }
}
@media (min-width: 992px) {
  .rasoi-toggle-sidebar { display: none !important; }
}
@media (max-width: 575.98px) {
  .rasoi-login-card { padding: 24px 18px; }
  .rasoi-card .value { font-size: 1.3rem; }
  h1, .h1 { font-size: 1.4rem; }
  h2, .h2 { font-size: 1.2rem; }
}

/* ===== Module 9.1: Inventory ===== */
.inv-hub-tiles {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 14px;
}
.inv-tile {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px; padding: 14px;
}
.inv-tile .lbl { color: var(--rasoi-muted); font-size: 0.78rem; text-transform: uppercase; }
.inv-tile .val { font-weight: 800; font-size: 1.6rem; }
.inv-tile.warn { border-left: 5px solid #F59E0B; }
.inv-tile.danger { border-left: 5px solid #DC2626; }
.inv-tile.ok { border-left: 5px solid #16A085; }

.stock-bar {
  height: 6px; border-radius: 3px; background: var(--rasoi-bg);
  position: relative; overflow: hidden; margin-top: 4px;
}
.stock-bar > div {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--rasoi-turquoise);
}
.stock-bar.low > div { background: #F59E0B; }
.stock-bar.out > div { background: #DC2626; }

.recipe-row { display: grid; gap: 6px; margin-bottom: 6px; align-items: center; grid-template-columns: 2fr 1fr 1fr auto; }
@media (max-width: 575.98px) {
  .recipe-row { grid-template-columns: 1fr 1fr; }
}

/* ===== Module 14: Data Import ===== */
.import-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.import-card {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.import-card .ico {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--rasoi-crimson-50); color: var(--rasoi-crimson);
  font-size: 1.4rem;
}
.import-card h2 { font-size: 1rem; margin: 0; }
.import-card p { color: var(--rasoi-muted); font-size: 0.85rem; margin: 0; }
.import-card .actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

.preview-summary {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 10px; background: #fff;
  border: 1px solid var(--rasoi-border); border-radius: 10px;
  margin-bottom: 12px;
}
.preview-summary .pill {
  padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  background: var(--rasoi-bg);
}
.preview-summary .pill.create { background: #d1fae5; color: #065f46; }
.preview-summary .pill.update { background: #fef3c7; color: #92400e; }
.preview-summary .pill.error  { background: #fee2e2; color: #991b1b; }

.preview-table { width: 100%; font-size: 0.85rem; }
.preview-table tr.row-create { background: #ecfdf5; }
.preview-table tr.row-update { background: #fffbeb; }
.preview-table tr.row-error  { background: #fef2f2; }
.preview-table td { padding: 4px 8px; border-bottom: 1px solid var(--rasoi-border); }
.preview-table .badge { font-size: 0.7rem; padding: 1px 6px; border-radius: 999px; font-weight: 600; }
.preview-table .badge.create { background: #16A085; color: #fff; }
.preview-table .badge.update { background: #F59E0B; color: #fff; }
.preview-table .badge.error  { background: #DC2626; color: #fff; }
.preview-table .err-list { color: #991b1b; font-size: 0.78rem; }

/* ===== Module 2: Dashboard ===== */
.dash-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
}
.dash-greeting { font-size: 1.4rem; font-weight: 700; color: var(--rasoi-text); }
.dash-greeting .name { color: var(--rasoi-crimson); }
.dash-date { color: var(--rasoi-muted); font-size: 0.9rem; }

.dash-alerts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.dash-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: #fff; border: 1px solid var(--rasoi-border);
  border-left: 6px solid var(--c, var(--rasoi-muted));
}
.dash-alert.lvl-danger  { --c: #DC2626; background: #FEE2E2; }
.dash-alert.lvl-warning { --c: #F59E0B; background: #FEF3C7; }
.dash-alert.lvl-info    { --c: #3B82F6; background: #DBEAFE; }
.dash-alert .msg { flex: 1; font-weight: 500; }
.dash-alert .btn { white-space: nowrap; }

.hero-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 14px;
}
.hero-tile {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px; padding: 14px 16px;
}
.hero-tile .lbl { color: var(--rasoi-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; }
.hero-tile .val { font-weight: 800; font-size: 1.8rem; line-height: 1.2; color: var(--rasoi-text); }
.hero-tile .delta { font-size: 0.78rem; font-weight: 600; }
.hero-tile .delta.up   { color: #16A085; }
.hero-tile .delta.down { color: #DC2626; }
.hero-tile .delta.flat { color: var(--rasoi-muted); }

.status-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 14px;
}
.status-tile {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: var(--rasoi-text);
  transition: box-shadow .12s;
}
.status-tile:hover { box-shadow: 0 6px 16px rgba(0,0,0,.06); text-decoration: none; color: var(--rasoi-text); }
.status-tile h3 { font-size: 0.95rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.status-tile .big { font-size: 1.6rem; font-weight: 800; }
.status-tile .sub { color: var(--rasoi-muted); font-size: 0.85rem; }
.status-tile.danger  { border-left: 5px solid #DC2626; }
.status-tile.warning { border-left: 5px solid #F59E0B; }
.status-tile.ok      { border-left: 5px solid #16A085; }
.status-tile.muted   { border-left: 5px solid var(--rasoi-border); }

.tables-bar {
  display: flex; height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--rasoi-bg); border: 1px solid var(--rasoi-border); margin-top: 6px;
}
.tables-bar > div { height: 100%; }

.mix-bar {
  display: flex; height: 18px; border-radius: 999px; overflow: hidden;
  background: var(--rasoi-bg); border: 1px solid var(--rasoi-border);
}
.mix-bar > div {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.72rem; font-weight: 700; min-width: 0;
}
.mix-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 0.85rem; }
.mix-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

.top-items { display: flex; flex-direction: column; gap: 6px; }
.top-item {
  display: grid; grid-template-columns: 1fr auto; gap: 6px;
  padding: 6px 0; border-bottom: 1px dashed var(--rasoi-border);
}
.top-item:last-child { border-bottom: 0; }
.top-item .name { font-weight: 600; }
.top-item .meta { color: var(--rasoi-muted); font-size: 0.78rem; }
.top-item .bar {
  grid-column: 1 / -1; height: 6px; border-radius: 4px;
  background: linear-gradient(to right, var(--rasoi-crimson), var(--rasoi-turquoise));
  width: var(--w, 0%);
}

.trend-chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 110px; padding: 4px 0;
}
.trend-chart .bar {
  flex: 1; background: var(--rasoi-turquoise);
  border-radius: 3px 3px 0 0; position: relative;
  transition: height .25s ease;
}
.trend-chart .bar.today { background: var(--rasoi-crimson); }
.trend-chart .bar:hover .tip { display: block; }
.trend-chart .bar .tip {
  display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: #111; color: #fff; padding: 2px 6px;
  border-radius: 4px; font-size: 0.7rem; margin-bottom: 4px;
}
.trend-axis {
  display: flex; justify-content: space-between; color: var(--rasoi-muted); font-size: 0.7rem; padding-top: 2px;
}

@media (max-width: 575.98px) {
  .hero-tile .val { font-size: 1.4rem; }
}

/* ===== Module 8: Cash & Books ===== */
.cash-tile {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.cash-tile .lbl { color: var(--rasoi-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.4px; }
.cash-tile .val { font-weight: 700; font-size: 1.5rem; }
.cash-tile.pos .val { color: #16A085; }
.cash-tile.neg .val { color: #DC2626; }
.cash-tile.warn .val { color: #F59E0B; }
.cash-flow-row {
  display: grid; grid-template-columns: 1fr auto;
  padding: 8px 0; border-bottom: 1px solid var(--rasoi-border);
}
.cash-flow-row:last-child { border-bottom: 0; }
.cash-flow-row .v { font-weight: 600; }
.expense-cat-pill {
  padding: 2px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 600;
  color: #fff; display: inline-block;
}
.outstanding-strip {
  display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 0;
}
.outstanding-card {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 10px; padding: 12px 14px; min-width: 200px;
  border-left: 4px solid var(--c, var(--rasoi-crimson));
}
.outstanding-card .name { font-weight: 600; font-size: 0.9rem; }
.outstanding-card .amount { font-weight: 700; font-size: 1.4rem; }
.outstanding-card .age { color: var(--rasoi-muted); font-size: 0.8rem; }

/* Print: clean cash sheet */
@media print {
  .cs-actions { display: none !important; }
  .cs-print-only { display: block !important; }
}

/* ===== Module 7: Bill / Invoice ===== */
.bill-page {
  max-width: 720px;
  margin: 0 auto;
}
.bill-paper {
  background: #fff;
  border: 1px solid var(--rasoi-border);
  border-radius: 12px;
  padding: 24px;
  font-family: ui-monospace, SFMono-Regular, "Menlo", "Consolas", "Liberation Mono", monospace;
}
.bill-paper.layout-thermal {
  max-width: 320px;        /* ~80mm width on screen */
  margin: 0 auto;
  font-size: 0.85rem;
  padding: 14px 16px;
}
.bill-paper.layout-a4 {
  max-width: 720px;
  margin: 0 auto;
  font-size: 0.95rem;
}
.bill-paper h1, .bill-paper h2 { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
.bill-paper .restname { font-weight: 800; font-size: 1.1rem; text-align: center; }
.bill-paper .restaddr { text-align: center; font-size: 0.78rem; color: #444; }
.bill-paper .divider { border-top: 1px dashed #999; margin: 8px 0; }
.bill-paper .billnum { display: flex; justify-content: space-between; }
.bill-paper table.lines { width: 100%; border-collapse: collapse; }
.bill-paper table.lines td { padding: 2px 0; vertical-align: top; }
.bill-paper table.lines td.qty { width: 32px; text-align: right; padding-right: 6px; }
.bill-paper table.lines td.r   { text-align: right; }
.bill-paper .totals { width: 100%; margin-top: 6px; }
.bill-paper .totals td { padding: 1px 0; }
.bill-paper .totals td.r { text-align: right; }
.bill-paper .grand   { font-weight: 800; font-size: 1.1rem; }
.bill-paper .footer  { text-align: center; font-size: 0.78rem; margin-top: 10px; }
.bill-paper .modline { font-size: 0.78rem; color: #555; }

.bill-actions {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.payment-row {
  display: grid; gap: 8px; align-items: end;
  grid-template-columns: 130px 1fr 1fr 1fr auto;
}
.payment-row .btn { white-space: nowrap; }
@media (max-width: 575.98px) {
  .payment-row { grid-template-columns: 1fr 1fr; }
  .payment-row .btn { grid-column: 1 / -1; }
}
.paid-strip {
  background: var(--rasoi-bg);
  border: 1px solid var(--rasoi-border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.paid-strip strong { color: var(--rasoi-crimson); }

/* Print stylesheet — clean output for thermal or A4 */
@media print {
  body { background: #fff; }
  .rasoi-topbar, .bill-actions, .bill-toolbar, .rasoi-shell .rasoi-content > *:not(#billRoot),
  #billActions, .no-print { display: none !important; }
  .rasoi-shell, .rasoi-content { padding: 0; margin: 0; }
  .bill-paper { border: 0; box-shadow: none; padding: 0; max-width: none; margin: 0; }
  .bill-paper.layout-thermal { width: 80mm; }
  @page { margin: 6mm; }
}

/* ===== Module 6: KDS ===== */
.kds-shell.dark {
  --rasoi-bg: #0F1419;
  --rasoi-text: #E5E7EB;
  --rasoi-muted: #94A3B8;
  --rasoi-border: #374151;
  background: #0F1419;
  color: #E5E7EB;
}
.kds-shell.dark .rasoi-card,
.kds-shell.dark .kds-card {
  background: #1F2937;
  color: #E5E7EB;
}
.kds-shell.dark .kds-toolbar {
  background: #1F2937;
}
.kds-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: #fff;
  border: 1px solid var(--rasoi-border); border-radius: 12px;
  margin-bottom: 12px;
}
.kds-toolbar .area-select {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.kds-toolbar .area-pill {
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--rasoi-border); background: transparent;
  font-size: 0.9rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.kds-toolbar .area-pill.active {
  background: var(--p-color, var(--rasoi-crimson));
  color: #fff; border-color: var(--p-color, var(--rasoi-crimson));
}
.kds-toolbar .area-pill .count {
  background: rgba(255,255,255,0.25); padding: 0 6px; border-radius: 8px; font-size: 0.78rem;
}
.kds-toolbar .area-pill:not(.active) .count {
  background: var(--rasoi-crimson-50); color: var(--rasoi-crimson);
}

.kds-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.kds-card {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  border-left: 8px solid #16A085;
  transition: border-color .3s;
}
.kds-card.age-yellow { border-left-color: #F59E0B; }
.kds-card.age-red    { border-left-color: #DC2626; animation: kds-pulse 1.4s infinite; }
@keyframes kds-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}
.kds-card .head {
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--rasoi-border);
}
.kds-card .kot-num {
  font-size: 1.2rem; font-weight: 800; color: var(--rasoi-crimson);
  letter-spacing: 0.5px;
}
.kds-shell.dark .kds-card .kot-num { color: #F472B6; }
.kds-card .timer {
  margin-left: auto; font-weight: 800; font-size: 1.4rem;
  color: #16A085;
}
.kds-card.age-yellow .timer { color: #D97706; }
.kds-card.age-red .timer { color: #DC2626; }
.kds-card .meta {
  font-size: 0.85rem; color: var(--rasoi-muted);
  padding: 6px 14px 10px;
}
.kds-card .items {
  list-style: none; padding: 0; margin: 0;
}
.kds-card .items li {
  padding: 8px 14px; border-bottom: 1px dashed var(--rasoi-border);
  display: flex; align-items: flex-start; gap: 8px;
}
.kds-card .items li:last-child { border-bottom: 0; }
.kds-card .items .qty {
  font-weight: 700; min-width: 28px; text-align: right;
}
.kds-card .items .name {
  flex: 1; font-size: 1rem;
}
.kds-card .items .modline { font-size: 0.8rem; color: var(--rasoi-muted); }
.kds-card .items li.done .name { text-decoration: line-through; color: var(--rasoi-muted); }
.kds-card .items .check {
  width: 24px; height: 24px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 2px solid var(--rasoi-border); background: transparent;
}
.kds-card .items li.done .check { background: #16A085; border-color: #16A085; color: #fff; }
.kds-card .foot {
  padding: 10px 14px; border-top: 1px solid var(--rasoi-border);
}
.kds-card .foot .btn { width: 100%; font-weight: 700; }
.kds-recent {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 8px 4px; margin-top: 14px;
}
.kds-recent .recent {
  flex: 0 0 auto; background: #F3F4F6;
  border: 1px solid var(--rasoi-border); border-radius: 10px;
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 4px; min-width: 200px;
}
.kds-shell.dark .kds-recent .recent { background: #1F2937; }
.kds-recent .recent .num { font-weight: 700; }
.kds-empty {
  text-align: center; padding: 60px 20px; color: var(--rasoi-muted);
  border: 1px dashed var(--rasoi-border); border-radius: 14px;
}
.kds-empty i { font-size: 3rem; }

/* ===== Module 5: POS / Orders ===== */
.pos-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.pos-tabs .pos-tab {
  flex: 1; padding: 12px 16px; border-radius: 10px;
  background: #fff; border: 1px solid var(--rasoi-border);
  cursor: pointer; text-align: center; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pos-tabs .pos-tab.active {
  background: var(--rasoi-crimson); color: #fff; border-color: var(--rasoi-crimson);
}
.pos-tabs .pos-tab i { font-size: 1.1rem; }

/* Order detail layout */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}
.pos-cart {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px;
  position: sticky; top: 64px;
  max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
}
.pos-cart-header { padding: 12px 14px; border-bottom: 1px solid var(--rasoi-border); }
.pos-cart-body   { padding: 4px 4px; flex: 1; overflow-y: auto; }
.pos-cart-footer { padding: 12px 14px; border-top: 1px solid var(--rasoi-border); }
.cart-line {
  padding: 10px 12px; border-bottom: 1px solid var(--rasoi-border);
}
.cart-line.cancelled { opacity: 0.5; text-decoration: line-through; }
.cart-line .name { font-weight: 600; }
.cart-line .meta { font-size: 0.78rem; color: var(--rasoi-muted); }
.cart-line .pricerow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cart-line .qty {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--rasoi-border); border-radius: 6px;
  background: #fff; overflow: hidden;
}
.cart-line .qty button { border: 0; background: transparent; padding: 2px 8px; cursor: pointer; }
.cart-line .line-total { margin-left: auto; font-weight: 700; }
.cart-line .badge-st { font-size: 0.7rem; padding: 1px 6px; border-radius: 999px; }
.cart-line .st-New     { background: #FCE4E8; color: #9F1239; }
.cart-line .st-Sent    { background: #FEF3C7; color: #92400E; }
.cart-line .st-Ready   { background: #DBEAFE; color: #1E40AF; }
.cart-line .st-Served  { background: #D1FAE5; color: #065F46; }
.cart-line .st-Cancelled { background: #F3F4F6; color: #374151; }
.fire-btn { width: 100%; }

.totals-grid { display: grid; grid-template-columns: 1fr auto; row-gap: 4px; }
.totals-grid .lbl { color: var(--rasoi-muted); }
.totals-grid .v   { text-align: right; font-weight: 600; }
.totals-grid .total .v { color: var(--rasoi-crimson); font-size: 1.1rem; }

@media (max-width: 991.98px) {
  .pos-layout { grid-template-columns: 1fr; }
  .pos-cart {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    border-radius: 14px 14px 0 0;
    max-height: 60vh;
    z-index: 1030;
    transform: translateY(calc(100% - 56px));
    transition: transform .25s;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  }
  .pos-cart.open { transform: translateY(0); }
  .pos-cart-handle {
    padding: 12px; cursor: pointer; text-align: center; font-weight: 600;
    border-bottom: 1px solid var(--rasoi-border);
  }
}
@media (min-width: 992px) {
  .pos-cart-handle { display: none; }
}

.order-card {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: var(--rasoi-text);
  transition: box-shadow .12s;
}
.order-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); text-decoration: none; }
.order-card .num   { font-weight: 700; font-size: 1.2rem; color: var(--rasoi-crimson); }
.order-card .total { font-weight: 700; }
.order-card .meta  { color: var(--rasoi-muted); font-size: 0.85rem; }

/* ===== Module 4: Tables ===== */
.tbl-status-Available     { --c: #16A085; --bg: #D1FAE5; --fg: #065F46; }
.tbl-status-Occupied      { --c: #DC143C; --bg: #FEE2E2; --fg: #991B1B; }
.tbl-status-Reserved      { --c: #F59E0B; --bg: #FEF3C7; --fg: #92400E; }
.tbl-status-Cleaning      { --c: #3B82F6; --bg: #DBEAFE; --fg: #1E40AF; }
.tbl-status-OutOfService  { --c: #6B7280; --bg: #F3F4F6; --fg: #374151; }

.tbl-counters {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 16px;
}
.tbl-counter {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 10px; padding: 10px 14px; min-width: 110px;
  display: flex; flex-direction: column;
}
.tbl-counter .num { font-weight: 700; font-size: 1.4rem; color: var(--rasoi-text); }
.tbl-counter .lbl { font-size: 0.78rem; color: var(--rasoi-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.tbl-counter.is-Available .num { color: #16A085; }
.tbl-counter.is-Occupied  .num { color: #DC143C; }
.tbl-counter.is-Reserved  .num { color: #F59E0B; }

.status-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.status-chips .chip {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--rasoi-border); background: #fff;
  cursor: pointer; font-size: 0.85rem; user-select: none;
}
.status-chips .chip.active {
  background: var(--rasoi-crimson); color: #fff; border-color: var(--rasoi-crimson);
}

.tbl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.tbl-card {
  background: #fff; border: 1px solid var(--rasoi-border);
  border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
  border-left: 5px solid var(--c, var(--rasoi-border));
  min-height: 130px;
}
.tbl-card:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.tbl-card .name {
  font-size: 1.4rem; font-weight: 700; line-height: 1.1;
}
.tbl-card .seats {
  color: var(--rasoi-muted); font-size: 0.85rem;
}
.tbl-card .status-pill {
  align-self: flex-start; background: var(--bg); color: var(--fg);
  padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.tbl-card .since { color: var(--rasoi-muted); font-size: 0.8rem; margin-top: auto; }
.tbl-card .section-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; color: var(--rasoi-muted);
}
.tbl-card .section-tag::before {
  content: ''; width: 8px; height: 8px; border-radius: 2px;
  background: var(--section-c, #ccc); display: inline-block;
}
.tbl-card .notes {
  font-size: 0.78rem; color: var(--rasoi-muted); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Capacity sizing — bigger cap = bigger card */
.tbl-card.cap-2 { grid-column: span 1; }
.tbl-card.cap-4 { grid-column: span 1; }
.tbl-card.cap-6 { grid-column: span 2; }
.tbl-card.cap-8 { grid-column: span 2; }
.tbl-card.cap-10 { grid-column: span 3; }
@media (max-width: 575.98px) {
  .tbl-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tbl-card.cap-6, .tbl-card.cap-8, .tbl-card.cap-10 { grid-column: span 2; }
}

/* Section tabs reuse menu-cat-tabs */

/* ===== Module 3.5: Areas + Settings ===== */
.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  line-height: 1.4;
}
.area-swatch {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1px solid var(--rasoi-border);
  vertical-align: -3px;
  margin-right: 4px;
}
.settings-tile {
  display: flex; flex-direction: column; gap: 6px;
  background: #fff;
  border: 1px solid var(--rasoi-border);
  border-radius: 12px;
  padding: 18px;
  height: 100%;
  text-decoration: none;
  color: var(--rasoi-text);
  transition: box-shadow .15s, transform .15s;
}
.settings-tile:hover {
  text-decoration: none;
  color: var(--rasoi-text);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.settings-tile .ico {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--rasoi-crimson-50);
  color: var(--rasoi-crimson);
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.settings-tile.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.settings-tile h2 { font-size: 1rem; margin: 0; font-weight: 600; }
.settings-tile p  { color: var(--rasoi-muted); font-size: 0.85rem; margin: 0; }

/* ===== Module 3: Menu ===== */
.menu-cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scrollbar-width: thin;
}
.menu-cat-tabs::-webkit-scrollbar { height: 4px; }
.menu-cat-tabs .chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--rasoi-border);
  background: #fff;
  color: var(--rasoi-text);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.menu-cat-tabs .chip.active {
  background: var(--rasoi-crimson);
  color: #fff;
  border-color: var(--rasoi-crimson);
}
.menu-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.item-card {
  background: #fff;
  border: 1px solid var(--rasoi-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow .15s ease;
}
.item-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.item-card .img-wrap {
  width: 100%; aspect-ratio: 16 / 10; background: var(--rasoi-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--rasoi-muted); overflow: hidden;
}
.item-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.item-card .body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.item-card .title { font-weight: 600; line-height: 1.25; }
.item-card .desc  { color: var(--rasoi-muted); font-size: 0.85rem;
                    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-card .price { font-weight: 700; color: var(--rasoi-crimson); }
.item-card .meta  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.8rem; color: var(--rasoi-muted); }
.item-card .actions { display: flex; gap: 6px; padding: 8px 14px; border-top: 1px solid var(--rasoi-border); }
.item-card.unavailable { opacity: 0.55; }

/* Veg / Non-Veg / Egg dot */
.type-dot {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #5f5f5f; border-radius: 3px; position: relative;
  flex-shrink: 0;
}
.type-dot::after {
  content: ''; position: absolute; inset: 2px;
  border-radius: 50%;
}
.type-dot.veg      { border-color: #2e7d32; }
.type-dot.veg::after      { background: #2e7d32; }
.type-dot.non-veg  { border-color: #b71c1c; }
.type-dot.non-veg::after  { background: #b71c1c; }
.type-dot.egg      { border-color: #ef6c00; }
.type-dot.egg::after      { background: #ef6c00; }

.gst-badge {
  background: var(--rasoi-turquoise-50);
  color: var(--rasoi-turquoise-dark);
  border: 1px solid var(--rasoi-turquoise);
  padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
}

.avail-badge.on  { background: #d1fae5; color: #065f46; }
.avail-badge.off { background: #fee2e2; color: #991b1b; }
.avail-badge { padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }

/* Variants editor inside modal */
.variant-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.variant-row input { flex: 1; }
.variant-row .btn { flex-shrink: 0; }

/* Mobile tweaks */
@media (max-width: 575.98px) {
  .item-card .img-wrap { aspect-ratio: 16/9; }
}

/* Utility */
.rasoi-divider {
  height: 1px; background: var(--rasoi-border); margin: 16px 0;
}
.rasoi-empty {
  text-align: center; color: var(--rasoi-muted); padding: 40px 16px;
}
.rasoi-error {
  color: #b91c1c; background: #fee2e2; border: 1px solid #fecaca;
  padding: 10px 12px; border-radius: 8px; font-size: 0.92rem;
}
.rasoi-success {
  color: #065f46; background: #d1fae5; border: 1px solid #a7f3d0;
  padding: 10px 12px; border-radius: 8px; font-size: 0.92rem;
}

/* ------------------------------------------------------------------ */
/* Staff / HR (Module 11)                                              */
/* ------------------------------------------------------------------ */
.emp-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  flex: 0 0 34px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--rasoi-border); color: var(--rasoi-text);
  font-size: 0.78rem; font-weight: 700; overflow: hidden;
}
.emp-avatar-ph { background: var(--torqe-blue-50); color: var(--torqe-blue-dark); }
.emp-name-cell {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
}
.emp-name-cell:hover strong { color: var(--torqe-blue-dark); text-decoration: underline; }

/* Profile header */
.emp-profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.emp-profile-photo {
  width: 84px; height: 84px; border-radius: 14px; object-fit: cover;
  background: var(--torqe-blue-50); color: var(--torqe-blue-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; overflow: hidden; flex: 0 0 84px;
}
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 24px; }
.kv-grid .kv-label { color: var(--rasoi-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .02em; }
.kv-grid .kv-val { font-weight: 600; }

/* Org chart — indented reporting tree */
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 18px; border-left: 2px solid var(--rasoi-border); padding-left: 16px; }
.org-tree li { margin: 8px 0; position: relative; }
.org-node {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: #fff; border: 1px solid var(--rasoi-border); border-radius: 10px;
  padding: 8px 12px; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: border-color .15s, box-shadow .15s;
}
.org-node:hover { border-color: var(--torqe-blue); box-shadow: 0 2px 8px rgba(29,184,255,.18); }
.org-node .on-name { font-weight: 700; line-height: 1.1; }
.org-node .on-sub  { font-size: 0.78rem; color: var(--rasoi-muted); }
.org-node.is-director { border-left: 4px solid var(--torqe-yellow-dark); }
