:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-raised: color-mix(in srgb, var(--surface) 92%, #ffffff 8%);
  --surface-tint: color-mix(in srgb, var(--surface) 88%, var(--brand) 12%);
  --ink: #17211d;
  --muted: #65716b;
  --line: #dde5e4;
  --brand: #0e766e;
  --brand-dark: #0f4f49;
  --accent: #d97706;
  --warning: #b88717;
  --danger: #b64242;
  --ok: #25724d;
  --shadow: 0 18px 48px rgba(20, 32, 40, 0.08);
  --shadow-soft: 0 10px 28px rgba(20, 32, 40, 0.06);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand) 13%, transparent), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 84%, var(--bg)) 0, var(--bg) 42%),
    var(--bg);
  color: var(--ink);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101716;
  --surface: #17211f;
  --ink: #eef7f4;
  --muted: #9cb5ad;
  --line: #2c3b37;
  --brand: #2dd4bf;
  --brand-dark: #5eead4;
  --accent: #f59e0b;
  --warning: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

body[data-theme="coffee"] {
  --bg: #f7f2ea;
  --surface: #fffaf2;
  --ink: #2b211a;
  --muted: #77685a;
  --line: #eadbcc;
  --brand: #7c3f1d;
  --brand-dark: #4e2815;
  --accent: #0f766e;
  --warning: #a16207;
  --danger: #a43b2d;
  --ok: #3f7a42;
  --shadow: 0 18px 48px rgba(78, 40, 21, 0.12);
}

body[data-theme="contrast"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #050505;
  --muted: #303030;
  --line: #111111;
  --brand: #005fcc;
  --brand-dark: #003f88;
  --accent: #c2410c;
  --warning: #8a5a00;
  --danger: #b00020;
  --ok: #006b3f;
  --shadow: none;
}

body[data-theme="forest"] {
  --bg: #eef5ef;
  --surface: #ffffff;
  --ink: #17251b;
  --muted: #627466;
  --line: #d5e3d8;
  --brand: #287047;
  --brand-dark: #17492e;
  --accent: #b7791f;
  --warning: #a16207;
  --danger: #b4233a;
  --ok: #1f7a4d;
  --shadow: 0 18px 48px rgba(23, 73, 46, 0.12);
}

body[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0f1320;
  --surface: #171d2b;
  --ink: #f2f5fb;
  --muted: #a7b0c0;
  --line: #2b3448;
  --brand: #5b8def;
  --brand-dark: #91b4ff;
  --accent: #e6b450;
  --warning: #f7c948;
  --danger: #ff6b7a;
  --ok: #60d394;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

body[data-theme="olive"] {
  --bg: #f6f6ed;
  --surface: #fffff7;
  --ink: #242619;
  --muted: #70735b;
  --line: #e1e3cf;
  --brand: #6f7d25;
  --brand-dark: #424c17;
  --accent: #b85c38;
  --warning: #9a6a16;
  --danger: #a93d3d;
  --ok: #587b3a;
  --shadow: 0 18px 48px rgba(66, 76, 23, 0.12);
}

body[data-theme="rose"] {
  --bg: #fbf3f6;
  --surface: #ffffff;
  --ink: #2b1d25;
  --muted: #7b6570;
  --line: #eddbe3;
  --brand: #b8326b;
  --brand-dark: #7a1f45;
  --accent: #0f766e;
  --warning: #a16207;
  --danger: #a32142;
  --ok: #2f7a50;
  --shadow: 0 18px 48px rgba(122, 31, 69, 0.12);
}

body[data-theme="slate"] {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --ink: #172026;
  --muted: #60707a;
  --line: #d9e2e7;
  --brand: #28566f;
  --brand-dark: #17394c;
  --accent: #b7791f;
  --warning: #b7791f;
  --danger: #b33f4a;
  --ok: #2f7a57;
  --shadow: 0 18px 48px rgba(23, 57, 76, 0.12);
}

body[data-theme="copper"] {
  --bg: #f8f4ef;
  --surface: #fffdf9;
  --ink: #2a211b;
  --muted: #78685c;
  --line: #eaded2;
  --brand: #9a4f2f;
  --brand-dark: #5d2f1f;
  --accent: #24736a;
  --warning: #a16207;
  --danger: #a43b35;
  --ok: #477a3f;
  --shadow: 0 18px 48px rgba(93, 47, 31, 0.13);
}

body[data-theme="aqua"] {
  --bg: #eff8f8;
  --surface: #ffffff;
  --ink: #142424;
  --muted: #5d7474;
  --line: #d4e7e7;
  --brand: #127c89;
  --brand-dark: #0a4e59;
  --accent: #c47a1c;
  --warning: #a16207;
  --danger: #b64256;
  --ok: #28724f;
  --shadow: 0 18px 48px rgba(10, 78, 89, 0.12);
}

body[data-theme="plum"] {
  --bg: #f7f2f8;
  --surface: #ffffff;
  --ink: #281f2b;
  --muted: #73637a;
  --line: #e6d9ea;
  --brand: #744181;
  --brand-dark: #472552;
  --accent: #bf7b24;
  --warning: #a16207;
  --danger: #af3453;
  --ok: #34785a;
  --shadow: 0 18px 48px rgba(71, 37, 82, 0.14);
}

body[data-theme="graphite"] {
  color-scheme: dark;
  --bg: #111315;
  --surface: #1c2024;
  --ink: #f2f5f6;
  --muted: #a7b0b7;
  --line: #313940;
  --brand: #9fb7c7;
  --brand-dark: #d5e4ee;
  --accent: #e0a84e;
  --warning: #f1bf5b;
  --danger: #f06f75;
  --ok: #66c08e;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

body[data-theme="sunrise"] {
  --bg: #fff7ed;
  --surface: #ffffff;
  --ink: #281f1a;
  --muted: #78695f;
  --line: #eedfd3;
  --brand: #c24b2b;
  --brand-dark: #79301e;
  --accent: #0f766e;
  --warning: #a16207;
  --danger: #ac2f3d;
  --ok: #2f7a50;
  --shadow: 0 18px 48px rgba(121, 48, 30, 0.12);
}

body[data-theme="lagoon"] {
  --bg: #edf8fb;
  --surface: #ffffff;
  --ink: #152427;
  --muted: #5f757b;
  --line: #d4e8ed;
  --brand: #0b7c8f;
  --brand-dark: #064b5b;
  --accent: #c16a22;
  --warning: #a16207;
  --danger: #b43b54;
  --ok: #28724f;
  --shadow: 0 18px 48px rgba(6, 75, 91, 0.12);
}

body[data-theme="orchid"] {
  --bg: #f8f4fb;
  --surface: #ffffff;
  --ink: #251f2d;
  --muted: #6f637d;
  --line: #e5dceb;
  --brand: #6b4aa0;
  --brand-dark: #3e2c66;
  --accent: #c47a1c;
  --warning: #a16207;
  --danger: #b33658;
  --ok: #327a5b;
  --shadow: 0 18px 48px rgba(62, 44, 102, 0.13);
}

body[data-theme="steel"] {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --ink: #162026;
  --muted: #5d6f78;
  --line: #d8e2e8;
  --brand: #315f72;
  --brand-dark: #1c3f4f;
  --accent: #b7791f;
  --warning: #a16207;
  --danger: #ae3f4d;
  --ok: #2f7a57;
  --shadow: 0 18px 48px rgba(28, 63, 79, 0.12);
}

body[data-theme="ember"] {
  color-scheme: dark;
  --bg: #15110f;
  --surface: #211b17;
  --ink: #fbf3ed;
  --muted: #b9a99e;
  --line: #3a2f28;
  --brand: #f07a3a;
  --brand-dark: #ffb072;
  --accent: #4fd1c5;
  --warning: #f6c453;
  --danger: #ff7777;
  --ok: #62d493;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

body[data-theme="mint"] {
  --bg: #f0faf5;
  --surface: #ffffff;
  --ink: #14241d;
  --muted: #5e7469;
  --line: #d5e9df;
  --brand: #16845f;
  --brand-dark: #0c503b;
  --accent: #b85c38;
  --warning: #a16207;
  --danger: #b43a48;
  --ok: #22724f;
  --shadow: 0 18px 48px rgba(12, 80, 59, 0.12);
}

body[data-theme="custom"] {
  --bg: var(--custom-bg, #f5f7fb);
  --surface: var(--custom-surface, #ffffff);
  --ink: var(--custom-ink, #17211d);
  --muted: color-mix(in srgb, var(--ink) 58%, var(--surface));
  --line: color-mix(in srgb, var(--ink) 18%, var(--surface));
  --brand: var(--custom-brand, #0e766e);
  --brand-dark: var(--custom-brand-dark, #0f4f49);
  --accent: var(--custom-accent, #d97706);
  --shadow: 0 18px 48px color-mix(in srgb, var(--brand-dark) 16%, transparent);
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.16), transparent 34%),
    linear-gradient(180deg, #0b1110 0, var(--bg) 44%),
    var(--bg);
}

body[data-theme="coffee"] {
  background:
    radial-gradient(circle at top left, rgba(124, 63, 29, 0.12), transparent 34%),
    linear-gradient(180deg, #fffaf2 0, var(--bg) 44%),
    var(--bg);
}

body[data-theme="forest"],
body[data-theme="olive"],
body[data-theme="rose"],
body[data-theme="slate"],
body[data-theme="copper"],
body[data-theme="aqua"],
body[data-theme="plum"],
body[data-theme="sunrise"],
body[data-theme="lagoon"],
body[data-theme="orchid"],
body[data-theme="steel"],
body[data-theme="mint"],
body[data-theme="custom"] {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand) 14%, transparent), transparent 34%),
    linear-gradient(180deg, var(--surface) 0, var(--bg) 44%),
    var(--bg);
}

body[data-theme="midnight"] {
  background:
    radial-gradient(circle at top left, rgba(91, 141, 239, 0.18), transparent 34%),
    linear-gradient(180deg, #0a0d16 0, var(--bg) 44%),
    var(--bg);
}

body[data-theme="graphite"] {
  background:
    radial-gradient(circle at top left, rgba(159, 183, 199, 0.16), transparent 34%),
    linear-gradient(180deg, #0b0d0f 0, var(--bg) 44%),
    var(--bg);
}

body[data-theme="ember"] {
  background:
    radial-gradient(circle at top left, rgba(240, 122, 58, 0.17), transparent 34%),
    linear-gradient(180deg, #0f0c0b 0, var(--bg) 44%),
    var(--bg);
}

body[data-density="compact"] {
  font-size: 14px;
}

body[data-font-scale="small"] {
  font-size: 14px;
}

body[data-font-scale="large"] {
  font-size: 16px;
}

body[data-radius="sharp"] {
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
}

body[data-radius="rounded"] {
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

body[data-contrast="high"] {
  --muted: color-mix(in srgb, var(--ink) 78%, var(--surface));
  --line: color-mix(in srgb, var(--ink) 38%, var(--surface));
  --focus-ring: 0 0 0 4px color-mix(in srgb, var(--brand) 34%, transparent);
}

body[data-motion="reduced"] *,
body[data-motion="reduced"] *::before,
body[data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}

body[data-surface="flat"] {
  --shadow: none;
  --shadow-soft: none;
}

body[data-surface="layered"] {
  --surface-raised: color-mix(in srgb, var(--surface) 86%, #ffffff 14%);
  --surface-tint: color-mix(in srgb, var(--surface) 80%, var(--brand) 20%);
  --shadow: 0 22px 58px color-mix(in srgb, var(--brand-dark) 16%, transparent);
  --shadow-soft: 0 12px 34px color-mix(in srgb, var(--brand-dark) 12%, transparent);
}

body:not(.authenticated) .app-shell {
  display: none;
}

body.authenticated .login-screen {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

#loginMessage {
  min-height: 18px;
  color: var(--danger);
  font-weight: 800;
}

.security-notice {
  display: block;
  border: 1px solid color-mix(in srgb, var(--warning) 46%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  color: var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.security-notice[hidden] {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
input,
select,
textarea {
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.panel,
.metric,
.login-panel,
.guide-card,
.ops-row,
.order-row,
.stock-row,
.history-row,
.definition-row,
.branch-card,
.report-card,
.recipe-card,
.table-card,
.menu-card,
.customer-card,
.staff-card,
.modal-card,
.nav-group-title,
.nav-subtabs,
.brand,
.empty-state,
.security-notice,
input,
select,
textarea {
  border-radius: var(--radius-md);
}

button,
.nav-tab,
.chip,
.pill,
.status-pill,
.permission-chip,
.tag,
.segment,
.primary-button,
.secondary-button,
.ghost-button {
  border-radius: var(--radius-sm);
}

body[data-surface="flat"] .panel,
body[data-surface="flat"] .metric,
body[data-surface="flat"] .login-panel,
body[data-surface="flat"] .modal-card,
body[data-surface="flat"] .guide-card {
  box-shadow: none;
}

body[data-surface="layered"] .panel,
body[data-surface="layered"] .metric,
body[data-surface="layered"] .login-panel,
body[data-surface="layered"] .modal-card,
body[data-surface="layered"] .guide-card {
  box-shadow: var(--shadow);
}

body[data-contrast="high"] .panel,
body[data-contrast="high"] .metric,
body[data-contrast="high"] .login-panel,
body[data-contrast="high"] .modal-card,
body[data-contrast="high"] input,
body[data-contrast="high"] select,
body[data-contrast="high"] textarea {
  border-color: var(--line);
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--brand-dark) 0%, #13201e 100%);
  color: #f5fbf8;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 12px 0 34px rgba(0, 0, 0, 0.12);
}

body[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #0f2825 0%, #080d0c 100%);
}

body[data-theme="coffee"] .sidebar {
  background: linear-gradient(180deg, #4e2815 0%, #2f1b10 100%);
}

body[data-theme="contrast"] .sidebar {
  background: #000000;
}

body[data-theme="forest"] .sidebar,
body[data-theme="olive"] .sidebar,
body[data-theme="rose"] .sidebar,
body[data-theme="slate"] .sidebar,
body[data-theme="copper"] .sidebar,
body[data-theme="aqua"] .sidebar,
body[data-theme="plum"] .sidebar,
body[data-theme="sunrise"] .sidebar,
body[data-theme="lagoon"] .sidebar,
body[data-theme="orchid"] .sidebar,
body[data-theme="steel"] .sidebar,
body[data-theme="mint"] .sidebar,
body[data-theme="custom"] .sidebar {
  background: linear-gradient(180deg, var(--brand-dark) 0%, color-mix(in srgb, var(--brand-dark) 70%, #000000) 100%);
}

body[data-theme="midnight"] .sidebar,
body[data-theme="ember"] .sidebar,
body[data-theme="graphite"] .sidebar {
  background: linear-gradient(180deg, #121a31 0%, #070913 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
}

.mobile-nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 20px;
}

.context-hidden {
  display: none !important;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, #ffffff), var(--accent)),
    var(--accent);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.34), 0 10px 22px rgba(0, 0, 0, 0.18);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: color-mix(in srgb, var(--surface) 70%, var(--muted));
  font-size: 13px;
}

.nav-tabs {
  display: grid;
  gap: 10px;
  align-content: start;
}

.nav-favorites {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 8px;
}

.nav-favorites[hidden] {
  display: none;
}

.nav-favorites-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  padding: 0 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-favorites-title small {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-favorite-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.nav-favorite-shortcut {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
  padding: 0 7px;
  text-align: left;
}

.nav-favorite-shortcut strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-favorite-shortcut:hover,
.nav-favorite-shortcut.active {
  border-color: color-mix(in srgb, var(--accent) 72%, #ffffff);
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: #ffffff;
}

.module-favorite-button {
  margin-left: auto;
  color: var(--muted);
}

.module-favorite-button.active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 18%);
  color: var(--accent);
}

.nav-position-preview {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr;
  grid-template-rows: 38px 94px;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.nav-position-preview-bar {
  grid-column: 1;
  grid-row: 1 / -1;
  background: var(--brand-dark);
}

.nav-position-preview-content {
  grid-column: 2;
  grid-row: 1 / -1;
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.nav-position-preview[data-position="right"] {
  grid-template-columns: 1fr 54px;
}

.nav-position-preview[data-position="right"] .nav-position-preview-bar {
  grid-column: 2;
}

.nav-position-preview[data-position="right"] .nav-position-preview-content {
  grid-column: 1;
}

.nav-position-preview[data-position="top"] {
  grid-template-columns: 1fr;
  grid-template-rows: 38px 94px;
}

.nav-position-preview[data-position="top"] .nav-position-preview-bar {
  grid-column: 1;
  grid-row: 1;
}

.nav-position-preview[data-position="top"] .nav-position-preview-content {
  grid-column: 1;
  grid-row: 2;
}

.nav-position-preview[data-position="bottom"] {
  grid-template-columns: 1fr;
  grid-template-rows: 94px 38px;
}

.nav-position-preview[data-position="bottom"] .nav-position-preview-bar {
  grid-column: 1;
  grid-row: 2;
}

.nav-position-preview[data-position="bottom"] .nav-position-preview-content {
  grid-column: 1;
  grid-row: 1;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: color-mix(in srgb, var(--surface) 72%, var(--muted));
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  padding: 0 10px;
  text-align: left;
}

.nav-group-title:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-group-title::after {
  content: "›";
  color: color-mix(in srgb, var(--surface) 70%, var(--muted));
  font-size: 18px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.nav-group.expanded .nav-group-title {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-group.expanded .nav-group-title::after {
  transform: rotate(90deg);
}

.nav-subtabs {
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--surface) 84%, var(--muted));
  padding: 0 10px;
  text-align: left;
  font-size: 14px;
}

.nav-tab.active,
.nav-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-tab.active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.nav-tab span:first-child {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.workspace {
  padding: 24px 28px 32px;
  min-width: 0;
}

body[data-nav-position="right"] .app-shell {
  grid-template-columns: minmax(0, 1fr) 276px;
}

body[data-nav-position="right"] .sidebar {
  grid-column: 2;
  grid-row: 1;
  box-shadow: -12px 0 34px rgba(0, 0, 0, 0.12);
}

body[data-nav-position="right"] .workspace {
  grid-column: 1;
  grid-row: 1;
}

body[data-nav-position="top"] .app-shell,
body[data-nav-position="bottom"] .app-shell {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
}

body[data-nav-position="top"] .sidebar,
body[data-nav-position="bottom"] .sidebar {
  height: auto;
  max-height: 42vh;
  z-index: 6;
  padding: 14px 18px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.12);
}

body[data-nav-position="top"] .sidebar {
  grid-row: 1;
}

body[data-nav-position="top"] .workspace {
  grid-row: 2;
}

body[data-nav-position="bottom"] .sidebar {
  grid-row: 2;
  top: auto;
  bottom: 0;
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.12);
}

body[data-nav-position="bottom"] .workspace {
  grid-row: 1;
}

body[data-nav-position="top"] .brand,
body[data-nav-position="bottom"] .brand {
  min-height: 48px;
}

body[data-nav-position="top"] .nav-tabs,
body[data-nav-position="bottom"] .nav-tabs {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

body[data-nav-position="top"] .nav-subtabs,
body[data-nav-position="bottom"] .nav-subtabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-density="compact"] .workspace {
  padding: 18px;
}

body[data-density="compact"] .sidebar {
  padding: 18px 14px;
  gap: 18px;
}

body[data-density="compact"] .panel,
body[data-density="compact"] .metric {
  padding: 12px;
}

body[data-density="compact"] .nav-tab {
  min-height: 36px;
}

body[data-density="compact"] .metrics-grid,
body[data-density="compact"] .content-grid,
body[data-density="compact"] .sales-layout,
body[data-density="compact"] .menu-layout,
body[data-density="compact"] .recipe-layout,
body[data-density="compact"] .ops-layout {
  gap: 12px;
}

.topbar,
.section-header,
.panel-heading,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 -4px 26px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.topbar h1,
.view h2,
.dialog-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 30px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.quick-command-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, var(--brand) 10%);
}

.quick-command-bar .icon-button {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 16px;
  font-weight: 900;
}

.quick-range-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.quick-range-actions .ghost-button {
  width: auto;
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 88%, var(--brand) 12%);
  border-color: var(--line);
  white-space: nowrap;
}

.quick-range-actions .ghost-button:hover {
  color: var(--brand-dark);
  border-color: color-mix(in srgb, var(--line) 65%, var(--brand) 35%);
  background: color-mix(in srgb, var(--surface) 86%, var(--brand) 14%);
}

.quick-range-actions .ghost-button.active,
#managementTodayButton.active {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.global-search {
  position: relative;
  min-width: min(360px, 100%);
}

.global-search input {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18);
}

.global-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.global-search-result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, var(--brand) 10%);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.global-search-result span {
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.global-search-result:hover,
.global-search-result.keyboard-active {
  background: color-mix(in srgb, var(--surface) 82%, var(--brand) 18%);
  transform: translateY(-1px);
}

.global-search-result.keyboard-active {
  box-shadow: var(--focus-ring);
}

.global-search-result small {
  color: var(--muted);
}

.global-search-hint {
  padding: 4px 6px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.current-user {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  max-width: 220px;
  overflow-wrap: anywhere;
}

.date-filter input,
.date-filter select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: color-mix(in srgb, var(--brand) 58%, var(--line));
  box-shadow: var(--focus-ring);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--brand) 18%, transparent);
}

.primary-button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.secondary-button {
  background: color-mix(in srgb, var(--surface) 82%, var(--brand) 18%);
  border-color: color-mix(in srgb, var(--line) 72%, var(--brand) 28%);
  color: var(--brand-dark);
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: color-mix(in srgb, var(--line) 58%, var(--brand) 42%);
  background: color-mix(in srgb, var(--surface) 80%, var(--brand) 20%);
  color: var(--brand-dark);
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
  outline-offset: 2px;
}

.ghost-button {
  width: auto;
  min-width: 42px;
  padding: 0;
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  white-space: nowrap;
}

.full {
  width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 0.22s ease;
}

.view > h2,
.section-header {
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.view > h2,
.section-header h2 {
  font-size: 28px;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.role-dashboard {
  margin-bottom: 18px;
}

.focus-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--warning) 8%);
}

.focus-panel-heading,
.focus-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.focus-panel-heading strong {
  font-size: 15px;
}

.focus-panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.focus-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.focus-item {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
}

.focus-item.finance {
  border-left-color: var(--danger);
}

.focus-item.purchase,
.focus-item.stock {
  border-left-color: var(--warning);
}

.focus-item.service {
  border-left-color: var(--brand);
}

.focus-item strong,
.focus-item small {
  display: block;
}

.focus-item small {
  margin-top: 4px;
  color: var(--muted);
}

.role-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.module-guidance {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin: -6px 0 18px;
}

.guide-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--brand) 6%);
}

.guide-card span,
.guide-card small {
  color: var(--muted);
}

.guide-card span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.guide-card strong {
  font-size: 24px;
  line-height: 1.1;
}

.guide-card small {
  grid-column: 1;
}

.guide-card button {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}

.metric,
.panel,
.table-card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric:hover,
.panel:hover,
.table-card:hover {
  border-color: color-mix(in srgb, var(--line) 72%, var(--brand) 28%);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--brand) 8%, transparent);
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
  min-height: 112px;
  display: grid;
  align-content: space-between;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
  opacity: 0.75;
}

.metric::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  z-index: 1;
}

.metric strong {
  font-size: 30px;
  line-height: 1.08;
  z-index: 1;
}

.metric small {
  z-index: 1;
}

.metric[data-tone="success"]::before {
  background: var(--ok);
}

.metric[data-tone="success"]::after {
  background: color-mix(in srgb, var(--ok) 11%, transparent);
}

.metric[data-tone="danger"]::before {
  background: var(--danger);
}

.metric[data-tone="danger"]::after {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.metric[data-tone="info"]::before {
  background: var(--accent);
}

.metric[data-tone="info"]::after {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.metric.trend {
  border-color: color-mix(in srgb, var(--line) 64%, var(--brand) 36%);
  background: color-mix(in srgb, var(--surface) 90%, var(--brand) 10%);
}

.metric.trend::before {
  background: var(--brand);
}

.metric.trend strong {
  font-size: 20px;
  line-height: 1.25;
}

.content-grid,
.sales-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 18px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel h3 {
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.panel,
.metric,
.table-card,
.order-row,
.stock-row,
.receipt-row,
.menu-row,
.stock-ledger-row,
.invoice-row,
.draft-row,
.recipe-row,
.ops-row,
.kitchen-ticket,
.log-row,
.merge-card,
.permission-option,
.category-picker-card,
.product-picker-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel-heading {
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.panel-heading span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 84%, var(--brand) 16%);
  color: var(--brand-dark);
  font-weight: 800;
  padding: 0 10px;
}

.order-list,
.stock-list,
.receipt-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--brand) 4%);
  text-align: center;
  padding: 16px;
}

.order-row,
.stock-row,
.receipt-row,
.menu-row {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg) 8%);
}

.order-row:hover,
.stock-row:hover,
.receipt-row:hover,
.menu-row:hover,
.stock-ledger-row:hover,
.invoice-row:hover,
.draft-row:hover,
.recipe-row:hover,
.ops-row:hover,
.kitchen-ticket:hover {
  border-color: color-mix(in srgb, var(--line) 58%, var(--brand) 42%);
  background: color-mix(in srgb, var(--surface) 88%, var(--brand) 8%);
}

.order-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.receipt-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.order-row small,
.stock-row small,
.receipt-row small,
.menu-row small,
.table-card small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.row-actions .tiny-button,
.row-actions .danger-button,
.row-actions .secondary-button,
.row-actions .primary-button {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.list-search-input {
  min-width: 190px;
}

.searchable-select {
  position: relative;
  display: grid;
  min-width: 0;
}

.native-searchable-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.searchable-select-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-weight: 700;
  padding: 8px 34px 8px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.searchable-select-button::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.searchable-select-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(15, 25, 22, 0.16);
  padding: 8px;
  min-width: min(320px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  grid-template-columns: 1fr auto;
}

.searchable-select-panel[hidden] {
  display: none;
}

.select-search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 8px 10px;
  background: var(--surface);
}

.searchable-clear-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  padding: 0 10px;
}

.searchable-select-options {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.searchable-option {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 8px 10px;
  font: inherit;
}

.searchable-option:hover,
.searchable-option.active,
.searchable-option.keyboard-active {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}

.searchable-option.keyboard-active {
  outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
}

.report-section-title {
  margin: 16px 0 8px;
  font-weight: 800;
  color: var(--brand-dark);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-open {
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
  color: var(--ok);
}

.status-busy {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}

.status-reserved {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: var(--brand-dark);
}

.segmented-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: color-mix(in srgb, var(--surface) 72%, var(--bg) 28%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18);
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.category-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

.workspace-category-toolbar {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.category-toolbar:not([data-category-view="compact"]) .category-picker-button {
  display: none;
}

.category-toolbar[data-category-view="hybrid"] .category-strip.compact:first-child {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, var(--bg) 28%);
  overflow: visible;
}

.category-toolbar[data-category-view="hybrid"] .category-strip:not(:first-child) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px;
  overflow: visible;
}

.category-toolbar[data-category-view="hybrid"] .category-chip {
  justify-content: space-between;
  border-radius: 6px;
  box-shadow: none;
}

.category-toolbar[data-category-view="hybrid"] .category-strip.compact:first-child .category-chip {
  justify-content: center;
  min-width: 0;
  border-color: transparent;
  background: transparent;
  padding-inline: 8px;
}

.category-toolbar[data-category-view="hybrid"] .category-strip.compact:first-child .category-chip.active {
  background: var(--surface);
  border-color: var(--line);
  color: var(--brand-dark);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 10%, transparent);
}

.category-toolbar[data-category-view="compact"] {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.category-toolbar[data-category-view="compact"] .category-strip:first-child {
  grid-column: 1 / -1;
}

.category-toolbar[data-category-view="compact"] .category-strip:not(:first-child) {
  overflow: hidden;
}

.category-toolbar[data-category-view="compact"] .category-picker-button {
  min-height: 36px;
}

.category-toolbar[data-category-view="grid"] .category-strip:not(:first-child) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  overflow: visible;
}

.category-toolbar[data-category-view="grid"] .category-strip:not(:first-child) .category-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  min-height: 68px;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.category-toolbar[data-category-view="grid"] .category-strip:not(:first-child) .category-chip span {
  font-size: 14px;
}

.category-toolbar[data-category-view="grid"] .category-strip:not(:first-child) .category-chip.active {
  color: #ffffff;
}

.category-toolbar .category-strip {
  min-width: 0;
  margin-bottom: 0;
}

.category-toolbar .category-chip {
  min-width: 0;
  max-width: 100%;
}

.category-toolbar .category-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.note-template-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.note-template-strip button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, var(--brand) 14%);
  color: var(--brand-dark);
  padding: 0 12px;
  font-weight: 800;
  white-space: nowrap;
}

.category-picker-button {
  justify-self: start;
  white-space: nowrap;
}

.settings-fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.settings-fieldset legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 900;
}

.field-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.category-view-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.category-view-guide span {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border-left: 3px solid var(--brand);
  background: color-mix(in srgb, var(--surface) 84%, var(--brand) 6%);
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
}

.category-view-guide strong {
  color: var(--ink);
  font-size: 13px;
}

.category-strip.compact {
  padding-bottom: 8px;
  margin-top: -4px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
  font-weight: 800;
  white-space: nowrap;
}

.category-chip strong {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, var(--brand) 12%);
  color: var(--brand-dark);
  font-size: 12px;
}

.category-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 18%, transparent);
}

.category-chip.active strong {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.category-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.product-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.product-picker-actions span {
  color: var(--muted);
  font-weight: 800;
}

.product-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.category-picker-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.product-picker-card {
  display: grid;
  gap: 7px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.product-picker-card:hover {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.product-picker-card span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-picker-card strong {
  font-size: 17px;
}

.product-picker-card small {
  color: var(--muted);
}

.category-picker-card span {
  font-weight: 900;
}

.category-picker-card strong {
  font-size: 24px;
  color: var(--brand-dark);
}

.category-picker-card small {
  color: var(--muted);
}

.category-picker-card.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--surface) 82%, var(--brand) 18%);
  box-shadow: var(--focus-ring);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.permission-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  font-size: 13px;
}

.permission-option:has(input:disabled) {
  background: color-mix(in srgb, var(--surface) 78%, var(--bg) 22%);
  color: var(--muted);
}

.permission-note {
  grid-column: 1 / -1;
  min-height: 36px;
  display: flex;
  align-items: center;
  border: 1px solid #c9d8d2;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--brand) 18%);
  color: var(--brand-dark);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.segment {
  border: 0;
  border-radius: 6px;
  min-height: 34px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(18, 35, 31, 0.08);
}

.segment:hover {
  color: var(--brand-dark);
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.table-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  min-height: 150px;
  display: grid;
  gap: 10px;
}

.table-card::after {
  content: "";
  position: absolute;
  inset: auto 12px 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: color-mix(in srgb, var(--brand) 34%, transparent);
}

.table-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.table-card h3 {
  margin: 0;
}

.table-card strong {
  font-size: 24px;
}

.table-card footer {
  display: flex;
  gap: 8px;
}

.table-status-select {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  font-weight: 700;
}

.menu-layout {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.stock-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.stock-subnav {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 18px;
  overflow-x: auto;
}

.stock-module-panels {
  display: grid;
  gap: 18px;
}

.stock-module-panel:not(.active) {
  display: none;
}

.stock-module-panel.active {
  display: grid;
}

.compact-floor-plan {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-admin-layout {
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
}

.settings-admin-form {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.settings-admin-form > h3,
.settings-admin-form > .settings-fieldset,
.settings-admin-form > .color-grid,
.settings-admin-form > button.full {
  grid-column: 1 / -1;
}

.settings-admin-form > .field-row {
  height: 100%;
}

.users-admin-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
}

.user-admin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.user-admin-form > h3,
.user-admin-form > .security-notice,
.user-admin-form > .permission-summary,
.user-admin-form > .user-permission-layout {
  grid-column: 1 / -1;
}

.permission-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.permission-summary > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, var(--brand) 10%);
  padding: 9px 12px;
}

.permission-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.permission-summary strong {
  color: var(--brand-dark);
  font-size: 17px;
}

.user-permission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 94%, var(--bg) 6%);
}

.permission-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 7px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.permission-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.permission-tab span {
  min-width: 22px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--bg) 82%, var(--line) 18%);
  padding: 2px 6px;
  color: var(--ink);
  font-size: 11px;
  text-align: center;
}

.permission-tab.active {
  background: color-mix(in srgb, var(--surface) 78%, var(--brand) 22%);
  color: var(--brand-dark);
}

.permission-tab.active span {
  background: var(--brand);
  color: #ffffff;
}

.permission-bulk-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.permission-bulk-actions .text-button {
  min-height: 32px;
  padding: 0 9px;
  white-space: nowrap;
}

.permission-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  max-height: 300px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.permission-section > strong {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}

.permission-section .permission-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.permission-section .permission-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  padding: 8px 9px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.permission-section .permission-option span {
  min-width: 0;
  overflow: visible;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}

.permission-section .permission-option input[type="checkbox"] {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin: 0;
  align-self: center;
}

@media (max-width: 980px) {
  .permission-section .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.permission-section .permission-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: color-mix(in srgb, var(--surface) 82%, var(--brand) 18%);
  color: var(--brand-dark);
}

.permission-section .permission-option:has(input:disabled) {
  opacity: 0.68;
}

.permission-section input[type="checkbox"] {
  accent-color: var(--brand);
}

.superadmin-approval-panel {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  background: color-mix(in srgb, var(--surface) 95%, var(--warning) 5%);
}

.superadmin-approval-panel .panel-heading {
  align-items: flex-start;
}

.superadmin-approval-panel h3 {
  margin: 0;
}

.superadmin-approval-list {
  display: grid;
  gap: 12px;
}

.superadmin-approval-card {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.superadmin-approval-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.superadmin-approval-card header div,
.superadmin-approval-card header strong,
.superadmin-approval-card header small {
  display: block;
}

.superadmin-approval-card header small {
  margin-top: 3px;
  color: var(--muted);
}

.superadmin-approval-card header > span {
  min-width: 50px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, var(--brand) 22%);
  padding: 6px 10px;
  color: var(--brand-dark);
  font-weight: 900;
  text-align: center;
}

.superadmin-authority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.authority-toggle {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px;
  color: var(--ink);
  text-align: left;
}

.authority-toggle > span:last-child,
.authority-toggle strong,
.authority-toggle small,
.authority-toggle em {
  display: block;
}

.authority-toggle small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.authority-toggle em {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.authority-state {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  color: var(--warning);
  font-weight: 900;
}

.authority-toggle.approved {
  border-color: color-mix(in srgb, var(--brand) 48%, var(--line));
  background: color-mix(in srgb, var(--surface) 88%, var(--brand) 12%);
}

.authority-toggle.approved .authority-state {
  background: var(--brand);
  color: #ffffff;
}

.users-admin-layout > .panel:last-child {
  position: sticky;
  top: 106px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.definitions-layout {
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.definition-form-stack,
.definition-list-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.definition-subnav {
  margin-bottom: 18px;
}

.definition-panel:not(.active) {
  display: none;
}

.dayclose-layout {
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dayclose-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.management-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.management-subnav {
  margin-top: 8px;
  overflow-x: auto;
}

.management-panel:not(.active) {
  display: none;
}

.kitchen-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.kitchen-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.kitchen-category-filter {
  overflow-x: auto;
  justify-content: flex-start;
}

.kitchen-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.stock-panels {
  display: grid;
  gap: 18px;
}

.stock-summary {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
}

.stock-summary strong {
  color: var(--ink);
  font-size: 24px;
}

.form-panel,
.dialog-panel {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
}

.check-line input {
  width: 18px;
  height: 18px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.color-grid input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.menu-table {
  display: grid;
  gap: 8px;
}

.stock-ledger,
.invoice-history,
.invoice-draft,
.recipe-draft,
.recipe-list,
.ops-list {
  display: grid;
  gap: 8px;
}

.stock-movement-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.stock-movement-toolbar > .compact-select:nth-child(1) {
  flex: 0 1 158px;
}

.stock-movement-toolbar > .compact-select:nth-child(2) {
  flex: 1 1 210px;
}

.stock-movement-toolbar > .compact-select:nth-child(3),
.stock-movement-toolbar > .compact-select:nth-child(4) {
  flex: 1 1 145px;
}

.stock-movement-toolbar > .list-search-input {
  flex: 1 1 190px;
  min-width: 160px;
}

.stock-movement-report-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.stock-movement-report-actions .report-format-select {
  flex: 0 0 76px;
  width: 76px;
}

.stock-movement-report-actions .secondary-button {
  white-space: nowrap;
}

.log-board {
  display: grid;
  gap: 12px;
}

.log-subnav {
  margin: 12px 0;
}

.log-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg) 8%);
}

.log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.log-row small:last-child {
  grid-column: 1 / -1;
}

.checkbox-line {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
}

.new-stock-fields {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, var(--brand) 5%);
}

.new-stock-fields[hidden] {
  display: none;
}

.menu-row {
  grid-template-columns: minmax(180px, 1fr) minmax(84px, 104px) minmax(104px, 128px) minmax(180px, auto);
  align-items: center;
}

.menu-row .row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu-row .tiny-button,
.menu-row .danger-button {
  white-space: nowrap;
}

.stock-ledger-row,
.invoice-row,
.draft-row,
.recipe-row,
.ops-row,
.kitchen-ticket {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg) 8%);
}

.stock-ledger-row {
  grid-template-columns: minmax(0, 1fr) minmax(84px, 100px) minmax(92px, 110px) minmax(92px, 110px) minmax(180px, auto);
  align-items: center;
}

.invoice-row {
  grid-template-columns: minmax(0, 1fr) minmax(84px, 100px) minmax(92px, 110px);
  align-items: center;
}

.draft-row {
  grid-template-columns: minmax(0, 1fr) minmax(70px, 80px) minmax(86px, 100px) auto auto;
  align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, var(--brand) 4%);
}

.compact-select {
  min-height: 32px;
  padding: 0 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.recipe-row {
  grid-template-columns: minmax(0, 1fr) 110px auto;
  align-items: center;
}

.ops-row {
  grid-template-columns: minmax(0, 1fr) 120px auto;
  align-items: center;
}

.kitchen-ticket {
  align-content: start;
  min-height: 150px;
  gap: 10px;
}

.kitchen-ticket.delayed {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
  background: color-mix(in srgb, var(--surface) 86%, var(--danger) 7%);
}

.kitchen-note {
  border: 1px solid color-mix(in srgb, var(--warning) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 800;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stock-ledger-row small,
.invoice-row small,
.draft-row small,
.recipe-row small,
.ops-row small,
.kitchen-ticket small {
  color: var(--muted);
}

.stock-level {
  font-weight: 800;
}

.stock-low {
  color: var(--danger);
}

.stock-ok {
  color: var(--ok);
}

.subtle-count {
  color: var(--muted);
  font-weight: 700;
}

.danger-button,
.tiny-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  padding: 0 10px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.danger-button {
  color: var(--danger);
}

.sales-bars {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  min-height: 260px;
}

.bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.bar-fill {
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--accent), var(--brand));
  min-height: 10px;
}

.bar span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.order-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.order-dialog::backdrop {
  background: rgba(15, 25, 22, 0.55);
}

.dialog-panel {
  width: min(560px, calc(100vw - 28px));
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  max-height: min(760px, 90vh);
  overflow-y: auto;
}

.wide-dialog {
  width: min(860px, calc(100vw - 28px));
}

.merge-source,
.merge-targets {
  display: grid;
  gap: 10px;
}

.merge-source {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.merge-target-card {
  display: block;
  cursor: pointer;
}

.merge-target-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.merge-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.merge-target-card input:checked + .merge-card {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.merge-card header,
.merge-card-totals {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.merge-card header span,
.merge-card small,
.merge-card-totals span {
  color: var(--muted);
}

.merge-card p {
  margin: 0;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 920px) {
  .app-shell,
  .content-grid,
  .sales-layout,
  .menu-layout,
  .stock-layout,
  .recipe-layout,
  .purchase-layout,
  .definitions-layout,
  .dayclose-layout,
  .ops-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: auto;
    max-height: none;
    padding: 12px;
    gap: 12px;
    overflow: visible;
  }

  .mobile-nav-toggle {
    display: grid;
    place-items: center;
  }

  .sidebar .nav-tabs {
    display: none;
  }

  .sidebar.mobile-open {
    max-height: 78vh;
    overflow-y: auto;
  }

  .sidebar.mobile-open .nav-tabs {
    display: grid;
  }

  body[data-nav-position="bottom"] .sidebar,
  body[data-nav-position="top"] .sidebar {
    grid-row: 1;
    top: 0;
    bottom: auto;
    max-height: none;
  }

  body[data-nav-position="bottom"] .workspace,
  body[data-nav-position="top"] .workspace {
    grid-row: 2;
  }

  body[data-nav-position="right"] .sidebar,
  body[data-nav-position="right"] .workspace {
    grid-column: 1;
  }

  body[data-nav-position="right"] .sidebar {
    grid-row: 1;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.12);
  }

  body[data-nav-position="right"] .workspace {
    grid-row: 2;
  }

  .brand {
    min-height: 52px;
  }

  .nav-tabs {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
  }

  .nav-group {
    gap: 6px;
  }

  .nav-group-title {
    padding: 0 6px;
  }

  .nav-subtabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
  }

  .nav-tab {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: 6px;
    font-size: 12px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar {
    position: static;
    margin: 0 0 18px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .focus-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-guidance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dayclose-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-grid {
    grid-template-columns: 1fr;
  }

  .kitchen-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-subnav {
    overflow-x: auto;
  }

  .users-admin-layout > .panel:last-child {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1280px) and (min-width: 921px) {
  .menu-layout,
  .recipe-layout,
  .ops-layout,
  .users-admin-layout,
  .settings-admin-layout {
    grid-template-columns: 1fr;
  }

  .permission-section .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .topbar-actions,
  .section-header,
  .panel-heading {
    align-items: stretch;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .topbar-actions > *,
  .topbar-actions .primary-button,
  .topbar-actions .secondary-button,
  .quick-command-bar,
  .date-filter,
  .current-user {
    width: 100%;
  }

  .global-search,
  .quick-command-bar,
  .current-user {
    grid-column: 1 / -1;
  }

  .current-user {
    max-width: none;
  }

  .stock-summary {
    justify-items: start;
  }

  .menu-row,
  .stock-ledger-row,
  .draft-row,
  .ops-row {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 620px) {
  .topbar {
    padding: 12px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h1 {
    font-size: 20px;
  }
  .topbar,
  .section-header,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .dialog-actions {
    width: 100%;
    justify-content: stretch;
  }

  .quick-command-bar {
    width: 100%;
    justify-content: space-between;
  }

  .quick-command-bar .icon-button {
    flex: 1;
  }

  .global-search {
    min-width: 100%;
    width: 100%;
  }

  .date-filter {
    width: 100%;
  }

  .date-filter input,
  .date-filter select {
    flex: 1;
  }

  .topbar-actions .primary-button,
  .topbar-actions .secondary-button,
  .dialog-actions button {
    flex: 1;
  }

  .quick-range-actions {
    width: 100%;
  }

  .quick-range-actions .ghost-button {
    flex: 1 1 96px;
    width: auto;
  }

  .metrics-grid,
  .role-dashboard-grid,
  .focus-list,
  .module-guidance,
  .dayclose-metrics,
  .kitchen-board,
  .field-row,
  .color-grid,
  .menu-row,
  .stock-ledger-row,
  .invoice-row,
  .draft-row,
  .order-row,
  .receipt-row,
  .recipe-row,
  .ops-row {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .settings-admin-form,
  .user-admin-form,
  .user-permission-layout,
  .permission-summary,
  .superadmin-authority-grid {
    grid-template-columns: 1fr;
  }

  .settings-admin-form > h3,
  .settings-admin-form > .settings-fieldset,
  .settings-admin-form > .color-grid,
  .settings-admin-form > button.full,
  .user-admin-form > h3,
  .user-admin-form > .security-notice,
  .user-admin-form > .permission-summary,
  .user-admin-form > .user-permission-layout {
    grid-column: 1;
  }

  .permission-section {
    max-height: 280px;
  }

  .category-view-guide {
    grid-template-columns: 1fr;
  }

  .category-toolbar[data-category-view="hybrid"] .category-strip.compact:first-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-toolbar[data-category-view="hybrid"] .category-strip:not(:first-child),
  .category-toolbar[data-category-view="grid"] .category-strip:not(:first-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-bars {
    gap: 6px;
  }

  .permission-tabs {
    flex-wrap: wrap;
  }

  .permission-tab {
    flex: 1 1 92px;
    justify-content: center;
  }

  .permission-bulk-actions {
    width: 100%;
    margin-left: 0;
  }

  .permission-bulk-actions .text-button {
    flex: 1;
  }
}

@media (max-width: 420px) {
  .workspace {
    padding: 12px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .color-grid,
  .permission-grid,
  .permission-section .permission-grid,
  .category-toolbar[data-category-view="hybrid"] .category-strip.compact:first-child,
  .category-toolbar[data-category-view="hybrid"] .category-strip:not(:first-child),
  .category-toolbar[data-category-view="grid"] .category-strip:not(:first-child) {
    grid-template-columns: 1fr;
  }

  .dialog-panel {
    width: calc(100vw - 18px);
    padding: 14px;
  }
}
