:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #f9fbfb;
  --line: #dbe3e5;
  --text: #182225;
  --muted: #66777d;
  --teal: #0d7f78;
  --teal-dark: #075f5a;
  --coral: #c9504a;
  --amber: #b87916;
  --green: #2e7d4f;
  --blue: #3568a8;
  --shadow: 0 10px 30px rgba(26, 42, 46, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px;
  background: #14282b;
  color: #f7fbfb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #e7f2f0;
  color: #0b5d58;
  font-size: 13px;
  font-weight: 800;
}

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

.brand span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
  padding: 18px 0;
  overflow-y: auto;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  text-align: left;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav .count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  text-align: center;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.version-card {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.version-card span,
.version-card small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.version-card strong {
  color: #fff;
  font-size: 16px;
}

.sidebar-footer label {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.sidebar-footer select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 9px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-actions,
.row-actions,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 8px 12px;
  font-weight: 700;
}

.primary-button {
  background: var(--teal);
  color: white;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.primary-button:disabled,
.secondary-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.secondary-button {
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
}

.ghost-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
  color: inherit;
}

.workspace .ghost-button {
  border-color: var(--line);
  color: var(--text);
}

.danger-button {
  border-color: #f3b3ab;
  background: #fff2f0;
  color: var(--coral);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  padding: 0;
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 20px;
}

.alerts {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.alert {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #f0d2a5;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fff9ed;
  color: #5c421c;
}

.alert.danger {
  border-color: #f0b7b2;
  border-left-color: var(--coral);
  background: #fff1f0;
  color: #6f2420;
}

.alert.preview {
  border-color: #b9d0f0;
  border-left-color: var(--blue);
  background: #eef5ff;
  color: #274c79;
}

.auth-mode .app-shell {
  grid-template-columns: 1fr;
}

.auth-mode .sidebar,
.auth-mode .topbar-actions {
  display: none;
}

.auth-mode .workspace {
  display: grid;
  align-content: center;
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
}

.login-panel {
  box-shadow: var(--shadow);
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 800;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.login-security-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

code {
  border-radius: 6px;
  background: #edf3f4;
  padding: 2px 5px;
  color: #214247;
  font-size: 0.94em;
}

.view {
  display: grid;
  gap: 16px;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.section-toolbar h2 {
  margin: 0 0 3px;
  font-size: 18px;
  letter-spacing: 0;
}

.employee-toolbar {
  align-items: flex-end;
  flex-wrap: wrap;
}

.employee-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.employee-filters label {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.employee-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(26, 42, 46, 0.06);
}

.employee-card-head,
.employee-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.employee-card-head h3 {
  margin: 0 0 3px;
  font-size: 17px;
  line-height: 1.2;
}

.employee-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.employee-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.employee-facts div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
}

.employee-facts div:last-child {
  border-right: 0;
}

.employee-facts span {
  color: var(--muted);
  font-size: 11px;
}

.employee-facts strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.restaurant-create-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(26, 42, 46, 0.06);
}

.restaurant-create-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.restaurant-create-head h3 {
  margin: 0 0 3px;
  font-size: 17px;
  line-height: 1.2;
}

.quick-restaurant-form {
  align-items: end;
}

.restaurant-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(26, 42, 46, 0.06);
}

.restaurant-card-head,
.restaurant-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.restaurant-card-head h3 {
  margin: 0 0 3px;
  font-size: 17px;
  line-height: 1.2;
}

.restaurant-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.badge-stack {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}

.restaurant-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.restaurant-facts div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
}

.restaurant-facts div:last-child {
  border-right: 0;
}

.restaurant-facts span,
.settings-strip span {
  color: var(--muted);
  font-size: 11px;
}

.restaurant-facts strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-strip span {
  min-height: 24px;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restaurant-settings-form {
  display: grid;
  gap: 12px;
}

.settings-sections {
  display: grid;
  gap: 10px;
}

@media (min-width: 900px) {
  .settings-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-section:first-child,
  .settings-section.matrix-settings-section,
  .settings-section:last-child {
    grid-column: 1 / -1;
  }
}

.settings-section {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.settings-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.compact-form {
  gap: 9px;
}

.compact-form textarea {
  min-height: 68px;
}

.flavor-matrix-editor {
  display: grid;
  gap: 9px;
}

.matrix-import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
}

.matrix-import-row textarea {
  min-height: 54px;
}

.matrix-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.matrix-table-wrap {
  overflow-x: auto;
}

.flavor-matrix-table {
  min-width: 680px;
}

.flavor-matrix-table th,
.flavor-matrix-table td {
  padding: 6px;
}

.flavor-matrix-table input {
  width: 100%;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.flavor-matrix-table th:last-child,
.flavor-matrix-table td:last-child {
  width: 48px;
  text-align: center;
}

.matrix-row-actions .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.matrix-add-button {
  justify-self: start;
}

@media (max-width: 680px) {
  .matrix-import-row {
    grid-template-columns: 1fr;
  }

  .matrix-actions {
    justify-content: stretch;
  }

  .matrix-actions button {
    flex: 1 1 auto;
  }
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.form-actions.split-actions {
  justify-content: space-between;
}

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

.history-list {
  display: grid;
  gap: 6px;
}

.history-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.history-list span {
  color: var(--muted);
  white-space: nowrap;
}

.compact-empty {
  padding: 12px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 17px;
}

.panel-body {
  padding: 16px;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 122px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 29px;
  line-height: 1;
  letter-spacing: 0;
}

.metric small {
  color: var(--muted);
  font-size: 12px;
}

.metric.danger {
  border-color: #f0c2bd;
  background: #fff7f6;
}

.metric.warn {
  border-color: #f2d9ad;
  background: #fffaf0;
}

.metric.good {
  border-color: #bdddc9;
  background: #f5fbf7;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf2f3;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.good {
  background: #e6f5ec;
  color: var(--green);
}

.badge.warn {
  background: #fff0d7;
  color: var(--amber);
}

.badge.danger {
  background: #ffe6e3;
  color: var(--coral);
}

.badge.info {
  background: #e6eef8;
  color: var(--blue);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
}

.stack {
  display: grid;
  gap: 10px;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.item h3,
.item h4,
.item p {
  margin: 0;
}

.item p,
.muted {
  color: var(--muted);
}

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

.form-grid.full {
  grid-template-columns: 1fr;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.tobacco-brand-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.tobacco-brand-fields .wide {
  grid-column: 1 / -1;
}

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

input,
select,
textarea {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.schedule-command-body {
  display: grid;
  gap: 14px;
}

.schedule-toolbar,
.schedule-period-controls,
.segmented-control {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-toolbar {
  justify-content: space-between;
}

.schedule-period-controls label,
.schedule-manager-filter {
  min-width: 180px;
}

.segmented-control {
  align-items: stretch;
}

.schedule-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.schedule-summary div {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.schedule-summary span,
.schedule-restaurant-head span,
.schedule-restaurant-head small,
.schedule-cell-meta,
.schedule-cell-action {
  color: var(--muted);
}

.schedule-board-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.schedule-board {
  display: grid;
  grid-template-columns: minmax(220px, 250px) repeat(var(--schedule-days), minmax(136px, 1fr));
  min-width: calc(220px + var(--schedule-days) * 136px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.schedule-corner,
.schedule-day-head,
.schedule-restaurant-head,
.schedule-cell {
  min-height: 88px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.schedule-corner,
.schedule-day-head {
  min-height: 52px;
  padding: 12px;
  background: #f4f7f8;
}

.schedule-restaurant-head {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px;
  background: var(--panel-soft);
}

.schedule-cell {
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border-top: 0;
  border-left: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.schedule-cell:hover {
  background: #eef8f6;
}

.schedule-cell.empty {
  background: #fbfcfc;
  color: var(--muted);
}

.schedule-cell.filled {
  border-left: 4px solid var(--teal);
}

.schedule-cell.replacement {
  border-left-color: #d9871c;
}

.schedule-cell.conflict {
  border-left: 4px solid #bd3434;
  background: #fff6f4;
}

.schedule-cell-title {
  font-weight: 800;
}

.shift-cleanup-form {
  display: grid;
  gap: 14px;
}

.shift-cleanup-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(210px, auto);
  gap: 10px;
  align-items: end;
}

.shift-cleanup-list {
  display: grid;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shift-cleanup-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.shift-cleanup-row:last-child {
  border-bottom: 0;
}

.shift-cleanup-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.shift-cleanup-row small {
  color: var(--muted);
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #f0c6c1;
  border-radius: 8px;
  background: #fff4f1;
  color: #9a2d22;
  font-weight: 700;
}

.master-workspace {
  display: grid;
  gap: 18px;
}

.master-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.master-today-list,
.master-actions {
  display: grid;
  gap: 12px;
}

.master-shift-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6fbfa;
}

.master-shift-card h3 {
  margin: 5px 0 6px;
  font-size: 30px;
  line-height: 1.08;
}

.master-shift-card p,
.master-empty-state p {
  margin: 0;
  color: var(--muted);
}

.master-shift-status {
  display: flex;
  justify-content: end;
}

.master-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.master-action-row strong,
.master-action-row span {
  display: block;
}

.master-action-row span {
  margin-top: 4px;
  color: var(--muted);
}

.master-action-row small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.master-empty-state {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 132px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.master-schedule-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.master-day {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.master-day.has-shift {
  border-color: rgba(13, 127, 120, 0.38);
  background: #f0faf8;
}

.master-day strong,
.master-day span,
.master-day small {
  display: block;
}

.master-day small {
  color: var(--muted);
}

.master-archive-table table {
  min-width: 880px;
}

.attendance-table table {
  min-width: 820px;
}

.chart-box {
  position: relative;
  height: 240px;
}

canvas {
  width: 100%;
  height: 100%;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef0;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.modal {
  width: min(960px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.modal::backdrop {
  background: rgba(9, 22, 24, 0.48);
}

.modal-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 28px);
  margin: 0;
  background: var(--panel);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal h2 {
  margin: 0;
  font-size: 20px;
}

#modalBody {
  overflow-y: auto;
  padding: 16px;
}

.restaurant-form {
  align-items: end;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .split,
  .master-command-grid,
  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .employee-grid,
  .restaurant-grid {
    grid-template-columns: 1fr;
  }

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

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

  .master-shift-card,
  .master-action-row {
    grid-template-columns: 1fr;
  }

  .master-shift-status,
  .master-action-row .row-actions {
    justify-content: start;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: stretch;
  }

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

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

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

  .tobacco-brand-fields {
    grid-template-columns: 1fr;
  }

  .section-toolbar,
  .schedule-toolbar,
  .schedule-period-controls,
  .employee-card-head,
  .employee-card-foot,
  .restaurant-create-head,
  .restaurant-card-head,
  .restaurant-card-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .badge-stack {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .schedule-summary {
    grid-template-columns: 1fr;
  }

  .shift-cleanup-filters,
  .shift-cleanup-row {
    grid-template-columns: 1fr;
  }

  .shift-cleanup-row {
    align-items: start;
  }

  .master-shift-card h3 {
    font-size: 24px;
  }

  .master-action-row .row-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .master-action-row .row-actions button {
    width: 100%;
  }

  .schedule-period-controls label,
  .schedule-manager-filter {
    min-width: 100%;
  }

  .employee-filters,
  .employee-filters label {
    width: 100%;
  }

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

  .employee-facts div:nth-child(2) {
    border-right: 0;
  }

  .employee-facts div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .restaurant-facts div:nth-child(2) {
    border-right: 0;
  }

  .restaurant-facts div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .history-list div {
    display: grid;
  }

  .history-list span {
    white-space: normal;
  }

  .topbar h1 {
    font-size: 24px;
  }
}
