/* ==========================================================================
   Espetinho da Família - CSS Principal e Responsivo
   Cores Principais: Amarelo/Âmbar (#f59e0b, #d97706), Dark/Charcoal (#111827)
   ========================================================================== */

:root {
  --primary-color: #f59e0b;
  --primary-hover: #d97706;
  --primary-light: #fef3c7;
  --primary-dark: #b45309;

  --secondary-color: #1f2937;
  --secondary-hover: #111827;

  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;

  --status-free: #10b981;
  --status-busy: #f59e0b;
  --status-kitchen: #ef4444;
  --status-prep: #3b82f6;
  --status-ready: #10b981;
  --status-pending: #8b5cf6;
  --status-done: #64748b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   UTILITIES & GENERAL STYLES
   ========================================== */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.text-muted {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.flex-row { display: flex; align-items: center; }
.gap-2 { gap: 0.5rem; }

/* ==========================================
   BUTTONS & INPUTS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #1f2937;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: #e2e8f0;
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-outline-danger {
  background-color: transparent;
  border-color: #fca5a5;
  color: #dc2626;
}
.btn-outline-danger:hover {
  background-color: #fef2f2;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: white;
  border: 1px solid var(--border-color);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}
.btn-icon:hover {
  background: var(--primary-light);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--text-primary);
}

.form-input, .form-select, textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

/* ==========================================
   PUBLIC LANDING MENU & HEADER
   ========================================== */
.public-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.public-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.public-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary-color);
}

.public-branding h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary-color);
  line-height: 1.2;
}

.public-branding p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-login-top {
  font-weight: 800;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.3);
}

.public-menu-screen {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
}

.public-hero-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.public-hero-banner h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.public-hero-banner p {
  font-size: 0.95rem;
  color: #cbd5e1;
  max-width: 600px;
  margin: 0 auto;
}

.public-search-bar {
  max-width: 500px;
  margin: 1.25rem auto 0 auto;
}

.public-search-bar input {
  background: #ffffff;
  border-radius: var(--radius-full);
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  border: 2px solid var(--primary-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.public-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.public-product-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.public-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-color);
}

.public-product-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.public-product-thumb {
  width: 70px;
  height: 70px;
  min-width: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.public-product-info {
  flex: 1;
}

.public-product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.public-product-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--secondary-color);
  line-height: 1.3;
}

.public-product-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
}

.public-product-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.role-selector-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.role-tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-tab.active {
  background: #ffffff;
  color: var(--secondary-color);
  box-shadow: var(--shadow-sm);
}

/* DEDICATED ACESSO / LOGIN PAGE STYLING */
.login-screen-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fef9c3 0%, #fde047 25%, #f59e0b 65%, #d97706 100%);
  padding: 1.5rem;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-card-header {
  padding: 2rem 2rem 1.25rem 2rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.login-card-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--primary-color);
}

.login-card-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--secondary-color);
  margin: 0;
}

.login-card-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 600;
}

.login-card-body {
  padding: 1.75rem 2rem 2rem 2rem;
}

/* ENHANCED LOGIN INPUTS & CARD STYLING */
.text-left {
  text-align: left;
}

.input-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--secondary-color);
  margin-bottom: 0.35rem;
  display: block;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}

.input-styled {
  padding-left: 2.8rem !important;
  padding-right: 2.8rem !important;
  height: 48px;
  font-size: 0.95rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #f8fafc;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

.input-styled:focus {
  background-color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2), 0 2px 4px rgba(0,0,0,0.05);
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.btn-toggle-password:hover {
  opacity: 1;
  transform: scale(1.1);
}

.btn-login-submit {
  height: 50px;
  margin-top: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.45);
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.btn-login-submit:hover .btn-arrow {
  transform: translateX(4px);
}

.quick-login-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-color);
  text-align: left;
}

.quick-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.quick-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.btn-quick {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-quick:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
}

/* ==========================================
   APP HEADER
   ========================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: var(--secondary-color);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary-color);
  object-fit: cover;
}

.header-branding {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   DRAWER / CENTRAL NOTIFICAÇÃO
   ========================================== */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 1.25rem;
  background: var(--secondary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h3 { font-size: 1.1rem; }

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

.drawer-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.notif-item {
  padding: 0.875rem;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border-left: 4px solid var(--primary-color);
  margin-bottom: 0.75rem;
}

.notif-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 0.25rem;
}

/* ==========================================
   MAIN CONTENT & ROLES VIEWS
   ========================================== */
.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--secondary-color);
}

/* ==========================================
   MESAS GRID (ATENDENTE / COZINHA)
   ========================================== */
.mesas-grid, .cozinha-mesas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.mesa-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: flex-start;
}

.mesa-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mesa-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

.mesa-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.mesa-card-ready-row {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 0.1rem;
}

.mesa-number {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary-color);
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}

.badge-libre { background: #d1fae5; color: #065f46; }
.badge-busy { background: #fef3c7; color: #92400e; }
.badge-kitchen { background: #fee2e2; color: #991b1b; }
.badge-ready { background: #d1fae5; color: #065f46; }

.mesa-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1.5px solid #cbd5e1;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary-color);
}

.mesa-status-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.mesa-status-controls label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #334155;
  white-space: nowrap;
}

.select-mesa-status-dropdown {
  width: auto;
  padding: 0.45rem 0.9rem;
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
  outline: none;
}

.select-mesa-status-dropdown option {
  background-color: #ffffff;
  color: #1e293b;
  font-weight: 600;
}

.cozinha-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

.stat-pill.warning { background: #fee2e2; color: #991b1b; }
.stat-pill.info { background: #dbeafe; color: #1e40af; }
.stat-pill.success { background: #d1fae5; color: #065f46; }

/* COZINHA HIGHLIGHT PULSE FOR "SOLICITADO À COZINHA" */
.mesa-card.highlight-kitchen {
  border: 3px solid #ef4444;
  background: #fff5f5;
  animation: pulseHighlight 1.5s infinite;
}

@keyframes pulseHighlight {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ATENDENTE HIGHLIGHT PULSE FOR "PRONTO PARA SERVIR" */
.mesa-card.highlight-ready {
  border: 3px solid #10b981;
  background: #f0fdf4;
  animation: pulseReady 1.5s infinite;
}

@keyframes pulseReady {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.mesa-card-body {
  width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.orders-count-badge {
  display: inline-block;
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mesa-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
  width: 100%;
}

/* ==========================================
   ADMIN PANELS & TABLES
   ========================================== */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.admin-tab-btn {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.admin-tab-btn.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-color);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.metric-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--secondary-color);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.card-body {
  padding: 1.25rem;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--secondary-color);
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover {
  background: #f8fafc;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.product-admin-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-thumb {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* ==========================================
   MODALS & OVERLAYS
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: #ffffff;
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-lg {
  max-width: 800px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary-color);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.tab-action-bar,
.modal-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.tab-action-bar h3,
.modal-actions-bar h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--secondary-color);
  margin: 0;
}

#btn-open-new-order,
#btn-new-user,
#btn-new-product,
#btn-new-order-status,
#btn-new-table-status {
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.35rem 0.85rem;
  white-space: nowrap;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================
   PRODUCT PICKER FOR ORDERS
   ========================================== */
.products-picker-section {
  margin: 1rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: #f8fafc;
}

.products-grid-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 0.75rem;
}

.picker-item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.picker-item-info {
  margin-bottom: 0.5rem;
}

.picker-item-name {
  font-weight: 700;
  font-size: 0.875rem;
}

.picker-item-price {
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.85rem;
}

.qty-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn-qty {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.qty-val {
  font-weight: 700;
  font-size: 0.9rem;
}

.order-summary-box {
  background: var(--primary-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 1rem;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #f59e0b;
  font-size: 1.1rem;
}

/* ==========================================
   ORDER ITEM CARDS IN KITCHEN / TABLES
   ========================================== */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: #f1f5f9;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid #cbd5e1;
  margin-top: 0.75rem;
  max-height: 65vh;
  overflow-y: auto;
}

.order-card-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 6px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-card-box:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.09);
}

/* Status Variants for Order Cards */
.order-card-box.order-status-kitchen,
.order-card-box.kitchen-pending {
  border-left-color: #ef4444;
  background-color: #fef2f2;
  border-color: #fca5a5;
}

.order-card-box.order-status-ready {
  border-left-color: #10b981;
  background-color: #f0fdf4;
  border-color: #86efac;
}

.order-card-box.order-status-busy {
  border-left-color: #f59e0b;
  background-color: #fffbeb;
  border-color: #fde68a;
}

.order-card-box.order-status-paid {
  border-left-color: #64748b;
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}

.order-card-header strong {
  font-size: 1.05rem;
  color: var(--secondary-color);
}

.order-items-list {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0.4rem;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

.order-items-list li {
  padding: 0.6rem 0.85rem;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  cursor: pointer;
}

.order-items-list li:last-child {
  margin-bottom: 0;
}

.order-items-list li:nth-child(even) {
  background: rgba(255, 255, 255, 0.85);
}

.order-items-list li:hover {
  background-color: var(--item-hover-bg, #fde68a) !important;
  border-color: var(--item-status-color, #f59e0b) !important;
  transform: translateX(2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.order-item-qty {
  display: inline-block;
  font-weight: 800;
  color: #1e293b;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.88rem;
  border: 1px solid #cbd5e1;
}

.order-item-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.95rem;
}

.order-item-price {
  font-weight: 700;
  color: #047857;
  font-size: 0.95rem;
}

/* FOOTER TOTALS & RIGHT-ALIGNED ACTIONS */
.order-card-totals {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.order-totals-summary {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 200px;
}

.order-actions-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.form-select-sm {
  width: auto;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
}

.select-mesa-status-dropdown,
.select-order-status {
  width: auto;
  min-width: max-content;
  padding: 0.45rem 0.9rem;
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
  outline: none;
}

.select-mesa-status-dropdown option,
.select-order-status option {
  background-color: #ffffff;
  color: #1e293b;
  font-weight: 600;
}

.order-comments-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.order-meta-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.order-meta-box p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-align: left;
}

.order-meta-box p:last-child {
  margin-bottom: 0;
}

.order-comments-section, .order-timeline-section {
  text-align: left;
}

.order-comments-section h4, .order-timeline-section h4 {
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--secondary-color);
}

.timeline {
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline li {
  position: relative;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid var(--primary-color);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   MEDIA QUERIES / RESPONSIVENESS
   ========================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 0.75rem 1rem;
  }

  .brand-title {
    font-size: 1rem;
  }

  .main-content {
    padding: 1rem;
  }

  .mesas-grid, .cozinha-mesas-grid {
    grid-template-columns: 1fr;
  }

  .quick-buttons {
    grid-template-columns: 1fr;
  }

  .modal-content {
    max-height: 95vh;
  }
}
