:root {
  --ink: #151515;
  --muted: #6d706c;
  --paper: #fbfbf8;
  --line: #d7d9d1;
  --panel: #ffffff;
  --tomato: #e13d2f;
  --leaf: #147a5c;
  --lemon: #49b548; /* acento da marca Klink (verde) */
  --warn: #f5c518; /* status de atenção / aguardando */
  --brand-green: #49b548;
  --brand-green-deep: #3c9e3c;
  --brand-ink: #20242c;
  --steel: #dee4e2;
  --shadow: 0 20px 50px rgba(18, 18, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(21, 21, 21, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(21, 21, 21, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Bahnschrift", "Aptos", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(16px, 3vw, 36px);
  border-bottom: 2px solid var(--ink);
  background: rgba(251, 251, 248, 0.92);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mascote {
  height: 50px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(18, 18, 18, 0.18));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Rockwell", "Georgia", serif;
  line-height: 1;
}

h1 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

h2 {
  font-size: 1.15rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shift-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.shift-strip span {
  border: 1px solid var(--ink);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 800;
}

.billing-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(21, 21, 21, 0.18);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.billing-pill:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--lemon);
}

.billing-pill:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(21, 21, 21, 0.2);
}

.billing-pill-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(21, 21, 21, 0.12);
}

.billing-pill-dot[data-billing-status="ativo"] {
  background: var(--leaf);
  box-shadow: 0 0 0 3px rgba(20, 122, 92, 0.2);
}

.billing-pill-dot[data-billing-status="aguardando_setup"] {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.35);
}

.billing-pill-dot[data-billing-status="suspenso"],
.billing-pill-dot[data-billing-status="cancelado"] {
  background: var(--tomato);
  box-shadow: 0 0 0 3px rgba(225, 61, 47, 0.25);
}

.billing-pill-value {
  font-size: 1rem;
}

.billing-pill-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.billing-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(21, 21, 21, 0.38);
  backdrop-filter: blur(2px);
  animation: billing-fade 0.18s ease;
}

.billing-backdrop[hidden],
.billing-drawer[hidden] {
  display: none;
}

.billing-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 20px 28px;
  border-left: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: -14px 0 40px rgba(18, 18, 18, 0.22);
  overflow-y: auto;
  animation: billing-slide 0.22s ease;
}

@keyframes billing-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes billing-slide {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.billing-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

.billing-close {
  width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
  background: var(--panel);
  color: var(--ink);
}

.billing-close:hover {
  background: var(--lemon);
}

.billing-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.billing-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--steel);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.billing-badge[data-billing-status="ativo"] {
  background: #bfeee0;
}

.billing-badge[data-billing-status="aguardando_setup"] {
  background: var(--warn);
}

.billing-badge[data-billing-status="suspenso"],
.billing-badge[data-billing-status="cancelado"] {
  background: #ffb6ad;
}

.billing-status-line {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  flex: 1 1 160px;
}

.billing-card {
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 5px 5px 0 rgba(21, 21, 21, 0.18);
}

.billing-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}

.billing-currency {
  font-family: "Rockwell", "Georgia", serif;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--muted);
}

.billing-amount-value {
  font-family: "Rockwell", "Georgia", serif;
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
}

.billing-period {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.billing-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.billing-breakdown strong {
  display: block;
  margin-top: 2px;
  font-family: "Rockwell", "Georgia", serif;
  font-size: 1.2rem;
}

.billing-setup {
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--warn);
}

.billing-setup-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.billing-setup-row strong {
  font-family: "Rockwell", "Georgia", serif;
  font-size: 1.4rem;
}

.billing-setup-status {
  padding: 4px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.billing-setup-note {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.billing-invoices-head {
  margin-bottom: 10px;
}

.billing-invoices-list {
  display: grid;
  gap: 8px;
}

.billing-invoice-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
}

.billing-invoice-period {
  font-family: "Rockwell", "Georgia", serif;
  font-weight: 900;
  text-transform: uppercase;
}

.billing-invoice-detail {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.billing-invoice-value {
  font-family: "Rockwell", "Georgia", serif;
  font-weight: 900;
}

.billing-invoice-status {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 2px 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--steel);
}

.billing-invoice-status[data-invoice-status="paga"] {
  background: #bfeee0;
}

.billing-invoice-status[data-invoice-status="aberta"] {
  background: var(--warn);
}

.billing-invoice-status[data-invoice-status="enviada"] {
  background: #cfe4ff;
}

.billing-invoice-status[data-invoice-status="cancelada"] {
  background: #ffb6ad;
}

.shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 22px;
  padding: 22px clamp(14px, 3vw, 36px) 36px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.photo-slab {
  min-height: 180px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(rgba(21, 21, 21, 0.05), rgba(21, 21, 21, 0.25)),
    url("https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?auto=format&fit=crop&w=900&q=80");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.demo-console,
.tables,
.pending-band,
.sector {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 5px 5px 0 rgba(21, 21, 21, 0.18);
}

.demo-console,
.tables {
  padding: 16px;
}

label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

button {
  min-height: 38px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--lemon);
}

pre {
  white-space: pre-wrap;
  min-height: 90px;
  margin: 14px 0 0;
  border-left: 4px solid var(--tomato);
  padding: 10px 12px;
  background: #f4f5ef;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.table-pill {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
}

.table-pill strong {
  font-size: 1.1rem;
}

.table-pill span {
  color: var(--muted);
  font-size: 0.72rem;
}

.table-pill a {
  color: var(--ink);
  text-decoration: none;
}

.table-pill .table-close {
  min-height: 26px;
  margin-top: 4px;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}

.table-pill .table-close:hover {
  color: var(--tomato);
  border-color: var(--tomato);
  box-shadow: none;
  transform: none;
}

.ops-board {
  min-width: 0;
}

.alert-band {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--tomato);
  color: #fff;
  font-weight: 900;
  padding: 12px 16px;
  margin-bottom: 14px;
  animation: alert-pulse 1.2s ease-in-out infinite alternate;
}

.alert-band--warn {
  background: var(--warn);
  color: var(--ink);
}

@keyframes alert-pulse {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.75;
  }
}

.pending-band {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #fff 0%, #fff 64%, rgba(73, 181, 72, 0.22) 64%);
}

.pending-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  min-height: 42px;
}

.pending-chip {
  flex: 0 0 240px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
}

.sector {
  min-height: 560px;
  overflow: hidden;
}

.sector-head {
  padding: 14px;
  border-bottom: 2px solid var(--ink);
}

.sector[data-sector="bar"] .sector-head {
  background: var(--lemon);
}

.sector[data-sector="cozinha"] .sector-head {
  background: #ffb6ad;
}

.sector[data-sector="salao"] .sector-head {
  background: #bfeee0;
}

.sector[data-sector="caixa"] .sector-head {
  background: var(--steel);
}

.tickets {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.ticket {
  position: relative;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 3px 3px 0 rgba(21, 21, 21, 0.12);
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.ticket::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  border-radius: 7px 0 0 7px;
  background: var(--tomato);
}

.ticket[data-status="novo"]::before,
.ticket[data-status="nova"]::before {
  background: var(--ink);
}

.ticket[data-status="em_preparo"]::before,
.ticket[data-status="em_atendimento"]::before {
  background: #f0a830;
}

.ticket[data-status="pronto"]::before {
  background: #f5c518;
}

.ticket[data-status="entregue"]::before,
.ticket[data-status="concluida"]::before {
  background: var(--leaf);
}

.ticket[data-status="cancelado"]::before,
.ticket[data-status="cancelada"]::before {
  background: var(--muted);
}

.ticket[data-status="pronto"] {
  background: #fff7d6;
  border-color: #c08b00;
}

.ticket[data-status="pronto"] .status {
  color: #8a6300;
}

.ticket[data-status="novo"],
.ticket[data-status="nova"] {
  animation: ticket-pulse 1.8s ease-in-out infinite;
}

@keyframes ticket-pulse {
  0%, 100% {
    box-shadow: 3px 3px 0 rgba(21, 21, 21, 0.12);
  }
  50% {
    box-shadow: 3px 3px 0 rgba(21, 21, 21, 0.12), 0 0 0 3px rgba(225, 61, 47, 0.2);
  }
}

.ticket[data-status="entregue"],
.ticket[data-status="concluida"] {
  opacity: 0.55;
}

.ticket[data-status="cancelado"],
.ticket[data-status="cancelada"] {
  opacity: 0.45;
  text-decoration: line-through;
}

.ticket .elapsed {
  font-weight: 700;
  color: var(--muted);
}

.ticket[data-elapsed="warn"] .elapsed {
  color: #c97800;
}

.ticket[data-elapsed="late"] .elapsed {
  color: var(--tomato);
}

.ticket[data-elapsed="late"] {
  border-color: var(--tomato);
  border-width: 2px;
  padding: 11px;
}

@media (prefers-reduced-motion: reduce) {
  .ticket[data-status="novo"],
  .ticket[data-status="nova"] {
    animation: none;
  }
}

.ticket-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  padding-left: 8px;
}

.mesa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.ticket h3 {
  margin: 10px 0 6px;
  padding-left: 8px;
  font-size: 1rem;
  line-height: 1.15;
}

.ticket p {
  margin: 0;
  padding-left: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status {
  color: var(--leaf);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-top: 12px;
  padding-left: 8px;
}

.actions button {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 800;
}

.actions button.secondary {
  min-width: 38px;
  padding: 6px 10px;
  font-size: 1rem;
  color: var(--muted);
  background: #fff;
}

.actions button.secondary:hover {
  color: var(--tomato);
  border-color: var(--tomato);
}

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

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

  .side-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1fr);
  }

  .tables {
    grid-column: 1 / -1;
  }

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

@media (max-width: 720px) {
  .topbar,
  .pending-band {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .shift-strip {
    justify-content: flex-start;
  }

  .side-panel,
  .columns {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .billing-drawer {
    width: 100vw;
    padding: 18px 16px 24px;
  }
}

/* ===== Logo da marca Klink (wordmark vetorial) ===== */
.klink-logo {
  display: inline-flex;
  align-items: center;
  font-family: "Fredoka", "Baloo 2", "Quicksand", "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--brand-ink);
  white-space: nowrap;
}

.klink-logo .kdot {
  position: relative;
}

.klink-logo .kdot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.30em;
  transform: translateX(-50%);
  width: 0.30em;
  height: 0.30em;
  border-radius: 50%;
  background: var(--brand-green);
}

.klink-logo--sm {
  font-size: 1.2rem;
}

.klink-logo--on-dark {
  color: #ffffff;
}

/* ===== Atalhos de navegação no topo do painel ===== */
.topnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.86rem;
  text-decoration: none;
  box-shadow: 3px 3px 0 rgba(21, 21, 21, 0.16);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.topnav a:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--brand-green);
}

