/* ============================================================
   SLFood — Sabor Local
   Design system compartilhado (loja + painel administrativo)
   ============================================================ */

:root {
  --brand: #c65a2e;
  --brand-dark: #9c4523;
  --brand-light: #f6a15a;
  --accent: #4f7942;
  --bg: #fdf8f3;
  --surface: #ffffff;
  --text: #2b2118;
  --text-muted: #7a6a5c;
  --border: #ece0d3;
  --danger: #c0392b;
  --success: #2e7d32;
  --warning: #b8860b;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(60, 40, 20, 0.08);
  --shadow-lg: 0 8px 30px rgba(60, 40, 20, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.site-header { background: linear-gradient(120deg, var(--brand), var(--brand-dark)); box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
.brand { font-size: 1.4rem; font-weight: 700; color: #fff; }
.brand span { color: #ffe3c2; }
.main-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: #fff8f0; font-weight: 500; }
.main-nav a:hover { color: #ffe3c2; text-decoration: none; }
.main-nav .btn-nav { background: #fff; color: var(--brand-dark); padding: 8px 16px; border-radius: 20px; font-weight: 600; }
.cart-link { position: relative; }
.badge { background: var(--danger); color: #fff; font-size: 0.7rem; padding: 1px 6px; border-radius: 10px; margin-left: 4px; }

.page-main { padding: 28px 20px 60px; min-height: 60vh; }

/* ---- Flash messages ---- */
.flash { margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.flash-success { background: #e6f4ea; color: var(--success); border: 1px solid #b7dfc2; }
.flash-error { background: #fdecea; color: var(--danger); border: 1px solid #f3b8b0; }
.flash-info { background: #eaf2fb; color: #1c5a9c; border: 1px solid #bcd8f2; }

/* ---- Footer ---- */
.site-footer { background: #2b2118; color: #d8cabb; margin-top: 40px; }
.footer-inner { padding: 26px 20px; text-align: center; }
.muted { color: #9a897a; font-size: 0.9rem; }

/* ---- Hero ---- */
.hero { background: radial-gradient(circle at top left, #ffe3c2, transparent 60%), var(--surface); border-radius: var(--radius); padding: 36px; margin-bottom: 30px; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
.hero p { color: var(--text-muted); max-width: 640px; }

/* ---- Cards / Grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-img { height: 140px; display: flex; align-items: center; justify-content: center; font-size: 3.2rem; background: linear-gradient(135deg, var(--brand-light), var(--brand)); color: #fff; }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-body h3 { margin: 0; font-size: 1.05rem; }
.card-desc { color: var(--text-muted); font-size: 0.88rem; flex: 1; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }
.price { font-weight: 700; color: var(--brand-dark); font-size: 1.05rem; }
.stock-tag { font-size: 0.75rem; color: var(--text-muted); }

.category-tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.category-tabs button { background: var(--surface); border: 1px solid var(--border); padding: 8px 16px; border-radius: 20px; cursor: pointer; font-weight: 600; color: var(--text); }
.category-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---- Buttons ---- */
.btn { display: inline-block; padding: 10px 20px; border-radius: 10px; border: none; font-weight: 600; cursor: pointer; font-size: 0.95rem; text-align: center; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--brand); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: 8px; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.qty-input { width: 60px; text-align: center; padding: 8px; border-radius: 8px; border: 1px solid var(--border); }

/* ---- Forms ---- */
.form-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; max-width: 480px; margin: 0 auto; }
.form-card.wide { max-width: 720px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 0.95rem; background: #fffefc;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: 2px solid var(--brand-light); border-color: var(--brand); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.hint { color: var(--text-muted); font-size: 0.82rem; margin-top: 4px; }
.form-title { margin-top: 0; }
.form-footer-link { text-align: center; margin-top: 16px; font-size: 0.9rem; }

/* ---- Tables ---- */
table.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data-table th, table.data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.data-table th { background: #f7ede2; color: var(--brand-dark); }
table.data-table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---- Status badges ---- */
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 14px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.status-criado { background: #eaf2fb; color: #1c5a9c; }
.status-pago, .status-pix { background: #e6f4ea; color: var(--success); }
.status-producao { background: #fff3cd; color: var(--warning); }
.status-entrega { background: #ffe3c2; color: var(--brand-dark); }
.status-finalizado { background: #dff0d8; color: var(--success); }
.status-cancelado { background: #fdecea; color: var(--danger); }
.status-atraso { background: #f8d7da; color: #842029; }

/* ---- Cart / Checkout ---- */
.cart-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.cart-item-icon { font-size: 1.8rem; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--brand-light); color: #fff; border-radius: 8px; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { margin: 0 0 4px; }
.cart-total-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-top: 20px; }
.cart-total-box .total-line { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--border); }

.payment-options { display: flex; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.payment-option { flex: 1; min-width: 160px; border: 2px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; text-align: center; background: var(--surface); }
.payment-option.selected { border-color: var(--brand); background: #fff7ef; }
.pix-box { background: #f4f8f4; border: 1px dashed var(--accent); border-radius: 10px; padding: 18px; text-align: center; margin-top: 16px; }
.pix-code { font-family: monospace; background: #fff; padding: 10px; border-radius: 8px; word-break: break-all; margin: 10px 0; border: 1px solid var(--border); }

/* ---- Timeline (tracking) ---- */
.timeline { list-style: none; margin: 20px 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 26px 34px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -9px; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--border); border: 3px solid var(--bg); }
.timeline li.done::before { background: var(--success); }
.timeline li.current::before { background: var(--brand); box-shadow: 0 0 0 4px rgba(198,90,46,0.2); }
.timeline .t-title { font-weight: 700; }
.timeline .t-time { color: var(--text-muted); font-size: 0.82rem; }

/* ---- Dashboard / Kanban (admin) ---- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 26px; }
.kpi-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.kpi-card .kpi-value { font-size: 1.7rem; font-weight: 800; color: var(--brand-dark); }
.kpi-card .kpi-label { color: var(--text-muted); font-size: 0.85rem; }

.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.kanban-col { background: #f4ece1; border-radius: var(--radius); padding: 14px; min-height: 120px; }
.kanban-col h3 { margin: 0 0 10px; font-size: 0.95rem; color: var(--brand-dark); }
.kanban-card { background: var(--surface); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow); font-size: 0.85rem; }
.kanban-card strong { display: block; margin-bottom: 4px; }
.kanban-card .kanban-actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Admin shell ---- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: #2b2118; color: #f2e9dd; flex-shrink: 0; }
.admin-sidebar .brand { display: block; padding: 20px; font-weight: 700; font-size: 1.1rem; color: #fff; border-bottom: 1px solid #43362a; }
.admin-sidebar nav { padding: 10px 0; }
.admin-sidebar nav a { display: block; padding: 12px 20px; color: #d8cabb; font-weight: 500; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: #43362a; color: #fff; text-decoration: none; }
.admin-sidebar .staff-info { padding: 16px 20px; border-top: 1px solid #43362a; font-size: 0.82rem; color: #b3a290; }
.admin-content { flex: 1; padding: 26px 30px; }
.admin-content h1 { margin-top: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* ---- Modal (simple) ---- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(30,20,10,0.5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { margin-top: 0; }
.modal-close { float: right; cursor: pointer; font-size: 1.2rem; color: var(--text-muted); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .emoji { font-size: 3rem; display: block; margin-bottom: 12px; }

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-sidebar nav { display: flex; overflow-x: auto; }
  .admin-sidebar nav a { white-space: nowrap; }
  .form-row { flex-direction: column; }
}
