/* ============================================================
   SETUHUB - CSS Principal
   Mobile First | Bootstrap 5
   ============================================================ */

:root {
  --primary:       #e63946;
  --primary-dark:  #c1121f;
  --primary-light: #ffd6d9;
  --secondary:     #1d3557;
  --accent:        #457b9d;
  --success:       #2d6a4f;
  --warning:       #f4a261;
  --bg:            #f0f2f5;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --card-radius:   14px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-md:     0 4px 24px rgba(0,0,0,.12);
  --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: #1a1a2e;
  margin: 0;
  overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--secondary);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s ease;
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1040;
}
.sidebar-overlay.show { display: block; }

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-name {
  font-size: 20px;
  color: #fff;
  letter-spacing: -.5px;
}
.brand-name strong { color: var(--primary); }
.sidebar-toggle { background: none; border: none; color: rgba(255,255,255,.6); font-size: 20px; cursor: pointer; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.user-avatar { font-size: 28px; color: rgba(255,255,255,.5); flex-shrink: 0; }
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .5px; }

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  padding: 12px 16px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  margin: 1px 8px;
  transition: all .2s;
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 16px);
}
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(230,57,70,.4); }
.nav-item i { font-size: 16px; width: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .main-content { margin-left: var(--sidebar-w); }
}

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.btn-menu {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--secondary);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn-user {
  background: none;
  border: 1px solid #e8ecf0;
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--secondary);
  transition: all .2s;
}
.btn-user:hover { background: var(--bg); }
.btn-user::after { display: none; }

/* ── PAGE CONTENT ── */
.page-content {
  padding: 24px;
  flex: 1;
}
@media (max-width: 575px) { .page-content { padding: 16px; } }

/* ── FLASH ── */
.flash-container { padding: 12px 24px 0; }

/* ── CARDS ── */
.card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  background: #fff;
  border-bottom: 1px solid #f0f2f5;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  padding: 16px 20px;
  font-weight: 600;
}

/* ── STAT CARDS ── */
.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.red    { background: #fde8eb; color: var(--primary); }
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.green  { background: #d1fae5; color: #059669; }
.stat-icon.orange { background: #fed7aa; color: #ea580c; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.teal   { background: #ccfbf1; color: #0d9488; }

.stat-info .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1;
  letter-spacing: -.5px;
}
.stat-info .stat-label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* ── TABLES ── */
.table-card { background: #fff; border-radius: var(--card-radius); box-shadow: var(--shadow); overflow: hidden; }
.table-card .table { margin: 0; }
.table thead th {
  background: #f8f9fb;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6b7280;
  border: none;
  padding: 12px 16px;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; border-color: #f0f2f5; font-size: 14px; }
.table tbody tr:hover { background: #fafafa; }
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f2f5;
}

/* ── BADGES STATUS ── */
.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.status-pendente   { background: #fef3c7; color: #92400e; }
.status-confirmado { background: #dbeafe; color: #1d4ed8; }
.status-producao   { background: #fce7f3; color: #9d174d; }
.status-montagem   { background: #ede9fe; color: #5b21b6; }
.status-pronto     { background: #d1fae5; color: #065f46; }
.status-entregue   { background: #e5e7eb; color: #374151; }
.status-cancelado  { background: #fee2e2; color: #991b1b; }

/* ── FORMS ── */
.form-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230,57,70,.15);
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 8px;
  font-weight: 600;
  padding: 9px 20px;
  transition: all .2s;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { border-radius: 8px; font-weight: 500; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 { font-size: 24px; font-weight: 800; color: var(--secondary); margin: 0; }
.page-breadcrumb {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

/* ── PRATO CARD (cardápio público) ── */
.prato-card {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: all .25s;
  background: #fff;
  cursor: pointer;
  position: relative;
}
.prato-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12); transform: translateY(-3px); }
.prato-card.selected { border: 2.5px solid var(--primary); }
.prato-img { width: 100%; height: 170px; object-fit: cover; }
.prato-img-placeholder {
  width: 100%; height: 170px;
  background: linear-gradient(135deg, #f0f2f5, #e8ecf0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #d1d5db;
}
.prato-body { padding: 14px; }
.prato-nome { font-size: 15px; font-weight: 700; color: var(--secondary); margin-bottom: 4px; }
.prato-desc { font-size: 12px; color: #6b7280; margin-bottom: 8px; line-height: 1.4; }
.prato-price { font-size: 16px; font-weight: 800; color: var(--primary); }
.badge-convenio { position: absolute; top: 10px; left: 10px; }
.prato-check {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: none;
  place-items: center;
  color: #fff;
  font-size: 14px;
}
.prato-card.selected .prato-check { display: grid; }

/* ── CARRINHO ── */
.cart-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(230,57,70,.4);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .3s;
  cursor: pointer;
}
.cart-fab:hover { background: var(--primary-dark); transform: scale(1.04); }
.cart-badge {
  background: #fff;
  color: var(--primary);
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ── MENU HEADER ── */
.menu-hero {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 32px 20px 24px;
  text-align: center;
}
.menu-logo { font-size: 32px; font-weight: 900; letter-spacing: -1px; margin-bottom: 4px; }
.menu-logo span { color: var(--primary); }
.menu-title { font-size: 20px; font-weight: 600; opacity: .9; margin-bottom: 4px; }
.menu-date  { font-size: 13px; opacity: .7; }
.menu-expira { font-size: 12px; background: rgba(255,255,255,.15); border-radius: 20px; padding: 4px 12px; display: inline-block; margin-top: 8px; }

/* ── COZINHA / MONTAGEM ── */
.kitchen-wrapper { background: #111827; min-height: 100vh; color: #fff; }
.kitchen-header {
  background: #1f2937;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--primary);
}
.kitchen-title { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 24px; }
.ingredient-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.ingredient-qty {
  font-size: 32px;
  font-weight: 900;
  color: var(--warning);
  line-height: 1;
}
.ingredient-name { font-size: 14px; font-weight: 600; color: #d1d5db; margin-top: 6px; text-transform: uppercase; }
.ingredient-unit { font-size: 12px; color: #6b7280; }

.assembly-card {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.assembly-qty { font-size: 36px; font-weight: 900; color: var(--primary); min-width: 60px; text-align: center; }
.assembly-name { font-size: 16px; font-weight: 700; color: #fff; }
.assembly-cat  { font-size: 12px; color: #6b7280; text-transform: uppercase; }

/* ── ETIQUETA PREVIEW ── */
.etiqueta-preview {
  font-family: 'Courier New', monospace;
  background: #fff;
  border: 2px dashed #999;
  padding: 12px;
  width: 240px;
  font-size: 12px;
  line-height: 1.5;
}
.etiqueta-header { font-weight: bold; font-size: 14px; border-bottom: 1px solid #333; padding-bottom: 4px; margin-bottom: 6px; }
.etiqueta-item { margin-bottom: 4px; }
.etiqueta-footer { border-top: 1px solid #333; padding-top: 6px; margin-top: 6px; }

/* ── EXPIRATION PAGE ── */
.expired-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--secondary), #264653);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}
.expired-emoji { font-size: 80px; margin-bottom: 20px; display: block; }
.expired-title { font-size: 32px; font-weight: 900; margin-bottom: 12px; }
.expired-msg   { font-size: 16px; opacity: .8; max-width: 340px; margin: 0 auto; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }

/* ── UTILS ── */
.fw-800 { font-weight: 800 !important; }
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.rounded-xl { border-radius: 14px !important; }
.shadow-sm-custom { box-shadow: var(--shadow) !important; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--secondary) 0%, #264653 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo-icon {
  width: 60px; height: 60px;
  background: var(--primary);
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  margin-bottom: 12px;
}
.login-brand { font-size: 28px; font-weight: 900; color: var(--secondary); letter-spacing: -1px; }
.login-brand span { color: var(--primary); }

/* ── ANIMATIONS ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp .4s ease forwards; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.pulse-dot { animation: pulse-dot 1.5s ease infinite; }

/* ── RESPONSIVE UTILS ── */
@media (max-width: 767px) {
  .stat-card { padding: 14px; }
  .stat-icon { width: 44px; height: 44px; font-size: 18px; }
  .stat-info .stat-value { font-size: 20px; }
  .page-header h1 { font-size: 20px; }
  .kitchen-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px; }
  .ingredient-qty { font-size: 24px; }
}
