:root {
  --primary: #2e7d32;
  --nav: #1b5e20;
  --blue: #1976d2;
  --danger: #d32f2f;
  --gray: #757575;
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --text-main: #101418;
  --text-muted: #667078;
  --border: #d8dde2;
  --border-table: #1f2933;
  --header-bg: #757575;
  --cat-bg: #eeeeee;
  --chk-bg: #eeeeee;
  --chk-active-bg: #c8e6c9;
  --matrix-head-bg: #f5f5f5;
  --top-nav-height: 92px;
  --tabs-height: 48px;
}

body.dark-theme {
  --primary: #4caf50;
  --nav: #1b5e20;
  --bg: #121212;
  --card-bg: #1e1e1e;
  --text-main: #e0e0e0;
  --text-muted: #a8a8a8;
  --border: #343434;
  --border-table: #555555;
  --header-bg: #333333;
  --cat-bg: #2a2a2a;
  --chk-bg: #333333;
  --chk-active-bg: #1b5e20;
  --matrix-head-bg: #2c2c2c;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.login-screen.active {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav);
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 30px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.login-box h1 {
  margin: 0 0 20px;
  color: var(--nav);
  font-size: 1.45rem;
}

.login-input {
  width: 100%;
  padding: 15px;
  margin-bottom: 14px;
  border: 2px solid #dddddd;
  border-radius: 8px;
  font-size: 1.05rem;
}

.login-btn {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 8px;
  background: var(--nav);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
}

.auth-error {
  display: none;
  margin-bottom: 12px;
  color: #d32f2f;
  font-weight: 800;
}

.auth-error.active {
  display: block;
}

.guest-screen.active {
  min-height: 100vh;
  display: block;
  padding: 14px;
  background: var(--bg);
}

.guest-root {
  max-width: 760px;
  margin: 0 auto;
}

.guest-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.guest-card h1,
.guest-card h2,
.guest-card h3 {
  margin: 0 0 10px;
}

.guest-card h1 {
  color: var(--primary);
  font-size: 1.7rem;
}

.guest-card h2 {
  font-size: 1.25rem;
}

.guest-section {
  display: block;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.guest-section summary {
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
}

.guest-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.guest-summary > div,
.guest-menu-meal {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.guest-meal-summary {
  margin-top: 12px;
}

.guest-meal-title {
  margin-bottom: 4px;
  font-weight: 900;
  text-transform: uppercase;
}

.guest-meal-summary ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.guest-meal-summary li {
  margin: 2px 0;
  line-height: 1.25;
}

.guest-menu-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.guest-menu-section {
  margin-top: 8px;
}

.guest-menu-section span {
  color: var(--text-muted);
  font-weight: 900;
}

.guest-menu-section p {
  margin: 4px 0 0;
}

.duty-mark {
  color: var(--primary);
  font-weight: 900;
}

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

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--nav);
  color: #ffffff;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-badges {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.user-badge {
  padding: 4px 8px;
  border-radius: 4px;
  background: #f57c00;
  font-size: 0.75rem;
  font-weight: 800;
}

.sync-badge {
  min-width: 70px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.sync-badge.online {
  background: #1b5e20;
  border-color: #66bb6a;
}

.sync-badge.offline {
  background: #b71c1c;
  border-color: #ef9a9a;
}

.sync-badge.pending {
  background: #f57c00;
  border-color: #ffcc80;
}

.nav-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  text-transform: uppercase;
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-actions {
  justify-content: center;
}

.nav-btn {
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
}

.nav-btn.danger {
  background: var(--danger);
}

.nav-btn.icon-btn {
  min-width: 48px;
}

.nav-btn.wide {
  width: 100%;
  margin-top: 8px;
  background: #0277bd;
}

.app-root {
  min-height: calc(100vh - 92px);
  padding-top: var(--top-nav-height);
}

.content {
  padding: 12px;
}

.screen-heading,
.report-heading {
  margin: 8px 0 14px;
  text-align: center;
  color: var(--primary);
}

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

.day-btn {
  min-height: 100px;
  padding: 20px;
  border: 2px solid var(--primary);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--primary);
  font-size: 1.12rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.day-btn span {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: none;
}

.day-screen {
  padding-top: var(--tabs-height);
  padding-bottom: 145px;
}

.tabs {
  position: fixed;
  top: var(--top-nav-height);
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.tab {
  flex: 1;
  padding: 12px 4px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 900;
}

.tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.tab-content {
  display: none;
  padding: 8px;
}

.tab-content.active {
  display: block;
}

.input-card,
.admin-section {
  min-width: 0;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
}

.label-title {
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.input-card input,
.input-card select,
.admin-section input,
.admin-section select,
.json-area {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-main);
}

.table-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.table-row input {
  flex: 1;
  padding: 10px;
  border: 3px solid var(--primary);
  border-radius: 8px;
  font-size: 1.35rem;
  text-align: center;
}

.transfer-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr)) auto;
  gap: 8px;
  align-items: end;
}

.transfer-row label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.transfer-row input {
  margin-top: 4px;
  text-align: center;
}

.seat-count-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-muted);
  font-weight: 900;
}

.seat-count-row span {
  flex: 1;
}

.seat-count-row .mini-btn:disabled {
  opacity: 0.45;
}

.guest-request-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(120px, 2fr) auto auto auto;
  gap: 7px;
  align-items: center;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.tracker-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.tracker-box {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--chk-bg);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 900;
  flex-direction: column;
  line-height: 1;
}

.tracker-box small {
  margin-top: 3px;
  font-size: 0.56rem;
  opacity: 0.9;
}

.tracker-box.saved {
  border-color: var(--primary);
  background: var(--chk-active-bg);
  color: var(--text-main);
}

.tracker-box.incomplete {
  border-color: #f57c00;
  background: #ffe0b2;
  color: #e65100;
}

.tracker-box.active {
  border: 2px solid var(--blue);
  box-shadow: 0 0 6px rgba(25, 118, 210, 0.55);
}

.meal-jump-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.meal-jump-row .nav-btn {
  flex: 1;
  background: #455a64;
}

.table-history-info {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.86rem;
}

.table-history-list {
  margin-top: 8px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.history-row b {
  color: var(--text-main);
}

.table-scroll,
.matrix-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  background: var(--card-bg);
}

.blank-table,
.matrix-table,
.emp-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--card-bg);
}

.blank-table th,
.blank-table td,
.matrix-table th,
.matrix-table td,
.emp-table th,
.emp-table td {
  border: 1px solid var(--border-table);
  padding: 8px 4px;
  color: var(--text-main);
  vertical-align: middle;
}

.blank-table th:first-child {
  width: 42%;
  text-align: left;
}

.blank-table th:not(:first-child),
.blank-table td:not(:first-child) {
  text-align: center;
}

.meal-header {
  background: var(--header-bg) !important;
  color: #ffffff !important;
  text-align: center !important;
  font-size: 1.05rem;
  font-weight: 900;
  scroll-margin-top: calc(var(--top-nav-height) + var(--tabs-height) + 8px);
}

.cat-header {
  background: var(--cat-bg) !important;
  text-align: center !important;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 900;
}

.dish-name {
  padding-left: 8px !important;
  text-align: left !important;
  font-weight: 600;
}

.seat-head {
  user-select: none;
}

.seat-head.selected {
  background: #ff9800 !important;
  color: #ffffff !important;
}

.chk-cell {
  cursor: pointer;
  color: var(--chk-bg);
  font-size: 1.35rem;
}

.chk-cell.active {
  background: var(--chk-active-bg);
  color: var(--text-main);
}

.chk-cell.selected-seat-col {
  background: rgba(255, 152, 0, 0.16);
  box-shadow: inset 0 0 0 2px rgba(255, 152, 0, 0.35);
}

.chk-cell.active.selected-seat-col {
  background: #ffcc80;
}

.chk-cell.active::after {
  content: "●";
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: 0 -5px 14px rgba(0, 0, 0, 0.12);
}

.scroll-top-btn {
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 35;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.footer-buttons {
  display: flex;
  gap: 10px;
}

.incomplete-label {
  display: flex;
  align-self: flex-start;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  background: #fff3e0;
  color: #e65100;
  font-weight: 900;
}

.incomplete-label input {
  width: 22px;
  height: 22px;
}

.btn {
  flex: 1;
  padding: 11px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
}

.btn.green {
  background: var(--primary);
}

.btn.gray {
  background: #9e9e9e;
  flex: 0.35;
}

.btn.blue {
  background: var(--blue);
}

.btn.orange {
  background: #f57c00;
}

.btn.red {
  background: var(--danger);
}

.btn.purple {
  background: #6a1b9a;
}

.btn.teal {
  background: #00897b;
}

.btn.full {
  width: 100%;
  margin-top: 10px;
}

.print-toolbar {
  margin: 14px 0;
  text-align: center;
}

.print-toolbar .btn {
  width: auto;
  padding: 10px 25px;
}

.danger-panel {
  border-color: rgba(198, 40, 40, 0.35);
}

.clear-day-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
}

.matrix-title {
  margin: 24px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--text-main);
  font-size: 1.08rem;
  font-weight: 900;
  text-transform: uppercase;
}

.matrix-table {
  min-width: 720px;
}

.matrix-table th {
  background: var(--matrix-head-bg);
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.matrix-table td {
  text-align: center;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sub-head {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.matrix-table th.garnish-head {
  display: table-cell;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.main-dish-total {
  display: block;
  margin-top: 3px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
}

.cell-data {
  line-height: 1.45;
  font-weight: 900;
}

.total-row td,
.k-total-val {
  background: var(--cat-bg) !important;
  color: var(--primary) !important;
  font-weight: 900;
}

.garnish-summary {
  margin: 10px 0 28px;
  padding: 10px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: var(--chk-active-bg);
  font-weight: 900;
}

.admin-layout {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 1100px;
  margin: 0 auto;
}

.admin-section,
.admin-meal-card,
.admin-section-card,
.edit-row {
  min-width: 0;
}

.admin-section h2 {
  margin-top: 0;
  color: var(--blue);
}

.admin-menu-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-menu-toolbar .btn {
  flex: 1 1 140px;
  font-size: 0.9rem;
  min-width: 0;
}

.admin-days-table {
  min-width: 520px;
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  background: var(--card-bg);
}

.admin-days-table th,
.admin-days-table td {
  border: 1px solid var(--border);
  padding: 7px 5px;
  font-size: 0.9rem;
}

.admin-days-table th {
  background: var(--matrix-head-bg);
  text-align: left;
}

.admin-days-table tr.active-day-row {
  outline: 2px solid var(--primary);
  background: var(--chk-active-bg);
}

.day-name-cell {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  font-weight: 900;
}

.day-actions {
  width: 170px;
  white-space: nowrap;
  text-align: right;
}

.admin-editor-title {
  margin: 16px 0 8px;
  color: var(--primary);
}

.admin-meal-card {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}

.admin-meal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.admin-meal-title input {
  flex: 1;
  min-width: 0;
  font-weight: 900;
}

.admin-section-card {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.admin-section-head {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 130px auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.edit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
}

.edit-row input[type="text"],
.edit-row input:not([type]) {
  flex: 1 1 180px;
  min-width: 0;
}

.edit-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 900;
}

.edit-row label input {
  width: 18px;
  height: 18px;
}

.edit-row label.duty-edit-label {
  color: var(--primary);
}

.mini-actions {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.mini-btn,
.add-btn {
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 900;
}

.mini-btn {
  min-width: 30px;
  padding: 7px 9px;
}

.add-btn {
  padding: 8px 12px;
  margin-bottom: 8px;
}

.mini-btn.gray,
.add-btn.gray {
  background: #757575;
}

.mini-btn.red,
.add-btn.red {
  background: var(--danger);
}

.mini-btn.orange,
.add-btn.orange {
  background: #f57c00;
}

.add-btn.blue,
.mini-btn.blue {
  background: var(--blue);
}

.add-btn.green,
.mini-btn.green {
  background: var(--primary);
}

.add-btn.purple,
.mini-btn.purple {
  background: #6a1b9a;
}

.day-access-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-weight: 900;
}

.day-chip input {
  width: 20px;
  height: 20px;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.qr-grid.single {
  grid-template-columns: minmax(150px, 220px);
}

.qr-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  text-align: center;
}

.qr-card img {
  width: 132px;
  height: 132px;
  background: #ffffff;
}

.qr-card a {
  color: var(--blue);
  font-weight: 900;
}

.qr-manager {
  display: grid;
  gap: 12px;
}

.qr-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qr-manager-head > div {
  display: grid;
  gap: 3px;
}

.qr-manager-head .btn {
  flex: 0 0 auto;
}

.qr-tools {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 2fr) auto;
  gap: 8px;
  align-items: end;
}

.qr-tools label {
  display: grid;
  gap: 5px;
}

.qr-tools span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.qr-search-result {
  display: grid;
  gap: 8px;
}

.qr-groups {
  display: grid;
  gap: 8px;
}

.qr-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.qr-group summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  cursor: pointer;
  font-weight: 900;
}

.qr-group summary span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.qr-group .qr-grid {
  padding: 10px;
  border-top: 1px solid var(--border);
}

.qr-settings-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  font-weight: 900;
}

.toggle-row input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--primary);
}

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

.qr-settings-grid label {
  display: grid;
  gap: 5px;
}

.qr-settings-grid label > span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.qr-settings-grid small {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.emp-table {
  min-width: 760px;
  table-layout: auto;
}

.emp-table input,
.emp-table select {
  min-width: 100px;
}

.json-area {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86rem;
}

.json-area.small {
  min-height: 120px;
  margin-top: 10px;
}

.backup-file-input {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-main);
}

.muted-text,
.empty-state,
.error-text {
  color: var(--text-muted);
}

.error-text {
  color: var(--danger);
  font-weight: 900;
}

@media (max-width: 700px) {
  .content {
    padding: 8px;
  }

  .footer {
    padding: 8px;
  }

  .scroll-top-btn {
    right: 8px;
  }

  .incomplete-label {
    width: calc(100% - 60px);
    padding: 7px 8px;
    justify-content: flex-start;
    font-size: 0.88rem;
  }

  .guest-request-row {
    grid-template-columns: 1fr;
  }

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

  .qr-settings-grid {
    grid-template-columns: 1fr;
  }

  .qr-manager-head,
  .qr-tools {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .qr-manager-head {
    display: grid;
  }

  .admin-section-head {
    grid-template-columns: 1fr;
  }

  .admin-meal-title {
    align-items: stretch;
    flex-direction: column;
  }

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

  .mini-actions {
    flex-wrap: wrap;
    white-space: normal;
  }

  .nav-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .tabs {
    top: var(--top-nav-height);
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 7mm;
  }

  .top-nav,
  .tabs,
  .footer,
  .input-card,
  .no-print,
  #screen-login,
  #screen-home,
  #screen-admin {
    display: none !important;
  }

  body,
  .app-root,
  .day-screen,
  .tab-content.active {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .tab-content {
    display: none !important;
  }

  .tab-content.print-active {
    display: block !important;
  }

  .matrix-table,
  .matrix-table th,
  .matrix-table td {
    color: #000000 !important;
    background: #ffffff !important;
    border-color: #000000 !important;
  }

  .print-break {
    break-after: page;
    page-break-after: always;
  }

  .last-print-section {
    break-after: auto;
    page-break-after: auto;
  }

  .matrix-container {
    overflow: visible !important;
  }

  .matrix-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  .matrix-table th,
  .matrix-table td,
  .matrix-table th.garnish-head {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    hyphens: auto !important;
  }

  .matrix-table th {
    font-size: 11px !important;
    line-height: 1.15 !important;
  }

  .transfer-row {
    display: none !important;
  }
}
