/* ==========================================================================
   XP LOBBY - CLEAN DARK & MOBILE-FIRST DESIGN SYSTEM
   Especificação exata:
   - Fundo: #0A0D12 / #0D1117
   - Cards e Gavetas: #161B22 / #21262D
   - Bordas: #30363D
   - Livre/Disponível: #238636 / #2EA043
   - Em Jogo/Ativo: #1F6FEB / #388BFD
   - Reta Final (<5 min): #D29922
   - Tempo Esgotado: #DA3633 (com pulsação vibrante)
   ========================================================================== */

:root {
  --bg-deep: #0A0D12;
  --bg-main: #0D1117;
  --surface-card: #161B22;
  --surface-elevated: #21262D;
  --surface-hover: #2B313A;
  --border-subtle: #30363D;
  --border-active: #484F58;

  --text-main: #F0F6FC;
  --text-muted: #8B949E;
  --text-dim: #6E7681;

  --color-green: #2EA043;
  --color-green-bg: rgba(46, 160, 67, 0.15);
  --color-blue: #388BFD;
  --color-blue-bg: rgba(56, 139, 253, 0.15);
  --color-amber: #D29922;
  --color-amber-bg: rgba(210, 153, 34, 0.15);
  --color-red: #DA3633;
  --color-red-bg: rgba(218, 54, 51, 0.18);
  --color-purple: #BC8CFF;
  --color-purple-bg: rgba(188, 140, 255, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, 0.7);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   MINIMALIST ICON UTILITIES & STATUS DOTS
   ========================================================================== */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  stroke: currentColor;
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.livre { background-color: var(--color-green); box-shadow: 0 0 6px var(--color-green); }
.status-dot.em-jogo { background-color: var(--color-blue); box-shadow: 0 0 6px var(--color-blue); }
.status-dot.esgotado { background-color: var(--color-red); box-shadow: 0 0 6px var(--color-red); }
.status-dot.manutencao { background-color: var(--text-dim); }

/* ==========================================================================
   HEADER & TOP BAR
   ========================================================================== */
.app-header {
  background-color: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1F6FEB, #BC8CFF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  color: #fff;
  box-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
  flex-shrink: 0;
}

.brand-title {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--text-main);
  line-height: 1.1;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-status-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.clock-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-deep);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: none;
}

@media (min-width: 680px) {
  .clock-badge { display: block; }
}

.btn-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.btn-icon:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-active);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-elevated);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  flex-shrink: 0;
}

.user-badge .role-tag {
  background-color: var(--color-purple-bg);
  color: var(--color-purple);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .header-inner {
    padding: 6px 10px;
    gap: 6px;
  }
  .brand-logo {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-subtitle {
    display: none;
  }
  #current-user-name {
    display: none !important; /* Oculta nome longo em smartphones para evitar quebrar a largura */
  }
  .btn-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
  .header-status-group {
    gap: 4px;
  }
  .user-badge {
    padding: 3px 6px;
    gap: 4px;
    font-size: 11px;
  }
  .user-badge .role-tag {
    padding: 2px 4px;
    font-size: 9px;
  }
}

/* ==========================================================================
   NAVIGATION BAR (TABS)
   ========================================================================== */
.app-nav {
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  white-space: nowrap;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  padding: 4px 16px;
  gap: 8px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background-color: var(--surface-card);
}

.nav-tab.active {
  color: var(--text-main);
  background-color: var(--surface-elevated);
  box-shadow: inset 0 -2px 0 var(--color-blue);
}

.nav-tab .badge {
  background-color: var(--color-blue-bg);
  color: var(--color-blue);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.main-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ==========================================================================
   STATION CARDS GRID & ARENA
   ========================================================================== */
.arena-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .arena-controls {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-pill {
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 20px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.filter-pill:hover,
.filter-pill.active {
  color: var(--text-main);
  background-color: var(--surface-elevated);
  border-color: var(--border-active);
}

.filter-pill.active {
  border-color: var(--color-blue);
}

/* Grid Responsivo: 1 col celular, 2 col tablet, 3-4 col desktop */
.stations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .stations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stations-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .stations-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   STATION CARD
   ========================================================================== */
.station-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.station-card:hover {
  border-color: var(--border-active);
}

/* Card Status Modifier */
.station-card.status-DISPONIVEL {
  border-left: 5px solid var(--color-green);
}

.station-card.status-EM_USO {
  border-left: 5px solid var(--color-blue);
}

.station-card.status-WARNING {
  border-left: 5px solid var(--color-amber);
  background: linear-gradient(180deg, rgba(210, 153, 34, 0.05) 0%, var(--surface-card) 100%);
}

.station-card.status-ESGOTADO {
  border-left: 5px solid var(--color-red);
  background: linear-gradient(180deg, rgba(218, 54, 51, 0.12) 0%, var(--surface-card) 100%);
  animation: pulseCard 1.8s infinite;
}

.station-card.status-MANUTENCAO {
  border-left: 5px solid var(--text-dim);
  opacity: 0.7;
}

@keyframes pulseCard {
  0% { box-shadow: 0 0 0 0 rgba(218, 54, 51, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(218, 54, 51, 0); }
  100% { box-shadow: 0 0 0 0 rgba(218, 54, 51, 0); }
}

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

.hardware-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-elevated);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status-badge.DISPONIVEL {
  background-color: var(--color-green-bg);
  color: var(--color-green);
  border: 1px solid var(--color-green);
}

.status-badge.EM_USO {
  background-color: var(--color-blue-bg);
  color: var(--color-blue);
  border: 1px solid var(--color-blue);
}

.status-badge.WARNING {
  background-color: var(--color-amber-bg);
  color: var(--color-amber);
  border: 1px solid var(--color-amber);
  animation: blinkWarn 1s infinite alternate;
}

.status-badge.ESGOTADO {
  background-color: var(--color-red-bg);
  color: var(--color-red);
  border: 1px solid var(--color-red);
  animation: blinkAlert 0.8s infinite alternate;
}

.status-badge.MANUTENCAO {
  background-color: rgba(110, 118, 129, 0.2);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

.status-badge.AGUARDANDO_PLAY {
  background: linear-gradient(90deg, rgba(188, 140, 255, 0.2) 0%, rgba(31, 111, 235, 0.2) 100%);
  color: var(--color-purple);
  border: 1px solid var(--color-purple);
  animation: blinkPlay 1.5s infinite alternate;
}

@keyframes blinkPlay {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.85; transform: scale(1.02); }
}

@keyframes blinkAlert {
  0% { opacity: 1; }
  100% { opacity: 0.35; }
}

@keyframes blinkWarn {
  0% { opacity: 1; }
  100% { opacity: 0.55; }
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.card-station-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.card-station-rate {
  font-size: 12px;
  color: var(--text-muted);
}

/* Card Body (Active Session info) */
.card-session-info {
  background-color: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-subtle);
}

.player-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-name-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-phone {
  font-size: 11px;
  color: var(--text-muted);
}

/* Big Digital Timer Display */
.timer-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.timer-digits {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
}

.timer-digits.EM_USO { color: var(--color-blue); }
.timer-digits.WARNING { color: var(--color-amber); }
.timer-digits.ESGOTADO { color: var(--color-red); }
.timer-digits.AGUARDANDO_PLAY { color: var(--color-purple); }

.timer-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-deep);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s linear;
}

.progress-bar-fill.EM_USO { background-color: var(--color-blue); }
.progress-bar-fill.WARNING { background-color: var(--color-amber); }
.progress-bar-fill.ESGOTADO { background-color: var(--color-red); }
.progress-bar-fill.AGUARDANDO_PLAY { background: linear-gradient(90deg, var(--color-purple), var(--color-blue)); }

.timer-sub-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 6px;
  font-size: 11px;
}

.elapsed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-blue);
  background-color: var(--color-blue-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.contract-badge {
  color: var(--text-dim);
  font-size: 11px;
}

.card-comanda-totals {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  gap: 6px;
  flex-wrap: wrap;
}

.comanda-metric-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.comanda-metric-col .metric-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comanda-metric-col .metric-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.comanda-metric-col.highlight {
  text-align: right;
}

.comanda-metric-col.highlight .metric-title {
  color: var(--color-green);
  font-weight: 700;
}

.comanda-total-tag {
  font-weight: 800;
  font-size: 15px;
  color: var(--color-green);
  font-family: var(--font-mono);
}

.card-rate-hint {
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
  margin-top: -2px;
}

/* Card Action Buttons (Alvos de toque >= 48px) */
.card-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-actions-grid.single {
  grid-template-columns: 1fr;
}

.btn-card-action {
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--border-subtle);
  background-color: var(--surface-elevated);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-card-action:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-active);
}

.btn-card-action.primary {
  background-color: var(--color-green);
  border-color: var(--color-green);
  color: #fff;
}

.btn-card-action.primary:hover {
  background-color: #268936;
}

.btn-card-action.danger {
  background-color: var(--color-red);
  border-color: var(--color-red);
  color: #fff;
}

.btn-card-action.danger:hover {
  background-color: #b92e2b;
}

/* ==========================================================================
   BOTTOM SHEETS & MODALS (MOBILE-FIRST)
   ========================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
}

.sheet-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  overflow: hidden;
  box-sizing: border-box;
  margin: auto;
  position: relative;
}

.sheet-backdrop.active .bottom-sheet {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.bottom-sheet form {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
}

@media (max-width: 480px) {
  .sheet-backdrop {
    padding: 10px;
  }
  .bottom-sheet {
    max-height: 94vh;
    border-radius: var(--radius-lg);
  }
}

.sheet-handle-bar {
  width: 40px;
  height: 4px;
  background-color: var(--border-subtle);
  border-radius: 2px;
  margin: 8px auto 0;
  flex-shrink: 0;
}

.sheet-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  gap: 8px;
}

.sheet-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.sheet-body {
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.sheet-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--surface-elevated);
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.sheet-footer .btn,
.sheet-footer button.btn {
  width: auto !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  padding: 10px 8px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ==========================================================================
   INPUTS & FORM CONTROLS
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input,
.form-select {
  min-height: 48px;
  background-color: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s ease;
  width: 100%;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.2);
}

/* Preset Buttons Grid */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.preset-btn {
  min-height: 48px;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-active);
}

.preset-btn.active {
  background-color: var(--color-blue-bg);
  border-color: var(--color-blue);
  color: var(--color-blue);
}

/* Product PDV Selector in Drawer */
.pdv-categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pdv-cat-btn {
  min-height: 40px;
  padding: 4px 12px;
  border-radius: 18px;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.pdv-cat-btn.active {
  background-color: var(--color-blue-bg);
  color: var(--color-blue);
  border-color: var(--color-blue);
}

.pdv-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.pdv-prod-card {
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 80px;
}

.pdv-prod-card:hover {
  border-color: var(--border-active);
  background-color: var(--surface-hover);
}

.pdv-prod-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.pdv-prod-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-green);
}

.comanda-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.comanda-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--bg-deep);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
}

.item-delete-btn {
  background: transparent;
  border: none;
  color: var(--color-red);
  cursor: pointer;
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   CHECKOUT & LIQUIDATION RECEIPT
   ========================================================================== */
.checkout-summary-box {
  background-color: var(--bg-deep);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.summary-row.total-row {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--color-green);
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.payment-method-card {
  min-height: 52px;
  border: 1px solid var(--border-subtle);
  background-color: var(--surface-elevated);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.payment-method-card:hover {
  background-color: var(--surface-hover);
}

.payment-method-card.active {
  border-color: var(--color-blue);
  background-color: var(--color-blue-bg);
  color: var(--color-blue);
}

/* PIX Box */
.pix-box {
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.pix-qr-img {
  width: 170px;
  height: 170px;
  background-color: #fff;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.pix-key-display {
  font-family: var(--font-mono);
  font-size: 13px;
  background-color: var(--bg-deep);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  width: 100%;
  word-break: break-all;
}

/* ==========================================================================
   BUTTONS SYSTEM
   ========================================================================== */
.btn {
  min-height: 48px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  width: 100%;
}

.btn-primary {
  background-color: var(--color-blue);
  color: #fff;
}
.btn-primary:hover {
  background-color: #2b77e8;
}

.btn-success {
  background-color: var(--color-green);
  color: #fff;
}
.btn-success:hover {
  background-color: #268936;
}

.btn-secondary {
  background-color: var(--surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-active);
}

.btn-danger {
  background-color: var(--color-red);
  color: #fff;
}
.btn-danger:hover {
  background-color: #b92e2b;
}

/* ==========================================================================
   TABLES & LISTS
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--surface-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.data-table th {
  background-color: var(--surface-elevated);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: var(--surface-elevated);
}

/* ==========================================================================
   LOGIN SCREEN OVERLAY
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #161B22 0%, #0A0D12 100%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1F6FEB, #BC8CFF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 0 25px rgba(88, 166, 255, 0.5);
}

.auth-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.auth-chip {
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-chip:hover {
  color: var(--text-main);
  border-color: var(--border-active);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 20px;
  left: 20px;
  max-width: 380px;
  margin: 0 auto;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 640px) {
  .toast-container {
    left: auto;
    right: 24px;
  }
}

.toast {
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.25s ease forwards;
  pointer-events: auto;
}

.toast.success { border-left: 4px solid var(--color-green); }
.toast.error { border-left: 4px solid var(--color-red); }
.toast.warning { border-left: 4px solid var(--color-amber); }
.toast.info { border-left: 4px solid var(--color-blue); }

@keyframes slideInToast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   PRINT STYLES (CUPOM TÉRMICO)
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  #thermal-receipt-modal,
  #thermal-receipt-modal * {
    visibility: visible;
  }
  #thermal-receipt-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: none !important;
    font-size: 12px;
  }
  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   LISTA DE ESPERA (FILA DA ESTAÇÃO)
   ========================================================================== */
.waitlist-card-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(188, 140, 255, 0.15) 0%, rgba(31, 111, 235, 0.1) 100%);
  border: 1px solid rgba(188, 140, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-main);
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.waitlist-card-badge:hover {
  background: linear-gradient(90deg, rgba(188, 140, 255, 0.25) 0%, rgba(31, 111, 235, 0.2) 100%);
  border-color: var(--color-purple);
}

.waitlist-card-badge .proximo-tag {
  font-weight: 700;
  color: var(--color-purple);
}

.queue-items-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.queue-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  gap: 10px;
}

.queue-position-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--color-purple-bg);
  color: var(--color-purple);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.queue-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.queue-item-name {
  font-weight: 700;
  font-size: 14px;
}

.queue-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.checkout-waitlist-banner {
  background: linear-gradient(135deg, rgba(188, 140, 255, 0.2) 0%, rgba(56, 139, 253, 0.2) 100%);
  border: 1px solid var(--color-purple);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

/* ==========================================================================
   CHECKOUT BILLING OPTIONS (PRO-RATA / ANTECIPADA)
   ========================================================================== */
.billing-mode-container {
  width: 100%;
  box-sizing: border-box;
}

.billing-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 360px) {
  .billing-options-grid {
    grid-template-columns: 1fr;
  }
}

.billing-option-card {
  background-color: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
  user-select: none;
}

.billing-option-card:hover {
  border-color: var(--border-active);
  background-color: var(--surface-hover);
}

.billing-option-card.active {
  border-color: var(--color-blue);
  background-color: rgba(56, 139, 253, 0.1);
  box-shadow: 0 0 0 1px var(--color-blue);
}

.opt-radio-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: inline-block;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.billing-option-card.active .custom-radio {
  border-color: var(--color-blue);
  background-color: var(--color-blue);
  box-shadow: inset 0 0 0 2px var(--bg-deep);
}

.badge-tag-sm {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--color-green-bg);
  color: var(--color-green);
  align-self: flex-start;
  margin-top: 4px;
}

.badge-tag-sm.muted {
  background-color: rgba(110, 118, 129, 0.2);
  color: var(--text-muted);
}

/* ==========================================================================
   AGUARDANDO PLAY & TRANSIÇÃO DE FILA
   ========================================================================== */
.waiting-play-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(188, 140, 255, 0.15) 0%, rgba(56, 139, 253, 0.1) 100%);
  border: 1px solid var(--color-purple);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  gap: 10px;
  margin-top: 4px;
}

.waiting-play-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.waiting-play-text strong {
  font-size: 12px;
  color: var(--color-purple);
}

.waiting-play-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-dar-play-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: var(--color-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(46, 160, 67, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-dar-play-action:hover {
  background-color: #2ea043;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 160, 67, 0.45);
}

.btn-dar-play-action:active {
  transform: translateY(0);
}

.btn-card-action.success {
  background-color: var(--color-green-bg);
  border-color: var(--color-green);
  color: var(--color-green);
  font-weight: 800;
}

.btn-card-action.success:hover {
  background-color: var(--color-green);
  color: #fff;
}


