:root {
  --ink: #17202a;
  --muted: #64748b;
  --line: #d7dee8;
  --paper: #f7f9fc;
  --surface: #ffffff;
  --brand: #155e63;
  --brand-strong: #0f3f46;
  --accent: #c2410c;
  --green: #15803d;
  --warning: #b45309;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.side-nav {
  background: #111827;
  color: #f8fafc;
  padding: 18px 14px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.brand-mark span {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #ffffff !important;
  font-weight: 800;
}

.nav-button {
  width: 100%;
  margin: 4px 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 6px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-button.active,
.nav-button:hover {
  color: #ffffff;
  background: #1f2937;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

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

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.order-modes {
  display: flex;
  gap: 8px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: #edf2f7;
}

.mode-button,
.secondary-button,
.primary-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.mode-button.active,
.primary-button {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.secondary-button:hover,
.mode-button:hover,
.icon-button:hover {
  border-color: #9fb0c4;
  background: #f1f5f9;
}

.pos-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 170px 1fr 370px;
}

.category-list {
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: #eef3f6;
}

.category-button {
  width: 100%;
  margin-bottom: 8px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #334155;
  text-align: left;
  cursor: pointer;
}

.category-button.active,
.category-button:hover {
  border-color: #a8bfca;
  background: #ffffff;
  color: var(--brand-strong);
}

.menu-panel {
  min-width: 0;
  padding: 16px;
  overflow: auto;
}

.menu-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.menu-tools input {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.menu-item {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  border-color: #92a9b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.menu-item strong {
  line-height: 1.25;
}

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

.menu-item .price {
  color: var(--accent);
  font-weight: 800;
}

.ticket-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.ticket-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
}

.order-lines {
  flex: 1;
  overflow: auto;
  padding: 12px 16px;
}

.empty-order {
  color: var(--muted);
  padding: 24px 0;
  text-align: center;
}

.order-line {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.line-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
}

.line-main button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.modifiers {
  margin: 5px 0 0 36px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  list-style: none;
}

.totals {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.totals div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.grand-total {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 20px;
}

.ticket-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.print-preview {
  max-height: 180px;
  margin: 0;
  padding: 12px 16px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
}

.customizer {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.32);
}

.customizer::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.customizer form {
  padding: 18px;
}

.customizer header,
.customizer footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customizer h2 {
  margin: 0;
}

.customizer label,
.customizer fieldset {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  border: 0;
  padding: 0;
}

.customizer select,
.customizer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
}

.choice-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

  .side-nav {
    display: none;
  }

  .pos-grid {
    grid-template-columns: 140px 1fr;
  }

  .ticket-panel {
    grid-column: 1 / -1;
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  .topbar,
  .menu-tools,
  .pos-grid {
    display: block;
  }

  .top-actions {
    margin-top: 10px;
  }

  .category-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
  }

  .category-button {
    min-width: max-content;
  }

  .menu-tools input,
  .menu-tools button {
    width: 100%;
    margin-bottom: 8px;
  }
}

