/* ==============================================================================
   MESANEXO — BAR MANAGEMENT
   Design System Fiel ao Protótipo Figma (Desktop-First)
   ============================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Paleta Base Figma */
  --bg-body: #f4f6fb;
  --bg-card: #ffffff;
  --bg-sidebar: #152238;
  --bg-sidebar-hover: #1c2b44;

  /* Tipografia & Cores */
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Branding Figma Laranja */
  --orange-figma: #f36c21;
  --orange-figma-hover: #dc5b14;
  --orange-light: #fef7ea;
  --orange-border: #fed7aa;

  /* Status Colors */
  --green-main: #10b981;
  --green-dark: #059669;
  --green-light: #e6f9f0;
  --green-border: #a7f3d0;

  --blue-main: #3b82f6;
  --blue-dark: #0284c7;
  --blue-light: #e0f2fe;
  --blue-border: #bae6fd;

  --yellow-main: #f59e0b;
  --yellow-dark: #d97706;
  --yellow-light: #fef3c7;
  --yellow-border: #fde68a;

  --red-main: #ef4444;
  --red-dark: #dc2626;
  --red-light: #fef2f2;
  --red-border: #fecaca;

  /* Raios e Sombras */
  --radius-card: 12px;
  --radius-pill: 20px;
  --radius-btn: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 8px 18px -2px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  color: var(--text-dark);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==============================================================================
   LAYOUT PRINCIPAL DESKTOP (FIXED SIDEBAR + BLOCK CONTENT)
   ============================================================================== */
.body-app {
  min-height: 100vh;
  position: relative;
  background-color: var(--bg-body);
}

/* SIDEBAR FIXA LATERAL (240px) */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background-color: var(--bg-sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.75rem 1.5rem 1.4rem;
}

.logo-box {
  width: 38px;
  height: 38px;
  background-color: var(--orange-figma);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.logo-box svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: #8da2bb;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* MENU VERTICAL */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0.85rem;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  color: #9cb0c5;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

/* ITEM ATIVO: LARANJA FIGMA */
.nav-link.active {
  background-color: var(--orange-figma) !important;
  color: #ffffff !important;
  font-weight: 700;
}

.nav-link.active .nav-icon {
  stroke: #ffffff;
  color: #ffffff;
}

.nav-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

/* RODAPÉ DO USUÁRIO */
.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: #8da2bb;
  font-weight: 500;
}

.logout-form {
  margin: 0;
}

.logout-btn {
  background: none;
  border: none;
  color: #8da2bb;
  padding: 0.35rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ff6b6b;
}

.logout-btn svg {
  width: 18px;
  height: 18px;
}

/* CONTEÚDO PRINCIPAL (DESKTOP) */
.main-content {
  margin-left: 240px;
  min-height: 100vh;
  background-color: var(--bg-body);
  padding: 2.25rem 2.75rem;
  box-sizing: border-box;
}

.page-body {
  width: 100%;
}

/* ==============================================================================
   MENSAGENS & ALERTAS
   ============================================================================== */
.messages-stack {
  margin-bottom: 1.5rem;
}

.alert, .aviso {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.alert-success, .aviso.success {
  background-color: var(--green-light);
  color: var(--green-dark);
  border: 1px solid var(--green-border);
}

.alert-error, .aviso-error, .aviso.error {
  background-color: var(--red-light);
  color: var(--red-dark);
  border: 1px solid var(--red-border);
}

.alert-info {
  background-color: var(--blue-light);
  color: var(--blue-dark);
  border: 1px solid var(--blue-border);
}

.alert-icon, .icone-aviso {
  font-weight: 800;
  font-size: 1.1rem;
}

/* ==============================================================================
   CABEÇALHOS DE PÁGINA
   ============================================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.page-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.page-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* LEGENDA DE STATUS INLINE (FIGMA PROTÓTIPO 4) */
.status-legend-inline {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-body);
}

.status-legend {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: white;
  padding: 0.65rem 1.25rem;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot, .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-free { background-color: var(--green-main); }
.dot-busy { background-color: var(--blue-main); }
.dot-waiting { background-color: var(--yellow-main); }
.dot-muted { background-color: var(--text-subtle); }

/* ==============================================================================
   TELA DE MESAS (PROTÓTIPO 4 FIGMA) — 4 COLUNAS EM DESKTOP
   ============================================================================== */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.table-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 165px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.table-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* BORDA DESTACADA PARA AGUARDANDO PAGAMENTO */
.table-card-waiting {
  border: 2px solid var(--yellow-main) !important;
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.table-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
}

/* BADGES DE STATUS COM BOLINHA */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  letter-spacing: 0.4px;
}

.pill-free {
  background-color: var(--green-light);
  color: var(--green-dark);
}

.pill-busy {
  background-color: var(--blue-light);
  color: #0369a1;
}

.pill-waiting {
  background-color: var(--yellow-light);
  color: var(--yellow-dark);
}

.pill-muted {
  background-color: var(--border-light);
  color: var(--text-muted);
}

.table-card-body {
  flex-grow: 1;
}

.table-desc {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-start-order {
  margin: 0;
}

.btn-start-order {
  background: none;
  border: none;
  color: var(--orange-figma);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.btn-start-order:hover {
  color: var(--orange-figma-hover);
  text-decoration: underline;
}

.order-code {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-dark);
}

.order-time {
  margin: 0.2rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--text-subtle);
}

.link-order-details {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--blue-main);
}

.link-order-details:hover {
  text-decoration: underline;
}

.waiting-amount {
  margin: 0.2rem 0 0.85rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--yellow-dark);
  letter-spacing: -0.5px;
}

.link-settle {
  color: var(--yellow-dark) !important;
}

.table-card-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.link-admin-action {
  font-size: 0.78rem;
  color: var(--text-subtle);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.link-admin-action:hover {
  color: var(--text-dark);
  text-decoration: underline;
}

.link-danger:hover {
  color: var(--red-dark);
}

.empty-state-card {
  grid-column: 1 / -1;
  background: white;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-card);
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

/* ==============================================================================
   TELA DE CAIXA DO DIA (PROTÓTIPO 2 FIGMA) — 5 COLUNAS EM DESKTOP
   ============================================================================== */
.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-body);
}

.badge-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.15rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 105px;
}

.kpi-card-highlight {
  background-color: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.kpi-label-green {
  color: #059669 !important;
}

.kpi-number {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.kpi-number-green {
  color: #059669 !important;
}

.kpi-caption {
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-top: 0.4rem;
}

.kpi-caption-green {
  color: #059669 !important;
}

/* ==============================================================================
   TABELAS MODERNAS (ESTILO FIGMA)
   ============================================================================== */
.content-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.table-section {
  padding: 0;
  overflow: hidden;
}

.section-header {
  padding: 1.35rem 1.75rem 1rem;
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
}

.table-responsive {
  overflow-x: auto;
}

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

.data-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-body);
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.row-inactive {
  opacity: 0.6;
  background-color: #fafbfc;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-bold { font-weight: 700; color: var(--text-dark); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--red-dark); }

.table-code-link {
  font-weight: 800;
  color: var(--orange-figma);
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.product-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background-color: #f8fafc;
  flex-shrink: 0;
}

.product-thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* WIDGET DE IMAGEM DO PRODUTO */
.image-selector-widget {
  background: #f8fafc;
  border: 1.5px dashed var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.image-preview-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.image-preview-frame {
  width: 90px;
  height: 90px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.image-preview-frame .placeholder-icon {
  font-size: 2rem;
  color: var(--text-subtle);
}

.image-preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.image-preview-status {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
}

.image-preview-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.image-search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.image-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.suggestion-card {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: white;
  transition: all 0.15s ease;
  position: relative;
}

.suggestion-card:hover {
  transform: translateY(-2px);
  border-color: var(--orange-figma);
  box-shadow: 0 4px 10px rgba(243, 108, 33, 0.15);
}

.suggestion-card.selected {
  border-color: var(--orange-figma);
  box-shadow: 0 0 0 2px var(--orange-figma);
}

.suggestion-card img {
  width: 100%;
  height: 65px;
  object-fit: cover;
  display: block;
}

.suggestion-card-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.badge-status-paid {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #dcfce7;
  color: #15803d;
  border-radius: var(--radius-pill);
}

.badge-status-open {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  background-color: var(--blue-light);
  color: #0369a1;
  border-radius: var(--radius-pill);
}

.total-row-label {
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-dark);
  background-color: #f8fafc;
  border-top: 2px solid var(--border-color);
}

.total-row-value {
  padding: 1.25rem 1.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #059669;
  background-color: #f8fafc;
  border-top: 2px solid var(--border-color);
}

.table-empty {
  text-align: center;
  padding: 3.5rem !important;
  color: var(--text-muted);
}

.table-actions-group {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.form-inline {
  display: inline;
  margin: 0;
}

.role-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
}

.role-administrador, .role-admin {
  background-color: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}

.role-atendimento {
  background-color: var(--blue-light);
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.role-caixa {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.user-you-tag {
  font-size: 0.8rem;
  color: var(--green-dark);
  font-weight: 600;
  margin-left: 0.35rem;
}

/* ==============================================================================
   TELA DE DETALHE DO PEDIDO (PROTÓTIPO 3 FIGMA)
   ============================================================================== */
.status-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.banner-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.banner-warning {
  background-color: var(--yellow-light);
  color: #92400e;
  border: 1px solid var(--yellow-border);
}

.banner-info {
  background-color: var(--blue-light);
  color: #1e40af;
  border: 1px solid var(--blue-border);
}

.banner-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.badge-status-closed {
  display: inline-block;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: var(--radius-pill);
}

/* 3 CARDS DE TEMPO EM DESKTOP */
.time-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.time-metric-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-subtle);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.metric-value {
  margin: 0.35rem 0 0;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-dark);
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

/* SEÇÃO FINANCEIRA: 2 COLUNAS */
.financial-split-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.transactions-list {
  display: flex;
  flex-direction: column;
}

.transaction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-light);
}

.transaction-row:last-child {
  border-bottom: none;
}

.tx-method {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
}

.tx-time {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.tx-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--green-dark);
}

.no-records {
  color: var(--text-subtle);
  font-size: 0.9rem;
  padding: 1rem 0;
}

/* TOTAL CARD */
.total-summary-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.total-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.total-base-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-body);
}

.total-main-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0.5rem 0;
}

.total-big-number {
  margin: 0.25rem 0 0;
  font-size: 2.2rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: -0.5px;
}

.settlement-badge-box {
  display: flex;
  justify-content: flex-end;
  margin: 1rem 0;
}

.settlement-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
}

.pill-settled {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.pill-unsettled {
  background-color: var(--orange-light);
  color: #9a3412;
  border: 1px solid var(--orange-border);
}

.close-order-box {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* ==============================================================================
   BOTÕES GLOBAIS FIGMA
   ============================================================================== */
.btn, .botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.btn-primary, .botao-laranja-figma {
  background-color: var(--orange-figma);
  color: #ffffff !important;
}

.btn-primary:hover, .botao-laranja-figma:hover {
  background-color: var(--orange-figma-hover);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-body);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-outline {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-body);
}

.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.btn-success {
  background-color: var(--green-dark);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #047857;
}

.btn-warning {
  background-color: var(--yellow-dark);
  color: #ffffff;
}

.btn-warning:hover {
  background-color: #b45309;
}

.btn-danger-outline {
  background: white;
  border: 1.5px solid #fca5a5;
  color: var(--red-dark);
}

.btn-danger-outline:hover {
  background: var(--red-light);
  border-color: var(--red-main);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 6px;
}

.btn-block, .botao-bloco {
  width: 100%;
}

/* ==============================================================================
   FORMULÁRIOS & CAMPOS
   ============================================================================== */
.back-nav-bar {
  margin-bottom: 1.25rem;
}

.back-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--orange-figma);
}

.form-card-centered {
  max-width: 620px;
  margin: 0 auto;
}

.form-card-header {
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0.85rem;
}

.form-card-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-body);
  margin-bottom: 0.4rem;
}

.form-control,
.standard-form input[type=text],
.standard-form input[type=password],
.standard-form input[type=email],
.standard-form input[type=number],
.standard-form select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background-color: #ffffff;
  color: var(--text-dark);
  transition: all 0.15s ease;
}

.form-control:focus,
.standard-form input:focus,
.standard-form select:focus {
  outline: none;
  border-color: var(--orange-figma);
  box-shadow: 0 0 0 3px rgba(243, 108, 33, 0.15);
}

.standard-form input[type=checkbox] {
  transform: scale(1.2);
  margin-right: 0.5rem;
}

.form-help-text {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field-error-msg {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--red-dark);
  font-weight: 600;
}

.form-actions-bar {
  display: flex;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* ==============================================================================
   MODAIS
   ============================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-box {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.85rem;
}

.modal-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.modal-close-btn:hover {
  background: var(--border-light);
  color: var(--text-dark);
}

.payment-due-alert {
  background: var(--orange-light);
  border: 1px solid var(--orange-border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
}

.payment-due-alert span {
  display: block;
  font-size: 0.75rem;
  color: #9a3412;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-due-alert strong {
  font-size: 1.6rem;
  color: var(--orange-figma);
  font-weight: 800;
}

.modal-footer {
  margin-top: 1.5rem;
}

/* ==============================================================================
   VISÃO GERAL (DASHBOARD)
   ============================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

.dash-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-icon-box svg {
  width: 24px;
  height: 24px;
}

.icon-mesas { background: #e0f2fe; color: #0284c7; }
.icon-pedidos { background: #fef3c7; color: #d97706; }
.icon-produtos { background: #fce7f3; color: #db2777; }
.icon-caixa { background: #dcfce7; color: #16a34a; }
.icon-usuarios { background: #ede9fe; color: #7c3aed; }

.dash-card-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-dark);
}

.dash-card-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.dash-arrow {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-subtle);
  margin-left: auto;
}

/* ==============================================================================
   TELA DE AUTENTICAÇÃO (LOGIN)
   ============================================================================== */
.body-auth {
  background-color: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  padding: 1.5rem;
}

.card-login-figma {
  background: white;
  border-radius: 16px;
  padding: 2.75rem 2.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.login-topo-marca {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.logo-icone-login {
  width: 44px;
  height: 44px;
  background-color: var(--orange-figma);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-icone-login svg {
  width: 24px;
  height: 24px;
}

.login-titulo {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}

.login-subtitulo {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--orange-figma);
  letter-spacing: 1.2px;
}

.login-instrucao {
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.form-login-figma .grupo-campo {
  margin-bottom: 1.25rem;
}

.form-login-figma label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-body);
  margin-bottom: 0.4rem;
}

.form-login-figma input[type=text],
.form-login-figma input[type=password] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.form-login-figma input:focus {
  outline: none;
  border-color: var(--orange-figma);
  box-shadow: 0 0 0 3px rgba(243, 108, 33, 0.15);
}

.acoes-login {
  margin-top: 1.75rem;
}

/* ==============================================================================
   RESPONSIVIDADE (TABLETS E MOBILE)
   ============================================================================== */
@media (max-width: 1200px) {
  .tables-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    box-shadow: none;
  }

  .sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.5rem 1rem 1rem;
  }

  .nav-link {
    white-space: nowrap;
    padding: 0.6rem 0.85rem;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem 1.25rem;
  }

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

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

  .financial-split-grid {
    grid-template-columns: 1fr;
  }
}

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

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .time-metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================================================================
   ESTILOS OPERACIONAIS E KPIS (MESA, ESTOQUE, COMANDA E COZINHA)
   ============================================================================== */
.overview-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.kpi-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-subtle);
  text-transform: uppercase;
}

.kpi-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.icon-blue { background: #e0f2fe; }
.icon-orange { background: #ffedd5; }
.icon-green { background: #dcfce7; }
.icon-yellow { background: #fef9c3; }

.kpi-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
}

.kpi-card-secondary {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-subtle);
}

.kpi-card-footer {
  margin-top: 0.65rem;
}

.kpi-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.kpi-badge-info {
  background: #eff6ff;
  color: #1d4ed8;
}

.kpi-badge-warning {
  background: #fff7ed;
  color: #c2410c;
}

.kpi-note {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.text-success { color: #16a34a !important; }
.text-warning { color: #d97706 !important; }

/* Controles de Itens Consumidos (+ / - / Excluir) */
.qty-control-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.btn-qty-mini {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-qty-mini:hover {
  background: var(--orange-figma);
  color: white;
  border-color: var(--orange-figma);
}

.qty-number {
  min-width: 1.4rem;
  font-weight: 700;
  text-align: center;
  font-size: 0.95rem;
}

.btn-action-delete {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-action-delete:hover {
  color: var(--red-dark);
  background: #fee2e2;
}

/* Badges de Cozinha e Produção */
.badge-count-kitchen {
  background: var(--orange-figma);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  margin-left: 0.4rem;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.tag-printed {
  background: #dcfce7;
  color: #15803d;
}

.tag-pending {
  background: #fef3c7;
  color: #b45309;
}

/* Badges e Pill de Estoque */
.stock-pill {
  display: block;
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 500;
  margin-top: 0.15rem;
}

.stock-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.stock-badge-ok {
  background: #f1f5f9;
  color: var(--text-body);
}

.stock-badge-low {
  background: #fee2e2;
  color: #b91c1c;
}

/* Filtro de data no cabeçalho */
.date-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: white;
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
}

.form-control-date {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-dark);
}
