:root {
  --blue: #05008b;
  --red: #ed1c24;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #f2f4f7;
  --green: #12b76a;
  --danger: #d92d20;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.terminal-shell {
  min-height: 100vh;
  padding: 28px;
}

.operator-screen,
.app-screen {
  margin: 0 auto;
  max-width: 1120px;
}

.app-screen {
  min-height: calc(100vh - 56px);
}

.operator-screen {
  min-height: calc(100vh - 56px);
  align-items: center;
  display: flex;
  justify-content: center;
}

.operator-stack {
  display: grid;
  gap: clamp(34px, 7vh, 74px);
  justify-items: center;
  width: 100%;
}

.brand-logo {
  display: block;
  height: auto;
  max-width: min(520px, 82vw);
  width: 100%;
}

.brand-logo.compact {
  max-width: 270px;
  width: min(270px, 50vw);
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.08);
}

.operator-panel {
  max-width: 520px;
  padding: 34px;
  width: 100%;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.operator-panel h1,
.pin-panel h1 {
  font-size: 30px;
  margin-bottom: 24px;
}

label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.operator-panel input {
  border: 1px solid #cfd4dc;
  border-radius: 6px;
  font-size: 22px;
  padding: 16px;
  width: 100%;
}

.operator-panel button,
.pin-panel button,
.complete-button {
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  padding: 16px 20px;
}

.operator-panel button {
  margin-top: 16px;
  width: 100%;
}

.terminal-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

.terminal-identity {
  align-items: center;
  display: flex;
  gap: 18px;
}

#operatorBadge {
  color: var(--ink);
  display: block;
  font-size: 17px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.operator-summary {
  align-items: center;
  display: flex;
  gap: 10px;
}

.operator-summary small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.operator-icon {
  align-items: center;
  background: #f3f4ff;
  border: 1px solid #d7dcff;
  border-radius: 999px;
  color: var(--blue);
  display: flex;
  flex: 0 0 auto;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.operator-icon svg {
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 24px;
}

.ghost-button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
  padding: 12px 16px;
}

.pin-panel {
  margin-bottom: 24px;
  padding: 28px;
}

#pinForm {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) 220px;
}

#pinInput {
  border: 2px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
  font-size: 68px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  padding: 18px;
  text-align: center;
  width: 100%;
}

.status-message {
  color: var(--muted);
  margin: 14px 0 0;
  text-align: center;
}

.status-message.error {
  color: var(--danger);
  font-weight: 800;
}

.status-message.success {
  color: var(--green);
  font-weight: 800;
}

.order-card {
  min-height: calc(100vh - 120px);
  padding: 30px;
}

.order-card-header {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.order-card h2 {
  font-size: 32px;
  margin: 0;
}

.status-pill {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 999px;
  color: #067647;
  font-weight: 900;
  padding: 8px 12px;
}

.order-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

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

.customer-grid div,
.financial-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
}

.customer-grid span,
.financial-grid span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}

.customer-grid strong,
.financial-grid strong {
  display: block;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.customer-grid {
  grid-template-columns: 2fr 1fr 1fr;
}

.items-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 22px;
  overflow: hidden;
}

.order-item {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 72px 1fr 140px;
  padding: 14px;
}

.order-item + .order-item {
  border-top: 1px solid var(--line);
}

.item-image {
  align-items: center;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  height: 72px;
  justify-content: center;
  overflow: hidden;
  width: 72px;
}

.item-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.item-image::before {
  color: #98a2b3;
  content: "Sem foto";
  font-size: 11px;
}

.item-image:has(img)::before {
  content: "";
}

.order-item h3 {
  font-size: 17px;
  margin: 0 0 4px;
}

.order-item p {
  color: var(--muted);
  margin: 0;
}

.item-meta {
  text-align: right;
}

.item-meta strong,
.item-meta span {
  display: block;
}

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

.total-box {
  background: #f3f4ff;
  border-color: #c7d2fe !important;
}

.complete-button {
  background: var(--green);
  font-size: 20px;
  width: 100%;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .terminal-shell {
    padding: 16px;
  }

  .operator-screen {
    min-height: calc(100svh - 32px);
  }

  .app-screen {
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: center;
    min-height: calc(100svh - 32px);
  }

  .operator-stack {
    gap: 38px;
  }

  .brand-logo {
    max-width: min(430px, 72vw);
  }

  .operator-panel {
    padding: 28px;
  }

  .terminal-header,
  .order-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .terminal-header {
    gap: 14px;
    margin-bottom: 0;
  }

  .terminal-identity {
    align-items: center;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .operator-summary {
    justify-content: center;
  }

  .pin-panel {
    margin-bottom: 0;
    padding: 28px;
  }

  .pin-panel h1 {
    font-size: clamp(21px, 5.1vw, 30px);
    white-space: nowrap;
  }

  .status-message {
    margin-top: 18px;
  }

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

  #pinForm,
  .customer-grid,
  .financial-grid,
  .order-item {
    grid-template-columns: 1fr;
  }

  #pinInput {
    font-size: 52px;
  }

  .item-meta {
    text-align: left;
  }
}
