:root {
  --bg: #fff8ef;
  --panel: #ffffff;
  --text: #241a15;
  --muted: #7d6c61;
  --line: #efdccc;
  --brand: #ff2d2d;
  --brand-strong: #1f5f16;
  --leaf: #2d7b1f;
  --leaf-soft: #edf8e9;
  --cream: #fff4df;
  --danger: #b42318;
  --warn: #b86b00;
  --shadow: 0 16px 38px rgba(100, 42, 17, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(45, 123, 31, .08), transparent 28rem),
    linear-gradient(180deg, #fffaf1 0%, var(--bg) 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #fff 0%, #fff6e7 100%);
  color: #fff;
  padding: 18px 14px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 30px rgba(96, 50, 20, .06);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.brand {
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
  margin: 4px 8px 18px;
  letter-spacing: 0;
}
.sidebar-brand-logo {
  display: flex;
  align-items: center;
  width: 210px;
  min-height: 86px;
  margin: 0 0 18px;
  padding: 0;
}
.sidebar-brand-logo img {
  width: 206px;
  height: 84px;
  object-fit: contain;
  object-position: left center;
}
.mobile-menu-toggle {
  display: none;
}
.brand::after {
  content: "THE HOME MADE FOOD";
  display: block;
  color: var(--leaf);
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 4px;
}
.side-nav { display: grid; gap: 8px; }
.sidebar a,
.nav-group summary {
  padding: 11px 12px;
  border-radius: 6px;
  color: #49352b;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
}
.nav-group {
  border: 1px solid #f1d8bf;
  border-radius: 8px;
  background: rgba(255,255,255,.55);
  overflow: hidden;
}
.nav-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--leaf);
  background: #fff8ec;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after {
  content: "▾";
  color: var(--brand);
}
.nav-group:not([open]) summary::after { content: "▸"; }
.nav-group a {
  display: block;
  margin: 4px 6px;
  padding: 9px 10px;
  font-size: 14px;
}
.nav-direct { display: block; background: #fff; }
.sidebar a:hover,
.nav-group summary:hover {
  background: #fff;
  color: var(--brand);
  border-color: #ffd0c9;
  box-shadow: 0 8px 18px rgba(255, 45, 45, .08);
}
.sidebar a.active {
  background: #fff;
  color: var(--brand);
  border-color: #ffc7bf;
  box-shadow: inset 4px 0 0 var(--brand), 0 8px 18px rgba(255, 45, 45, .08);
}
.nav-group:has(a.active) {
  background: #fffdf8;
  border-color: #ffd6bd;
}
.nav-group:has(a.active) summary {
  background: #fff1dc;
  color: var(--leaf);
}
.main-panel { flex: 1; min-width: 0; }
.topbar {
  min-height: 74px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 26px;
  box-shadow: 0 8px 26px rgba(92, 47, 20, .05);
}
.topbar h1 { margin: 0; font-size: 25px; color: var(--brand); font-weight: 900; }
.topbar span { color: var(--leaf); font-size: 13px; font-weight: 800; }
.page-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-logo {
  width: 82px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}
.page-title-wrap > div {
  min-width: 0;
}
.back-button {
  background: #fff3e5;
  color: var(--leaf);
  border: 1px solid #efd2b7;
  box-shadow: none;
  padding: 9px 12px;
  min-height: 38px;
}
.topbar-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.clock-widget {
  display: grid;
  gap: 2px;
  text-align: right;
  background: #fff8ec;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  color: var(--leaf);
}
.clock-widget strong { color: var(--brand); font-size: 16px; }
.clock-widget span { color: var(--muted); font-size: 12px; }
.user-pill { display: flex; gap: 12px; align-items: center; color: var(--muted); }
.user-pill a { color: var(--brand); font-weight: 700; }
.item-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 36px;
  border: 1px solid #ffd0c9;
  border-radius: 999px;
  background: #fff2f0;
  color: var(--brand);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}
.notification-widget {
  position: relative;
}
.notification-bell {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  padding: 0;
  background: #fff8ec;
  border: 1px solid var(--line);
  color: var(--brand);
  box-shadow: none;
  display: inline-grid;
  place-items: center;
}
.notification-bell .bell-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: var(--brand);
}
.notification-bell svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notification-bell strong {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--leaf);
  color: #fff;
  font-size: 11px;
}
.notification-bell:not(.has-unread) strong {
  display: none;
}
.voice-widget {
  position: relative;
}
.voice-mic-button {
  width: 54px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff7ec;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: none;
}
.voice-mic-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.voice-mic-button[aria-expanded="true"],
.voice-mic-button:hover {
  background: var(--leaf-soft);
  border-color: #c9e7c1;
}
.voice-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 225;
  width: min(390px, calc(100vw - 24px));
  max-height: 76vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(70, 46, 24, .18);
  overflow: hidden;
}
.voice-panel[hidden] {
  display: none;
}
.voice-head,
.voice-recorder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.voice-head {
  background: #fff4df;
  color: var(--leaf);
  font-weight: 900;
}
.voice-head span,
.voice-recorder small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.voice-recorder {
  align-items: stretch;
  flex-wrap: wrap;
  background: #fff6e7;
}
.voice-recorder .btn {
  min-height: 40px;
}
.voice-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow: auto;
}
.voice-card,
.voice-reply {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.voice-meta,
.voice-reply > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.voice-meta small,
.voice-reply small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.voice-card audio,
.voice-reply audio {
  width: 100%;
  height: 34px;
}
.voice-replies {
  display: grid;
  gap: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--leaf-soft);
}
.voice-reply {
  background: #fbfff7;
}
.notification-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, 92vw);
  max-height: 430px;
  overflow: hidden;
  z-index: 220;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(70, 46, 24, .18);
}
.notification-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #fff4df;
  color: var(--leaf);
  font-weight: 900;
}
.notification-head > div:first-child {
  display: grid;
  gap: 3px;
}
.notification-head span {
  color: var(--muted);
  font-size: 12px;
}
.notification-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.notification-mark-all,
.notification-close,
.notification-read-btn,
.notification-link,
.notification-read-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #d9efcf;
  border-radius: 7px;
  background: var(--leaf-soft);
  color: var(--leaf);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: none;
}
.notification-close {
  border-color: #ffd0c9;
  background: #fff2f0;
  color: var(--brand);
}
.notification-list {
  max-height: 370px;
  overflow-y: auto;
}
.notification-item,
.notification-empty {
  display: block;
  padding: 11px 14px;
  border-top: 1px solid #f1deca;
}
.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.notification-item.is-read {
  opacity: .72;
}
.notification-actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.notification-read-label {
  background: #fffaf4;
  color: var(--muted);
  border-color: var(--line);
}
.notification-item strong {
  display: block;
  color: #2d2018;
  font-size: 14px;
}
.notification-item small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.notification-item.info { border-left: 4px solid #3b82f6; }
.notification-item.success { border-left: 4px solid var(--leaf); }
.notification-item.warning { border-left: 4px solid #ff9f1a; }
.notification-item.danger { border-left: 4px solid var(--brand); }
.notification-empty {
  color: var(--muted);
  text-align: center;
}
.notification-bell.notify-pulse {
  animation: notifyPulse 1.2s ease-in-out 2;
}
.item-alert.is-hidden {
  display: none;
}
.item-alert.notify-pulse {
  animation: notifyPulse 1.2s ease-in-out 2;
}
.item-alert strong {
  color: inherit;
}
@keyframes notifyPulse {
  0%, 100% { transform: scale(1); box-shadow: none; }
  45% { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(255,45,45,.12); }
}
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.filter-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #f1d8bf;
  border-radius: 8px;
  background: #fffaf4;
  color: var(--leaf);
  font-weight: 900;
}
.filter-tabs a.active {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 45, 45, .1);
}
.item-alert span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}
.stock-alert {
  border-color: #f3d087;
  background: #fff7df;
  color: #8a5a00;
}
.stock-alert span {
  background: #8a5a00;
}
.alert-card {
  border-top-color: #d89500;
}
.responsive-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.mini-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffaf4;
}
.danger-soft {
  border-color: #f2b7a8;
  background: #fff3ef;
}
.mini-card span {
  font-weight: 900;
  color: var(--brand);
}
.form-spacer {
  min-height: 1px;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.permission-grid label,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffaf4;
  font-weight: 800;
}
.permission-grid input,
.check-row input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--leaf);
}
.content { padding: 24px 26px; }
.grid { display: grid; gap: 16px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  min-width: 0;
}
.dashboard-card-grid > .card {
  border-top: 4px solid var(--brand);
}
.dashboard-card-grid > .card:nth-child(2n) { border-top-color: var(--leaf); }
.dashboard-card-grid > .card:nth-child(3n) { border-top-color: #ff8b26; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card h2, .card h3 { margin-top: 0; color: #321e15; }
.content > .card:first-child,
.content > form.card:first-child,
.content > .grid:first-child > .card {
  border-top: 4px solid var(--brand);
}
.content > .grid:first-child .card:nth-child(2n) { border-top-color: var(--leaf); }
.content > .grid:first-child .card:nth-child(3n) { border-top-color: #ff8b26; }
.stat { font-size: 31px; font-weight: 900; color: var(--brand); }
.dashboard-card-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}
.muted { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar > * { min-width: 0; }
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.toolbar-actions select {
  min-width: 150px;
  width: auto;
}
.compact-filter {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.compact-filter input {
  min-height: 42px;
}
.compact-filters {
  margin-top: 16px;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}
.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 14px 0 16px;
}
.filter-bar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.filter-bar input,
.filter-bar select {
  min-height: 40px;
}
.btn, button {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(255, 45, 45, .16);
}
.btn.secondary, button.secondary { background: var(--leaf); }
.btn.danger, button.danger { background: var(--danger); }
.btn.light, button.light { background: var(--leaf-soft); color: var(--brand-strong); box-shadow: none; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: #fffdfa;
  min-height: 42px;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(45, 123, 31, .14);
  border-color: var(--leaf);
}
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 800; }
form.stack, .stack { display: grid; gap: 12px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  color: var(--leaf);
  font-size: 13px;
  background: #fff1dc;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}
td { word-break: break-word; }
td a {
  color: var(--brand);
  font-weight: 900;
}
td input,
td select,
td textarea {
  min-width: 110px;
  background: #fffdfa;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.table-wrap table {
  min-width: 760px;
}
.card:has(table) {
  overflow-x: auto;
  scrollbar-color: #e8c9ac #fff6e7;
}
.card:has(table) > table {
  min-width: 760px;
}
.card:has(table) h2 {
  position: sticky;
  left: 0;
}
.data-table { min-width: 760px; table-layout: auto; }
.data-table th, .data-table td { word-break: normal; overflow-wrap: anywhere; }
.content table:not(.data-table):not(.bills-table):not(.verification-table):not(.online-orders-table):not(.salary-table):not(.dashboard-sales-table) {
  width: 100%;
  min-width: 640px;
}
.content .card > table:not(.data-table):not(.bills-table):not(.verification-table):not(.online-orders-table):not(.salary-table):not(.dashboard-sales-table) {
  margin-top: 8px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 120px;
}
.actions .inline-form {
  display: inline-flex;
  margin: 0;
}
.actions a {
  color: var(--brand);
  font-weight: 900;
  white-space: nowrap;
}
.salary-table th,
.salary-table td {
  white-space: normal;
  vertical-align: middle;
}
.salary-table td[data-label="Net"] strong {
  color: var(--brand);
  font-size: 16px;
}
.salary-table .actions {
  min-width: 0;
  flex-wrap: nowrap;
}
.payroll-summary {
  margin-bottom: 16px;
}
.salary-edit-card {
  max-width: 960px;
}
.salary-edit-card .full {
  grid-column: 1 / -1;
}
.salary-live-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #ffd0c9;
  background: #fff3ef;
  border-radius: 8px;
  padding: 14px 16px;
  font-weight: 900;
}
.salary-live-total strong {
  color: var(--brand);
  font-size: 24px;
}
.bills-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 330px);
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  scrollbar-gutter: stable both-edges;
}
.bills-table {
  min-width: 1285px;
  table-layout: fixed;
  font-size: 13px;
}
.bills-table th,
.bills-table td {
  word-break: normal;
  overflow-wrap: normal;
  line-height: 1.15;
  padding: 6px 7px;
  vertical-align: middle;
}
.bills-table th {
  font-size: 12px;
}
.bills-table th:nth-child(1), .bills-table td:nth-child(1) { width: 112px; }
.bills-table th:nth-child(2), .bills-table td:nth-child(2) { width: 92px; }
.bills-table th:nth-child(3), .bills-table td:nth-child(3) { width: 82px; }
.bills-table th:nth-child(4), .bills-table td:nth-child(4) { width: 100px; }
.bills-table th:nth-child(5), .bills-table td:nth-child(5) { width: 145px; }
.bills-table th:nth-child(6), .bills-table td:nth-child(6) { width: 68px; }
.bills-table th:nth-child(7), .bills-table td:nth-child(7) { width: 128px; }
.bills-table th:nth-child(8), .bills-table td:nth-child(8) { width: 85px; }
.bills-table th:nth-child(9), .bills-table td:nth-child(9) { width: 95px; }
.bills-table th:nth-child(10), .bills-table td:nth-child(10) { width: 145px; }
.bills-table th:nth-child(11), .bills-table td:nth-child(11) { width: 118px; }
.bills-table th:nth-child(12), .bills-table td:nth-child(12) { width: 115px; }
.bills-table td:nth-child(2) strong,
.bills-table td:nth-child(8) strong {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.bills-table .actions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
}
.bills-table .actions .btn {
  padding: 5px 6px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  font-size: 12px;
  line-height: 1.15;
}
.bills-table td[data-label="Receipt"] .actions {
  grid-template-columns: 1fr;
}
.bill-save-confirmation {
  flex: 1 0 100%;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #a8d99d;
  border-left: 4px solid #24851f;
  border-radius: 6px;
  background: #effbea;
  color: #145f14;
}
.bill-save-confirmation strong {
  font-size: 14px;
}
.bill-save-confirmation span {
  font-size: 12px;
  color: #39723a;
}
.bill-save-status {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}
.bill-save-status.saving {
  border: 1px solid #e2b93b;
  background: #fff8d8;
  color: #725200;
}
.bill-save-status.success {
  border: 1px solid #a8d99d;
  background: #eaf8e5;
  color: #146b16;
}
.bill-save-status.error {
  border: 1px solid #f0aaa4;
  background: #fff0ee;
  color: #a61f18;
}
.bills-table th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.bills-table th:last-child,
.bills-table td:last-child {
  position: static;
  box-shadow: none;
}

.purchase-history-wrap {
  margin-top: 10px;
}
.purchase-history-table {
  min-width: 1180px;
  table-layout: auto;
}
.purchase-history-table th,
.purchase-history-table td {
  vertical-align: middle;
  white-space: normal;
}
.purchase-history-table .status-pill {
  display: inline-flex;
  min-width: 92px;
  justify-content: center;
  white-space: nowrap;
}
.purchase-history-table .actions {
  min-width: 210px;
  align-items: center;
}
.purchase-history-table .actions .btn {
  white-space: nowrap;
}
.bill-total-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.bill-total-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
  display: grid;
  gap: 5px;
  min-width: 0;
}
.bill-total-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.bill-total-chip strong {
  color: var(--brand);
  font-size: 18px;
  overflow-wrap: anywhere;
}
.verification-summary {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-top: 0;
  margin-bottom: 14px;
}
.compact-total-strip {
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  margin-top: 0;
  min-width: min(100%, 340px);
}
.section-subtitle {
  margin: 18px 0 10px;
  color: var(--leaf);
  font-size: 18px;
}
.report-tile.aggregator {
  background: linear-gradient(180deg, #fffdf8 0%, #fff4df 100%);
  border-color: #f0cfac;
}
.report-tile.dine {
  background: linear-gradient(180deg, #fffdf8 0%, #f2fbef 100%);
  border-color: #cfe8c4;
}
.report-tile.takeaway {
  background: linear-gradient(180deg, #fffdf8 0%, #fff0df 100%);
  border-color: #f2c797;
}
.dashboard-eye-btn {
  margin-top: 10px;
  width: fit-content;
}
.responsive-table {
  overflow-x: auto;
  scrollbar-gutter: stable;
}
.kot-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.kot-badge {
  display: inline-grid;
  gap: 1px;
  border: 1px solid #d7edcf;
  border-radius: 8px;
  background: #f5fbf2;
  color: var(--leaf);
  padding: 5px 7px;
}
.kot-badge strong {
  white-space: nowrap;
  font-size: 12px;
}
.kot-badge small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.draft-row td {
  background: #fffaf2;
}
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #e9eef5; font-size: 12px; }
.badge.ok { background: #e7f6ee; color: #087443; }
.badge.warn { background: #fff3e6; color: var(--warn); }
.badge.danger { background: #ffe8e6; color: var(--danger); }
.alert { padding: 10px 12px; border-radius: 6px; background: #e7f6ee; color: #087443; margin-bottom: 12px; }
.alert.warning { background: #fff7df; color: #8a5a00; border: 1px solid #f3d087; }
.alert.danger { background: #fff2f0; color: var(--danger); border: 1px solid #ffd0c9; }
.brand-logo { max-width: 220px; height: auto; display: block; }
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, #fff 0%, #fff1dc 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.dashboard-hero h2 { margin: 0; font-size: 30px; color: var(--brand); }
.dashboard-hero p { margin: 6px 0 0; color: var(--leaf); font-weight: 800; }
.chart-bars { display: grid; gap: 10px; margin-top: 10px; }
.chart-row { display: grid; grid-template-columns: 130px minmax(120px, 1fr) 110px; gap: 10px; align-items: center; }
.chart-row span,
.chart-row strong {
  min-width: 0;
}
.chart-row strong {
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-chart .chart-row {
  grid-template-columns: 90px minmax(80px, 1fr) 110px;
}
.bar-track { height: 15px; background: #ffead0; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #ff8b26); border-radius: 999px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.shortcut-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.shortcut-actions .btn {
  width: auto;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}
.sales-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.report-tile {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  padding: 14px;
}
.report-tile span {
  color: var(--leaf);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.report-tile strong {
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}
.report-tile small {
  color: var(--muted);
  font-weight: 800;
}
.dashboard-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.dashboard-calendar-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  min-width: min(100%, 560px);
}
.dashboard-calendar-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.dashboard-sales-matrix {
  margin-top: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dashboard-sales-table {
  min-width: 760px;
}
.dashboard-sales-table th,
.dashboard-sales-table td {
  vertical-align: middle;
}
.sales-cell-link {
  display: grid;
  gap: 3px;
  min-height: 46px;
  color: inherit;
}
.sales-cell-link strong {
  color: var(--brand);
  font-size: 17px;
}
.sales-cell-link small {
  color: var(--muted);
  font-weight: 800;
}
.calendar-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
}
.calendar-day-tile {
  display: grid;
  gap: 4px;
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  padding: 12px;
  color: var(--text);
}
.calendar-day-tile.has-sales {
  border-color: #cdebc5;
  background: #f4fbf1;
}
.calendar-day-tile span,
.calendar-day-tile small {
  color: var(--muted);
  font-weight: 800;
}
.calendar-day-tile strong {
  color: var(--leaf);
  font-size: 18px;
}
.calendar-day-tile b {
  color: var(--brand);
  font-size: 16px;
}
.detail-report-table td {
  vertical-align: top;
}
.custom-report-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}
.custom-report-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.empty-state {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  padding: 18px;
}
.module-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.module-card strong { color: var(--brand); }
.module-card span { color: var(--muted); font-size: 13px; }
.module-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.module-link {
  display: grid;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.module-link strong { color: var(--brand); }
.module-link span { color: var(--muted); font-size: 13px; }
.empty-state {
  border: 1px dashed #e7c8ad;
  background: #fffaf2;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
}
.admin-split {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.content form.card button:last-child,
.content .stack > button:last-child {
  justify-self: start;
}
.content > form.card.toolbar:first-child,
.content > .card.toolbar:first-child {
  border-top-color: var(--leaf);
  background: linear-gradient(135deg, #fff 0%, #fffaf2 100%);
}
.content .grid .card {
  align-self: start;
}
.content .grid .card h2 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.content .grid .card h2::after {
  content: "";
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--leaf));
}
.content .card:has(.stat) {
  background: linear-gradient(135deg, #fff 0%, #fff8ec 100%);
}
.content .card:has(.stat) .muted {
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}
.content .card:has(.stat) .stat {
  line-height: 1.1;
}
.content form.card,
.content .card:has(form) {
  background: linear-gradient(180deg, #fff 0%, #fffdf8 100%);
}
.content select,
.content input,
.content textarea {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.content input[type="date"],
.content input[type="time"],
.content input[type="month"],
.content input[type="number"] {
  color: #241a15;
  font-weight: 800;
}
.content table tr:hover td {
  background: #fffaf2;
}
.content .card + .card,
.content form + .card,
.content .grid + .card {
  margin-top: 16px;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendar-day { min-height: 82px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; display: grid; align-content: space-between; }
.calendar-day span { color: var(--muted); font-size: 13px; }
.purchase-line,
.content form .grid {
  min-width: 0;
}
.purchase-line {
  border: 1px solid #f1d8bf;
  border-radius: 8px;
  background: #fffaf2;
  padding: 10px;
}
.content .card > .btn,
.content .card > a.btn {
  width: fit-content;
}
.content form.card.toolbar label {
  flex: 1 1 180px;
}
.content form.card.toolbar button,
.content form.card.toolbar .btn {
  flex: 0 0 auto;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
}
.filters-grid label {
  min-width: 0;
}
.filters-grid .btn,
.filters-grid button {
  min-height: 42px;
  width: 100%;
}
.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.toolbar label,
.toolbar .compact-filter {
  min-width: 0;
}
.toolbar input,
.toolbar select,
.toolbar textarea {
  max-width: 100%;
}
.action-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.online-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.online-summary-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 14px;
  min-width: 0;
}
.online-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.online-summary-card strong {
  color: var(--brand);
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.online-orders-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.online-orders-table {
  min-width: 980px;
}
.online-orders-table th,
.online-orders-table td {
  overflow-wrap: normal;
  word-break: normal;
}
.online-orders-table th:nth-child(1), .online-orders-table td:nth-child(1) { width: 128px; }
.online-orders-table th:nth-child(2), .online-orders-table td:nth-child(2) { width: 94px; }
.online-orders-table th:nth-child(3), .online-orders-table td:nth-child(3) { width: 120px; }
.online-orders-table th:nth-child(5), .online-orders-table td:nth-child(5) { width: 82px; }
.online-orders-table th:nth-child(6), .online-orders-table td:nth-child(6) { width: 95px; }
.online-orders-table th:nth-child(7), .online-orders-table td:nth-child(7) { width: 85px; }
.online-orders-table th:nth-child(9), .online-orders-table td:nth-child(9) { width: 210px; }
.online-orders-table td:nth-child(6),
.online-orders-table td:nth-child(7) {
  white-space: nowrap;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 28px;
  border-radius: 999px;
  background: var(--leaf-soft);
  color: var(--leaf);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-pill.status-pending {
  background: #fff0e2;
  border: 1px solid #ffb16f;
  color: #b04d00;
}
.status-pill.status-partial {
  background: #fff8d8;
  border: 1px solid #e5c94b;
  color: #806000;
}
.status-pill.status-paid {
  background: #e7f8e3;
  border: 1px solid #b8dfae;
  color: #1f7a1f;
}
.settle-btn {
  background: #1f7a1f;
  color: #fff;
}
.select-filter {
  margin-bottom: 8px;
}
.staff-profile-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.staff-profile-cell > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.staff-photo-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff8ec;
}
.staff-photo-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-weight: 900;
}
.doc-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.doc-link-list a,
.doc-mini-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid #ccecc5;
  background: var(--leaf-soft);
  color: var(--leaf);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}
.doc-mini-link {
  margin-top: 6px;
}
.btn.small {
  padding: 8px 11px;
  min-height: 36px;
  font-size: 13px;
}
.danger-mini {
  width: auto !important;
  padding: 0 10px !important;
  background: var(--danger) !important;
  color: #fff !important;
}
.sent-edit {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.module-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.module-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 6px;
  background: var(--leaf-soft);
  color: var(--brand-strong);
  font-weight: 900;
  text-decoration: none;
}
.module-tabs a.active,
.module-tabs a:hover {
  background: var(--brand);
  color: #fff;
}
.soft-card {
  margin-bottom: 18px;
  background: #fffdf8;
}
.verification-table {
  width: 100%;
  min-width: 1060px;
  table-layout: fixed;
}
.verification-table th,
.verification-table td {
  line-height: 1.25;
  vertical-align: middle;
  overflow-wrap: normal;
  word-break: normal;
}
.verification-table th:nth-child(1), .verification-table td:nth-child(1) { width: 72px; }
.verification-table th:nth-child(2), .verification-table td:nth-child(2) { width: 132px; }
.verification-table th:nth-child(3), .verification-table td:nth-child(3) { width: 118px; }
.verification-table th:nth-child(4), .verification-table td:nth-child(4) { width: 102px; }
.verification-table th:nth-child(5), .verification-table td:nth-child(5) { width: 108px; }
.verification-table th:nth-child(6), .verification-table td:nth-child(6),
.verification-table th:nth-child(7), .verification-table td:nth-child(7),
.verification-table th:nth-child(8), .verification-table td:nth-child(8) { width: 102px; }
.verification-table th:nth-child(9), .verification-table td:nth-child(9) { width: 78px; }
.verification-table th:nth-child(10), .verification-table td:nth-child(10) { width: 126px; }
.verification-table td:nth-child(1),
.verification-table td:nth-child(3),
.verification-table td:nth-child(5),
.verification-table td:nth-child(6),
.verification-table td:nth-child(7),
.verification-table td:nth-child(8),
.verification-table td:nth-child(10) {
  white-space: nowrap;
}
.verification-table .btn {
  padding: 8px 10px;
  min-height: 38px;
}
.verification-table td[data-label="Action"] .btn {
  display: inline-flex;
  justify-content: center;
  min-width: 112px;
  white-space: nowrap;
}
.kitchen-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.kitchen-toolbar-actions button.is-on {
  background: #eaf7e6;
  border-color: #cdebc5;
  color: var(--leaf);
}
.kitchen-toolbar-actions button.is-off {
  background: #fff2ee;
  border-color: #ffd2c9;
  color: var(--brand);
}
.login-page { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar {
    width: auto;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 80;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
    padding: 10px 12px;
  }
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    box-shadow: none;
    background: var(--leaf-soft);
    color: var(--leaf);
  }
  .side-nav {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sidebar.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 89;
    background: rgba(36, 26, 21, .24);
  }
  .sidebar.menu-open .side-nav {
    display: grid;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    z-index: 90;
    margin: 0;
    padding: 72px 12px 16px;
    overflow-y: auto;
    background: linear-gradient(180deg, #fff 0%, #fff6e7 100%);
    border-right: 1px solid var(--line);
    box-shadow: 16px 0 40px rgba(36, 26, 21, .18);
  }
  .sidebar.menu-open .brand-row {
    position: relative;
    z-index: 91;
  }
  .nav-direct, .nav-group { min-width: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dashboard-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4, .sales-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-section-head { display: grid; }
  .dashboard-calendar-form { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
  .custom-report-form,
  .custom-report-filter { grid-template-columns: 1fr; }
  .chart-row,
  .compact-chart .chart-row {
    grid-template-columns: 84px minmax(80px, 1fr) 94px;
    gap: 8px;
  }
  .chart-row strong {
    font-size: 13px;
  }
  .form-grid { grid-template-columns: 1fr; }
  .admin-split { grid-template-columns: 1fr; }
  .module-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-hero { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; gap: 10px; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .notification-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 92vw);
    max-height: none;
    border-radius: 0;
    transform: translateX(105%);
    transition: transform .22s ease;
    z-index: 120;
  }
  .notification-panel.is-open {
    transform: translateX(0);
  }
  .voice-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 92vw);
    max-height: none;
    border-radius: 0;
    transform: translateX(105%);
    transition: transform .22s ease;
    z-index: 121;
  }
  .voice-panel.is-open {
    transform: translateX(0);
  }
  .notification-list {
    max-height: calc(100vh - 62px);
  }
  .clock-widget { text-align: left; }
  .content { padding: 16px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .btn,
  .toolbar button {
    width: 100%;
    text-align: center;
  }
  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .toolbar-actions select,
  .toolbar-actions .btn,
  .toolbar-actions button {
    width: 100%;
  }
  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }
  .quick-actions .btn { width: 100%; text-align: center; }
  .shortcut-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .shortcut-actions .btn {
    width: 100%;
    text-align: center;
  }
}
@media (max-width: 760px) {
  body {
    background: #fff8ef;
    padding-bottom: 74px;
  }
  .compact-filters {
    grid-template-columns: 1fr;
  }
  .compact-filters .btn,
  .compact-filters button {
    width: 100%;
  }
  .kitchen-toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .kitchen-toolbar-actions .btn,
  .kitchen-toolbar-actions button {
    width: 100%;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    max-height: none;
    overflow: visible;
    padding: 8px 10px;
    box-shadow: 0 8px 22px rgba(92, 47, 20, .08);
  }
  .brand-row {
    align-items: center;
  }
  .brand {
    margin: 0;
    font-size: 18px;
  }
  .sidebar-brand-logo {
    width: 150px;
    min-height: 54px;
    margin: 0;
  }
  .sidebar-brand-logo img {
    width: 148px;
    height: 52px;
  }
  .brand::after {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    box-shadow: none;
    background: var(--leaf-soft);
    color: var(--leaf);
  }
  .side-nav {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
    max-height: none;
    overflow-y: auto;
  }
  .sidebar.menu-open .side-nav {
    display: grid;
  }
  .nav-direct,
  .nav-group {
    min-width: 0;
  }
  .sidebar a,
  .nav-group summary {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }
  .nav-group a {
    font-size: 12px;
    padding: 8px;
    margin: 3px 5px;
  }
  .topbar {
    min-height: auto;
    padding: 8px 10px;
    gap: 6px;
  }
  .page-title-wrap {
    width: 100%;
    align-items: flex-start;
  }
  .topbar-logo {
    width: 58px;
    height: 32px;
  }
  .back-button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
  }
  .topbar h1 {
    font-size: 20px;
    line-height: 1.05;
  }
  .topbar span {
    font-size: 11px;
  }
  .topbar-actions {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 6px;
    width: 100%;
    align-items: center;
  }
  .notification-widget {
    order: -1;
  }
  .notification-item {
    grid-template-columns: 1fr;
  }
  .notification-actions-row {
    justify-content: flex-start;
  }
  .clock-widget {
    padding: 6px 8px;
    text-align: left;
  }
  .item-alert {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }
  .clock-widget strong {
    font-size: 13px;
  }
  .clock-widget span {
    font-size: 11px;
  }
  .user-pill {
    justify-content: flex-end;
    gap: 8px;
    font-size: 12px;
  }
  .content {
    padding: 10px;
  }
  input,
  select,
  textarea,
  button,
  .btn {
    font-size: 16px;
  }
  .bills-wrap,
  .card:has(table) {
    overflow-x: visible;
    max-height: none;
    min-height: 0;
    resize: none;
    border: 0;
  }
  .card:has(> table:not(.data-table):not(.bills-table):not(.verification-table):not(.online-orders-table):not(.salary-table):not(.dashboard-sales-table)) {
    overflow-x: auto;
    border: 1px solid var(--line);
    scrollbar-gutter: stable;
  }
  .content table:not(.data-table):not(.bills-table):not(.verification-table):not(.online-orders-table):not(.salary-table):not(.dashboard-sales-table) {
    min-width: 620px;
  }
  .bill-total-strip,
  .verification-summary {
    grid-template-columns: 1fr 1fr;
  }
  .bills-table th:last-child,
  .bills-table td:last-child,
  .verification-table th:last-child,
  .verification-table td:last-child {
    position: static;
    box-shadow: none;
    background: transparent;
  }
  .bills-table,
  .verification-table,
  .salary-table,
  .bills-table tbody,
  .verification-table tbody,
  .salary-table tbody,
  .bills-table tr,
  .verification-table tr,
  .salary-table tr,
  .bills-table td,
  .verification-table td,
  .salary-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .salary-table {
    min-width: 0 !important;
    background: transparent;
    border-radius: 0;
  }
  .bills-table {
    background: transparent;
    border-radius: 0;
  }
  .verification-table {
    min-width: 0;
    background: transparent;
    border-radius: 0;
  }
  .bills-table tr:first-child,
  .verification-table tr:first-child,
  .salary-table tr:first-child {
    display: none;
  }
  .bills-table tr,
  .verification-table tr,
  .salary-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 12px;
    padding: 8px;
    box-shadow: 0 10px 22px rgba(100, 42, 17, .06);
  }
  .bills-table td,
  .verification-table td,
  .salary-table td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid #f2deca;
    padding: 9px 6px;
  }
  .bills-table td:last-child,
  .verification-table td:last-child,
  .salary-table td:last-child {
    border-bottom: 0;
  }
  .bills-table td::before,
  .verification-table td::before,
  .salary-table td::before {
    content: attr(data-label);
    color: var(--leaf);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }
  .bills-table .actions,
  .salary-table .actions {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .bills-table th,
  .verification-table th,
  .salary-table th,
  .bills-table td,
  .verification-table td,
  .salary-table td {
    width: auto !important;
    overflow-wrap: anywhere;
  }
  .bills-table td:nth-child(2) strong,
  .bills-table td:nth-child(8) strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .bills-table .actions .btn,
  .verification-table .btn,
  .salary-table .actions .btn {
    width: 100%;
    text-align: center;
  }
  .bills-table tr {
    display: grid;
    gap: 0;
    padding: 10px;
  }
  .verification-table tr {
    display: grid;
    gap: 0;
    padding: 10px;
  }
  .bills-table td {
    grid-template-columns: 94px minmax(0, 1fr);
    padding: 8px 4px;
  }
  .verification-table td {
    grid-template-columns: 104px minmax(0, 1fr);
    padding: 8px 4px;
  }
  .bills-table td[data-label="Action"],
  .bills-table td[data-label="Edit / Delete"],
  .bills-table td[data-label="Receipt"] {
    display: block;
    padding-top: 12px;
  }
  .bills-table td[data-label="Action"]::before,
  .bills-table td[data-label="Edit / Delete"]::before,
  .bills-table td[data-label="Receipt"]::before {
    display: block;
    margin-bottom: 8px;
  }
  .bills-table .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bills-table .actions .inline-form,
  .bills-table .actions button {
    width: 100%;
  }
  .bills-table .kot-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .bills-table .kot-badge {
    max-width: 100%;
  }
  .card {
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(100, 42, 17, .05);
  }
  .card h2 {
    font-size: 20px;
  }
  .toolbar {
    gap: 8px;
    margin-bottom: 10px;
  }
  .toolbar,
  form.toolbar {
    align-items: stretch;
  }
  .toolbar label,
  form.toolbar label {
    width: 100%;
  }
  .toolbar button,
  .toolbar .btn,
  form.toolbar button,
  form.toolbar .btn {
    width: 100%;
    text-align: center;
  }
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .grid {
    gap: 10px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .login-page {
    align-items: start;
    padding: 14px;
  }
  .login-card {
    max-width: 100%;
    padding: 18px;
  }
  .dashboard-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .dashboard-card-grid .card {
    padding: 12px;
  }
  .dashboard-card-grid .muted {
    font-size: 12px;
    line-height: 1.25;
  }
  .dashboard-card-grid .stat {
    font-size: 24px;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }
  .dashboard-hero {
    padding: 14px;
  }
  .dashboard-hero h2 {
    font-size: 24px;
  }
  .filters-grid {
    grid-template-columns: 1fr;
  }
  .online-summary-grid {
    grid-template-columns: 1fr;
  }
  .online-orders-table thead {
    display: none;
  }
  .online-orders-table,
  .online-orders-table tbody,
  .online-orders-table tr,
  .online-orders-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .online-orders-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 10px;
    padding: 8px;
  }
  .online-orders-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    border-bottom: 1px solid #f2deca;
    padding: 8px 4px;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .online-orders-table td:last-child {
    border-bottom: 0;
  }
  .online-orders-table td::before {
    content: attr(data-label);
    color: var(--leaf);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }
  .online-orders-table .action-cell {
    display: grid;
    grid-template-columns: 1fr;
  }
  .toolbar-actions,
  .action-cell {
    display: grid;
    grid-template-columns: 1fr;
  }
  .kitchen-toolbar-actions {
    grid-template-columns: 1fr;
  }
  .action-cell .btn,
  .toolbar-actions .btn {
    width: 100%;
    text-align: center;
  }
  .side-nav {
    display: none;
    grid-template-columns: 1fr;
  }
  .sidebar.menu-open .side-nav { display: grid; }
  .topbar-actions { display: grid; width: 100%; }
  .module-strip { grid-template-columns: 1fr; }
  .grid-4, .sales-report-grid { grid-template-columns: 1fr; }
  .dashboard-calendar-form {
    grid-template-columns: 1fr;
  }
  .dashboard-calendar-form .btn,
  .dashboard-calendar-form button {
    width: 100%;
    text-align: center;
  }
  .dashboard-sales-table {
    min-width: 0;
  }
  .calendar-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bills-table td {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    font-size: 14px;
  }
  .bills-table .actions {
    grid-template-columns: 1fr;
  }
  .bills-table .actions .btn,
  .bills-table .actions button {
    min-height: 42px;
  }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .data-table tr:first-child {
    display: none;
  }
  .online-orders-table tbody tr:first-child {
    display: block;
  }
  .data-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 10px;
    padding: 8px;
  }
  .data-table td {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 8px;
    border-bottom: 1px solid #f2deca;
    padding: 8px 4px;
    overflow-wrap: anywhere;
  }
  .data-table td:last-child {
    border-bottom: 0;
  }
  .data-table td::before {
    content: attr(data-label);
    color: var(--leaf);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }
  .data-table .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .topbar h1 { font-size: 21px; }
  .stat { font-size: 25px; }
  .card { padding: 11px; }
  .content { padding: 8px; }
  th, td { padding: 9px; font-size: 13px; }
  .data-table { min-width: 0; }
  .card:has(table) > table.data-table { min-width: 0; }
  .card:has(table) > table.bills-table,
  .bills-table {
    min-width: 0;
  }
  td input,
  td select,
  td textarea {
    min-width: 140px;
  }
}
@media (max-width: 420px) {
  .dashboard-card-grid {
    grid-template-columns: 1fr;
  }
  .bill-total-strip,
  .verification-summary {
    grid-template-columns: 1fr;
  }
  .calendar-report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-card .toolbar,
  .table-card .toolbar {
    align-items: stretch;
  }
  .page-card .toolbar .btn,
  .table-card .toolbar .btn {
    width: 100%;
    text-align: center;
  }
  .verification-table th,
  .verification-table td {
    width: auto !important;
  }
  .verification-table td {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .verification-table td[data-label="Bill No"] strong,
  .verification-table td[data-label="Bill Amount"] strong,
  .verification-table td[data-label="Received"],
  .verification-table td[data-label="Balance"] {
    white-space: nowrap;
  }
  .verification-table td[data-label="Action"] {
    display: block;
    padding-top: 12px;
  }
  .verification-table td[data-label="Action"]::before {
    display: block;
    margin-bottom: 8px;
  }
  .verification-table td[data-label="Action"] .btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }
}

.advance-order-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d8efcf;
  border-radius: 8px;
  background: #f4fbf1;
}
.advance-order-panel[hidden] {
  display: none;
}
.advance-order-panel h3 {
  margin: 0;
  color: var(--leaf);
  font-size: 16px;
}
.delivery-charge-panel,
.charge-option-panel {
  display: grid;
  gap: 10px;
}
.option-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-weight: 800;
}
.option-line input {
  width: auto;
}
.settlement-summary {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--leaf);
  font-weight: 800;
}
.toolbar-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.invoice-advance {
  color: var(--leaf);
}

@media (max-width: 760px) {
  .toolbar-filter {
    grid-template-columns: 1fr;
  }
  .toolbar-filter .btn,
  .toolbar-filter button {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15100d;
    --panel: #211916;
    --text: #fff4e8;
    --muted: #cdb9a8;
    --line: #463229;
    --brand: #ff4b4b;
    --brand-strong: #9af08e;
    --leaf: #7bd56c;
    --leaf-soft: #20351d;
    --cream: #2b2019;
    --danger: #ff6a5f;
    --warn: #ffb75c;
    --shadow: 0 16px 38px rgba(0, 0, 0, .32);
  }
  html {
    color-scheme: dark;
  }
  body {
    background:
      radial-gradient(circle at top left, rgba(123, 213, 108, .10), transparent 28rem),
      linear-gradient(180deg, #1b1410 0%, var(--bg) 100%);
    color: var(--text);
  }
  .sidebar,
  .sidebar.menu-open .side-nav {
    background: linear-gradient(180deg, #241b17 0%, #1a1410 100%);
    border-color: var(--line);
  }
  .topbar,
  .card,
  .login-card,
  .notification-panel,
  .voice-panel,
  .voice-card,
  .voice-reply,
  .selected-table-box,
  .billing-flow-card,
  .bill-meta,
  .invoice-preview,
  .menu-item,
  .cart-line,
  .customer-results,
  .combine-menu {
    background: var(--panel);
    border-color: var(--line);
    color: var(--text);
  }
  .card h2,
  .card h3 {
    color: var(--text);
  }
  .content > form.card.toolbar:first-child,
  .content > .card.toolbar:first-child,
  .content .card:has(.stat),
  .content form.card,
  .content .card:has(form) {
    background: linear-gradient(135deg, #241b17 0%, #1d1512 100%);
  }
  input,
  select,
  textarea,
  table,
  .data-table tr,
  .table-tile,
  .combine-row,
  .seat-checkbox-grid label,
  .split-payment-fields,
  .clock-widget,
  .notification-bell,
  .voice-mic-button {
    background: #1b1411;
    color: var(--text);
    border-color: var(--line);
  }
  input::placeholder,
  textarea::placeholder {
    color: #a99586;
  }
  th {
    background: #30231b;
    color: var(--leaf);
  }
  td {
    border-color: var(--line);
  }
  .nav-group {
    background: #1c1512;
    border-color: var(--line);
  }
  .nav-group summary {
    background: #2a1f18;
    color: var(--leaf);
  }
  .sidebar a,
  .nav-group a {
    color: #ead8c8;
  }
  .sidebar a.active,
  .sidebar a:hover,
  .nav-group summary:hover {
    background: #2b2019;
    color: var(--brand);
    border-color: #6b3931;
  }
  .btn.light,
  button.light,
  .advance-order-panel,
  .stock-line,
  .badge.ok {
    background: #20351d;
    color: var(--brand-strong);
  }
  .badge.warn {
    background: #3a2918;
    color: var(--warn);
  }
  .item-alert,
  .alert.danger {
    background: #351b19;
    border-color: #6b3931;
    color: var(--brand);
  }
  .alert.warning {
    background: #342516;
    border-color: #6f471b;
    color: var(--warn);
  }
  .invoice-line,
  .invoice-subtitle,
  .invoice-thanks,
  .muted {
    color: var(--muted);
  }
}

@media (prefers-color-scheme: dark) {
  .main-panel,
  .content {
    background: transparent;
  }

  .topbar {
    background: rgba(33, 25, 22, .96);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .25);
  }

  .back-button,
  .clock-widget,
  .item-alert,
  .notification-bell,
  .voice-mic-button {
    background: #261c17;
    border-color: var(--line);
  }

  .nav-direct,
  .nav-group:has(a.active),
  .nav-group:has(a.active) summary,
  .sidebar a.active,
  .sidebar a:hover,
  .nav-group summary:hover {
    background: #2a1f19;
  }

  .voice-head,
  .voice-recorder {
    background: #241b17;
    border-color: var(--line);
  }

  .voice-replies {
    border-left-color: #395a33;
  }

  .card,
  .login-card,
  .module-card,
  .module-link,
  .mini-card,
  .online-summary-card,
  .online-orders-wrap,
  .soft-card,
  .empty-state,
  .calendar-day-tile,
  .customer-result,
  .advance-order-panel,
  .menu-collapse-toggle,
  .menu-collapse-body {
    background: #211916;
    border-color: var(--line);
    color: var(--text);
  }

  .calendar-day-tile.has-sales,
  .module-tabs a,
  .menu-filter button.light,
  .btn.light,
  button.light,
  .badge.ok,
  .status-pill,
  .stock-line {
    background: #20351d;
    border-color: #395a33;
    color: var(--brand-strong);
  }
  .status-pill.status-pending {
    background: #3b2617;
    border-color: #8a5524;
    color: #ffb16f;
  }
  .status-pill.status-partial {
    background: #332d12;
    border-color: #77691e;
    color: #f3dc6a;
  }
  .status-pill.status-paid {
    background: #20351d;
    border-color: #395a33;
    color: #95e48d;
  }

  .module-tabs a.active,
  .module-tabs a:hover,
  .menu-filter button.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
  }

  input,
  select,
  textarea,
  td input,
  td select,
  td textarea {
    background: #18110f;
    border-color: #553d33;
    color: var(--text);
  }

  input:focus,
  select:focus,
  textarea:focus {
    outline-color: rgba(123, 213, 108, .22);
    border-color: var(--leaf);
  }

  input[type="date"]::-webkit-calendar-picker-indicator,
  input[type="time"]::-webkit-calendar-picker-indicator,
  input[type="month"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(.9);
  }

  table,
  .table-wrap,
  .responsive-table,
  .dashboard-sales-matrix,
  .card:has(table) {
    background: #211916;
    scrollbar-color: #63463a #18110f;
  }

  th,
  .bills-table th,
  .verification-table th,
  .online-orders-table th,
  .dashboard-sales-table th,
  .data-table th {
    background: #30231b;
    color: var(--leaf);
    border-color: var(--line);
  }

  td,
  .bills-table td,
  .verification-table td,
  .online-orders-table td,
  .dashboard-sales-table td,
  .data-table td {
    background: transparent;
    color: var(--text);
    border-color: var(--line);
  }

  tr:hover td,
  .content table tr:hover td {
    background: rgba(123, 213, 108, .06);
  }

  .bills-table tr,
  .verification-table tr,
  .salary-table tr,
  .online-orders-table tr,
  .data-table tr {
    background: #211916;
    border-color: var(--line);
  }

  .dashboard-card-grid > .card,
  .content .card:has(.stat),
  .report-tile,
  .bill-total-strip > div,
  .verification-summary > div {
    background: linear-gradient(135deg, #241b17 0%, #1d1512 100%);
    border-color: var(--line);
  }

  .table-tile {
    background: #1d1512;
    border-color: #553d33;
  }

  .table-tile.selected,
  .table-tile.occupied {
    background: #2c211a;
    border-color: var(--brand);
  }

  .seat-checkbox-grid label,
  .combine-row,
  .split-payment-fields,
  .customer-results,
  .combine-menu,
  .bill-meta,
  .selected-table-box,
  .billing-flow-card,
  .cart-line,
  .menu-item {
    background: #1d1512;
    border-color: #553d33;
    color: var(--text);
  }

  .invoice-preview {
    background: #fffdf8;
    border-color: #efdccc;
    color: #241a15;
  }

  .invoice-preview .muted,
  .invoice-preview .invoice-line,
  .invoice-preview .invoice-subtitle {
    color: #6d5b50;
  }

  .invoice-preview .invoice-thanks,
  .invoice-preview .invoice-advance {
    color: #1f5f16;
  }

  .notification-panel {
    box-shadow: 0 22px 50px rgba(0, 0, 0, .45);
  }

  .notification-head,
  .notification-item,
  .notification-empty {
    background: #211916;
    border-color: var(--line);
    color: var(--text);
  }

  .notification-item.is-read {
    background: #1a1310;
    color: var(--muted);
  }

  .alert.success {
    background: #173118;
    border-color: #3d7040;
    color: #9af08e;
  }

  .alert.info {
    background: #172637;
    border-color: #2d5f86;
    color: #9bd2ff;
  }

  .alert.warning,
  .badge.warn {
    background: #342516;
    border-color: #6f471b;
    color: var(--warn);
  }

  .alert.danger,
  .badge.danger,
  .item-alert {
    background: #351b19;
    border-color: #6b3931;
    color: var(--brand);
  }

  .sales-cell-link strong,
  .online-summary-card strong,
  .calendar-day-tile b,
  .dashboard-card-grid .stat,
  .stat {
    color: var(--brand);
  }

  .module-card span,
  .module-link span,
  .online-summary-card span,
  .calendar-day-tile span,
  .calendar-day-tile small,
  .sales-cell-link small,
  label,
  .compact-filter,
  .filter-bar label,
  .dashboard-calendar-form label {
    color: var(--muted);
  }

  .staff-photo-thumb,
  .staff-photo-empty {
    background: #2a1d18;
    border-color: var(--line);
  }

  .doc-link-list a,
  .doc-mini-link {
    background: #20351d;
    border-color: #395a33;
    color: #bdf0a9;
  }

  .receipt,
  .print-receipt,
  .salary-slip,
  .payslip {
    background: #fff;
    color: #111;
  }
}
.settle-btn {
  background: var(--green, #24851f);
  color: #fff;
  min-width: 132px;
  justify-content: center;
  text-align: center;
}

.select-search-input {
  border-color: #b7d8ad;
  background: #fbfff8;
}

.select-search-input:focus {
  border-color: var(--green, #24851f);
  box-shadow: 0 0 0 3px rgba(36, 133, 31, 0.12);
}

.searchable-select {
  max-width: 100%;
}

.status-pill.status-pending {
  background: #fff3bf;
  border: 1px solid #e2b93b;
  color: #725200;
}

.status-pill.status-completed {
  background: #e4f8df;
  border: 1px solid #a8d99d;
  color: #0a6b18;
}

a.btn.settle-btn,
.actions a.btn.settle-btn {
  display: inline-flex;
  background: #f5c542 !important;
  border: 1px solid #d7a812 !important;
  color: #3f2d00 !important;
  box-shadow: 0 7px 14px rgba(185, 132, 0, .18);
  min-width: 132px;
  justify-content: center;
  text-align: center;
  white-space: normal;
}

a.btn.settle-btn:hover,
.actions a.btn.settle-btn:hover {
  background: #eab72d !important;
  color: #2d2000 !important;
}

.expense-summary-completed {
  border-top: 3px solid #24851f;
}
.expense-summary-completed span,
.expense-summary-completed strong {
  color: #147311;
}
.expense-summary-pending {
  border-top: 3px solid #e2b93b;
}
.expense-summary-pending span,
.expense-summary-pending strong {
  color: #8a6500;
}

.call-widget {
  position: relative;
}

.call-button {
  min-width: 54px;
  height: 46px;
  border: 1px solid var(--border, #f1cdb8);
  background: #eef9e9;
  color: var(--green, #096c0c);
  border-radius: 8px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.call-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.call-button.is-ringing {
  animation: notifyPulse 1s ease-in-out infinite;
  background: #fff2f2;
  color: var(--red, #ff2e33);
}

.call-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  background: var(--card-bg, #fffdf8);
  border: 1px solid var(--border, #f1cdb8);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(58, 31, 19, 0.18);
  z-index: 80;
  overflow: hidden;
}

.call-panel.is-open {
  display: block;
}

.call-panel.has-incoming-call {
  border-color: var(--red, #ff2e33);
  box-shadow: 0 20px 52px rgba(255, 46, 51, 0.2);
}

.call-body {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.call-body label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.call-incoming {
  border: 1px solid #ffc3c3;
  background: #fff5f4;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.call-ringing-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 96px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ff2e33;
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0;
  animation: notifyPulse 1s ease-in-out infinite;
}

.call-incoming strong {
  color: var(--red, #ff2e33);
}

.call-incoming small {
  color: #7a6456;
  font-weight: 800;
}

.call-actions,
.call-incoming-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#callRemoteAudio {
  width: 100%;
  min-height: 36px;
}

@media (max-width: 720px) {
  .call-button span {
    display: none;
  }

  .call-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: 78vh;
    overflow-y: auto;
  }

  .settle-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-color-scheme: dark) {
  .call-button {
    background: #193316;
    border-color: #5a3b2a;
    color: #9cff86;
  }

  .call-panel {
    background: #1f1410;
    border-color: #5a3b2a;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  }

  .call-panel.has-incoming-call {
    border-color: #ff6b6b;
    box-shadow: 0 20px 52px rgba(255, 75, 75, 0.24);
  }

  .call-incoming {
    background: #321612;
    border-color: #793b31;
  }

  .status-pill.status-pending {
    background: #4b3b12;
    border-color: #b99124;
    color: #ffd86b;
  }

  .status-pill.status-completed {
    background: #123417;
    border-color: #347b3d;
    color: #92f29b;
  }

  .select-search-input {
    background: #1b1411;
    border-color: #5a3b2a;
    color: #fff7ed;
  }
}

.comm-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.comm-actions .notification-bell,
.comm-actions .voice-mic-button,
.comm-actions .call-button {
  width: 46px;
  min-width: 46px;
  height: 46px;
  border-radius: 8px;
  position: relative;
}

.comm-actions .voice-mic-button span,
.comm-actions .call-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.call-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #22831c;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  border: 2px solid #fff9f0;
}

.call-button.is-connected {
  background: #e8f8e5;
  color: #0a6b18;
  border-color: #aee1a7;
}

.call-button.is-calling {
  background: #fff5e4;
  color: #9a4d00;
  border-color: #ffd59a;
}

.voice-panel,
.call-panel,
.notification-panel {
  overscroll-behavior: contain;
}

@media (max-width: 900px) {
  .topbar-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  .comm-actions {
    justify-content: flex-start;
  }

  .clock-widget {
    justify-self: end;
    max-width: 100%;
  }

  .user-pill,
  .item-alert {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .comm-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .comm-actions .notification-bell,
  .comm-actions .voice-mic-button,
  .comm-actions .call-button {
    width: 100%;
    min-width: 0;
  }

  .comm-actions .notification-bell strong:not(.call-badge),
  .call-badge {
    top: -6px;
    right: 8px;
  }

  .clock-widget,
  .user-pill {
    justify-self: stretch;
  }

  .call-panel,
  .voice-panel,
  .notification-panel {
    width: 100vw;
    max-width: 100vw;
    left: 0;
    right: 0;
  }
}

.message-preview {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border, #efd7bf);
  border-radius: 8px;
  background: var(--surface-soft, #fff8ef);
  color: var(--text, #2b1b12);
  font: 600 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.message-history-cell {
  min-width: 260px;
  max-width: 520px;
  white-space: normal;
  line-height: 1.45;
}

.compact-table-wrap {
  max-height: 520px;
  overflow: auto;
}

@media (max-width: 760px) {
  .message-history-cell {
    min-width: 220px;
    max-width: 320px;
  }

  .message-preview {
    font-size: 13px;
    padding: 12px;
  }
}