:root {
  --bg: #f4f8f6;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #5b6b79;
  --line: #d8e1db;
  --brand: #10b86a;
  --brand-strong: #0a9b57;
  --accent: #12d17a;
  --danger: #ef4444;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.08);
}

body[data-theme="dark"] {
  --bg: #0b1210;
  --surface: #121b18;
  --ink: #e8f5ee;
  --muted: #9fb4aa;
  --line: #2a3b34;
  --shadow-soft: 0 14px 35px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background:
    radial-gradient(1200px 600px at -10% -20%, #d9ffe9 0%, transparent 50%),
    radial-gradient(1200px 700px at 120% -10%, #d3f8ff 0%, transparent 52%),
    var(--bg);
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: min(520px, 96vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.auth-card h2 {
  margin: 0;
  font-size: 32px;
}

.auth-card p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.auth-message {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6fffb;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #24563f;
}

.auth-view {
  display: none;
}

.auth-view.is-visible {
  display: block;
}

.auth-form-grid {
  display: grid;
  gap: 10px;
}

.auth-form-grid input,
.auth-form-grid select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.auth-submit-btn {
  height: 48px;
  font-size: 18px;
}

.pin-user-label {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--muted);
  background: #f8fffb;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 19, 13, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  width: min(420px, 96vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.modal-card h3 {
  margin: 0;
  font-size: 24px;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.modal-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 700;
}

.modal-message {
  min-height: 18px;
  font-size: 13px;
  font-weight: 700;
  color: #b42318;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.app {
  width: min(1500px, 96vw);
  margin: 16px auto;
  min-height: calc(100vh - 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.top-nav {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf8 100%);
}

.top-nav-spacer {
  flex: 1 1 auto;
}

.session-user {
  font-size: 15px;
  font-weight: 800;
  color: #0f4b30;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #f4fff9;
}

.pill {
  background: linear-gradient(180deg, var(--accent) 0%, var(--brand) 100%);
  color: #032417;
  border: 1px solid rgba(2, 62, 35, 0.25);
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 6px 14px rgba(16, 184, 106, 0.22);
}

.pill:hover,
.product:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.pill:active,
.product:active {
  transform: translateY(0);
}

.is-active {
  box-shadow:
    0 0 0 3px #0e2f21 inset,
    0 8px 18px rgba(16, 184, 106, 0.3);
}

.pill.large {
  min-width: 145px;
  height: 62px;
  padding: 0 22px;
  font-size: 24px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr);
  min-height: calc(100vh - 150px);
}

.left-panel {
  padding: 14px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.section-line {
  border-bottom: 1px solid var(--line);
}

.category-row {
  display: flex;
  gap: 8px;
  padding: 10px 0;
}

.pill.small {
  min-width: 90px;
  height: 40px;
  padding: 0 14px;
  font-size: 18px;
}

.views-wrap {
  padding: 12px 0 0;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.items-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.product {
  width: 100%;
  min-height: 126px;
  border: 1px solid rgba(2, 62, 35, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, #ecfff5 0%, #dcfbe9 100%);
  color: #052a1b;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 18px rgba(16, 184, 106, 0.2);
  text-align: center;
  padding: 10px;
}

.product .name {
  font-size: 18px;
  line-height: 1.1;
}

.product .price {
  font-size: 14px;
  opacity: 0.9;
}

.product-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px dashed rgba(2, 62, 35, 0.25);
  background: #f8fffb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #3a5b4c;
}

.product-thumb.has-image {
  border-style: solid;
  border-color: rgba(2, 62, 35, 0.2);
  background: #fff;
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.right-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcfa 100%);
}

.divider {
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.divider.top {
  display: none;
}

.order-head {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 33px;
  font-weight: 800;
  background: #f8fbf9;
}

.order-lines {
  min-height: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.line-empty {
  font-size: 30px;
  color: var(--muted);
  font-weight: 700;
}

.line-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-size: 23px;
  font-weight: 700;
  border-bottom: 1px dashed #dbe4de;
  padding: 8px 0;
}

.line-item:last-child {
  border-bottom: none;
}

.line-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.line-controls button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(2, 62, 35, 0.22);
  background: #ddfbe9;
  font-weight: 700;
  cursor: pointer;
}

.totals {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 23px;
  font-weight: 700;
  padding: 3px 0;
}

.total-row.final {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed #dbe4de;
  font-size: 28px;
  color: #0a8e50;
}

.status-box {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 30px;
  font-weight: 700;
  color: #24435f;
  background: #f6faff;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 10px;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fdfb;
}

.manage-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfffd 0%, #f2fbf6 100%);
}

.manage-tools input,
.manage-tools select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
}

.manage-tools input[type="text"] {
  min-width: 0;
}

.manage-tools input[type="number"] {
  width: 100%;
}

.item-photo-upload {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 7px 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.item-photo-upload input[type="file"] {
  font-size: 12px;
}

.item-photo-preview {
  height: 72px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.item-photo-preview.has-image {
  padding: 0;
  overflow: hidden;
}

.item-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#item-save-btn,
#item-clear-btn,
#category-save-btn,
#category-clear-btn {
  min-height: 40px;
}

.table-tools input[type="text"],
.table-tools input[type="number"] {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.table-tools input[type="text"] {
  min-width: 180px;
}

.table-tools input[type="number"] {
  width: 90px;
}

.table-book-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
}

.table-book-check input {
  margin: 0;
}

.table-btn {
  min-width: 0;
  min-height: 120px;
  font-size: 16px;
}

.table-card {
  border: 1px solid rgba(2, 62, 35, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, #ecfff5 0%, #dbf9eb 100%);
  color: #0f2a20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  gap: 6px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(16, 184, 106, 0.22);
}

.table-card.free {
  background: linear-gradient(180deg, #ecfff5 0%, #d9fae9 100%);
  border-color: #57c88f;
}

.table-card.booked {
  background: linear-gradient(180deg, #ffe8e8 0%, #ffd7d7 100%);
  border-color: #e17b7b;
  box-shadow: 0 8px 18px rgba(225, 123, 123, 0.25);
}

.table-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(127, 29, 29, 0.3);
  background: rgba(255, 255, 255, 0.86);
  color: #991b1b;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  cursor: pointer;
}

.table-edit-btn {
  position: absolute;
  top: 8px;
  right: 66px;
  border: 1px solid rgba(14, 116, 144, 0.3);
  background: rgba(255, 255, 255, 0.86);
  color: #0f4c81;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  cursor: pointer;
}

.table-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.table-meta {
  font-size: 14px;
  font-weight: 700;
}

.table-booking {
  border-radius: 999px;
  padding: 3px 10px;
}

.table-booking.booked {
  background: #ffd4d4;
  color: #991b1b;
}

.table-booking.free {
  background: #e8edf1;
  color: #334155;
}

.table-visual {
  width: 58px;
  height: 58px;
  position: relative;
  margin-bottom: 2px;
}

.table-center {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1fd07a 0%, #0faa61 100%);
  border: 2px solid #0b8f50;
  position: absolute;
  top: 11px;
  left: 11px;
  box-shadow: 0 4px 10px rgba(17, 163, 95, 0.35);
}

.table-card.booked .table-center {
  background: linear-gradient(180deg, #ff7d7d 0%, #e04545 100%);
  border-color: #b91c1c;
  box-shadow: 0 4px 10px rgba(185, 28, 28, 0.35);
}

.seat {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a7eac7;
  border: 2px solid #159a5a;
  position: absolute;
}

.table-card.booked .seat {
  background: #ffd0d0;
  border-color: #dc2626;
}

.seat-top {
  top: 0;
  left: 22px;
}

.seat-right {
  top: 22px;
  right: 0;
}

.seat-bottom {
  bottom: 0;
  left: 22px;
}

.seat-left {
  top: 22px;
  left: 0;
}

.table-qr-preview {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  min-height: 42px;
}

.table-qr-preview img {
  width: 140px;
  height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}

.list-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  font-size: 19px;
  font-weight: 700;
  background: #fff;
}

.item-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.item-row-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #f8fffb;
  color: #476455;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.item-row-thumb.has-image {
  border-style: solid;
  overflow: hidden;
  background: #fff;
}

.item-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-row-text {
  display: grid;
  gap: 3px;
}

.item-row-text strong {
  font-size: 16px;
}

.item-row-text small {
  font-size: 12px;
  color: var(--muted);
}

.list-row .mini-actions {
  display: inline-flex;
  gap: 6px;
}

.dashboard-wrap {
  display: grid;
  gap: 12px;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfffd 0%, #eefaf4 100%);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.dashboard-card span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-card strong {
  font-size: 22px;
  color: #0f4b30;
}

.admin-wrap {
  display: grid;
  gap: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfffd 0%, #eefaf4 100%);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.admin-card h4 {
  margin: 0;
  font-size: 20px;
}

.admin-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  font-weight: 700;
}

.admin-connect-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  font-weight: 700;
}

.admin-connect-row strong {
  color: #0f4b30;
}

.mini-pill {
  border: 1px solid rgba(2, 62, 35, 0.2);
  border-radius: 999px;
  background: #d9fbe7;
  color: #073322;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.mini-pill:hover {
  filter: brightness(0.98);
}

.settings-panel {
  width: min(980px, 100%);
  margin: 0 auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(11, 24, 39, 0.08);
  padding: 14px;
}

body[data-theme="dark"] .settings-panel {
  background: linear-gradient(180deg, #14201c 0%, #172722 100%);
}

.settings-header {
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.settings-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.settings-header p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.settings-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbfffc;
}

body[data-theme="dark"] .settings-section-nav {
  background: #15231f;
}

.settings-nav-btn.is-active {
  box-shadow:
    0 0 0 2px #0e2f21 inset,
    0 6px 12px rgba(16, 184, 106, 0.25);
}

.settings-grid {
  display: block;
}

.settings-group {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfffc;
  padding: 10px;
  display: none;
  width: min(900px, 100%);
  margin: 0 auto;
}

.settings-grid .settings-group.is-visible {
  display: block;
}

.settings-group-wide {
  min-width: 0;
}

body[data-theme="dark"] .settings-group {
  background: #13211d;
}

.settings-group h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
}

.settings-box {
  display: grid;
  gap: 9px;
}

.appearance-box,
.printer-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #fcfffd;
}

body[data-theme="dark"] .appearance-box,
body[data-theme="dark"] .printer-box {
  background: #1a2a24;
}

.settings-box label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
}

body[data-theme="dark"] .settings-box label,
body[data-theme="dark"] .order-lines,
body[data-theme="dark"] .totals,
body[data-theme="dark"] .list-row,
body[data-theme="dark"] .order-head {
  background: #16231f;
}

body[data-theme="dark"] .status-box {
  background: #17222c;
  color: #d3eaff;
}

.settings-box input {
  width: 120px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid #c8d5cc;
  border-radius: 10px;
  padding: 6px 8px;
  outline: none;
}

.settings-box select {
  width: 140px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid #c8d5cc;
  border-radius: 10px;
  padding: 6px 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

body[data-theme="dark"] .settings-box input {
  background: #1a2723;
  color: #e9f7ef;
  border-color: #355046;
}

body[data-theme="dark"] .settings-box select {
  background: #1a2723;
  color: #e9f7ef;
  border-color: #355046;
}

.theme-colors {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  background: #fff;
}

.printer-connect-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px;
  background: #fff;
}

body[data-theme="dark"] .printer-connect-row {
  background: #16231f;
}

.printer-box > label,
.printer-builder > label {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.printer-box > label select,
.printer-builder > label input,
.printer-builder > label select {
  width: 100%;
}

.printer-builder > label {
  padding: 8px 10px;
}

.printer-connect-row .mini-pill {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
}

.printer-builder {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 10px;
  background: #fcfffd;
}

body[data-theme="dark"] .printer-builder {
  background: #1a2a24;
}

.printer-categories {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px;
  display: grid;
  gap: 8px;
}

.printer-categories span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.category-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

body[data-theme="dark"] .category-check {
  background: #16231f;
}

.category-check input {
  margin: 0;
}

.printer-profiles {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fcfffd;
}

body[data-theme="dark"] .printer-profiles {
  background: #1a2a24;
}

.printer-profiles h5 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

#saved-printers-location {
  margin: -2px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.printer-profiles .list-row {
  padding: 8px 10px;
  font-size: 14px;
}

.settings-group.settings-group-wide .settings-box label {
  padding: 8px 10px;
}

.printer-profiles .mini-pill {
  font-size: 12px;
  padding: 5px 10px;
}

body[data-theme="dark"] .theme-colors {
  background: #16231f;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.25);
  cursor: pointer;
  padding: 0;
}

.color-swatch[data-color="green"] {
  background: linear-gradient(180deg, #12d17a 0%, #10b86a 100%);
}

.color-swatch[data-color="blue"] {
  background: linear-gradient(180deg, #3bd6ff 0%, #2b9bff 100%);
}

.color-swatch[data-color="purple"] {
  background: linear-gradient(180deg, #b694ff 0%, #7a5cff 100%);
}

.color-swatch[data-color="orange"] {
  background: linear-gradient(180deg, #ffc56f 0%, #ff8b3d 100%);
}

.color-swatch.is-active {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px #0f172a inset;
}

body[data-theme="dark"] .color-swatch.is-active {
  box-shadow: 0 0 0 3px #d8efe4 inset;
}

.settings-box input:focus {
  border-color: #4bc489;
  box-shadow: 0 0 0 3px rgba(75, 196, 137, 0.2);
}

.payment-row {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pill.action {
  min-width: 0;
  height: 60px;
  font-size: 27px;
}

@media (min-width: 1700px) {
  .app {
    width: min(1750px, 95vw);
  }

  .main-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(430px, 1fr);
  }

  .items-row {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  }
}

@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .left-panel {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .right-panel {
    min-height: 420px;
  }
}

@media (max-width: 1180px) and (min-width: 761px) {
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-group-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1024px) {
  .app {
    width: min(1600px, 98vw);
  }

  .pill.large {
    min-width: 120px;
    height: 56px;
    font-size: 20px;
    padding: 0 16px;
  }

  .order-head {
    font-size: 28px;
  }

  .line-item,
  .total-row {
    font-size: 20px;
  }

  .status-box {
    font-size: 24px;
  }
}

@media (max-width: 760px) {
  .app {
    width: 100vw;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .pill.large {
    flex: 0 0 auto;
    min-width: 120px;
    height: 54px;
    font-size: 18px;
  }

  .pill.small {
    min-width: 82px;
    height: 36px;
    font-size: 16px;
  }

  .top-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .top-nav-spacer,
  .session-user,
  #logout-btn {
    flex: 0 0 auto;
  }

  .top-nav::-webkit-scrollbar {
    height: 7px;
  }

  .top-nav::-webkit-scrollbar-thumb {
    background: #cddad1;
    border-radius: 999px;
  }

  .category-row {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .items-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product {
    min-height: 92px;
    border-radius: 20px;
  }

  .product .name {
    font-size: 19px;
  }

  .order-head {
    font-size: 24px;
  }

  .line-item,
  .total-row {
    font-size: 18px;
  }

  .total-row.final {
    font-size: 22px;
  }

  .status-box {
    font-size: 22px;
  }

  .payment-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pill.action {
    height: 52px;
    font-size: 22px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    padding: 10px;
  }

  .settings-box input,
  .settings-box select {
    width: 100%;
  }

  .settings-box label {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .settings-section-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .printer-box > label,
  .printer-builder > label {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .printer-connect-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .manage-tools {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .table-tools input[type="text"],
  .table-tools input[type="number"],
  .table-book-check,
  .table-tools .mini-pill,
  .manage-tools input,
  .manage-tools select,
  .manage-tools .mini-pill {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .left-panel,
  .right-panel {
    padding: 10px;
  }

  .items-row {
    grid-template-columns: 1fr;
  }

  .table-tools {
    grid-template-columns: 1fr;
  }

  .manage-tools {
    grid-template-columns: 1fr;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .payment-row {
    grid-template-columns: 1fr;
  }

  .printer-connect-row {
    grid-template-columns: 1fr;
  }

  .pill.action {
    height: 50px;
    font-size: 20px;
  }
}
