/* Zuvo — estilos (código original). Identidad: morado oscuro + pin rosado. */
:root {
  --purple-900: #1a0b33;
  --purple-800: #241047;
  --purple-700: #33186b;
  --purple-100: #efe9fb;
  --pink: #ff4d7e;
  --pink-dark: #e03363;
  --ink: #1d1430;
  --muted: #6f6584;
  --line: #e4ddf3;
  --ok: #1e9e62;
  --warn: #e8a13a;
  --bad: #d84545;
  --bg: #f6f3fc;
  --card: #ffffff;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.45;
}
.hidden { display: none !important; }

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--purple-900), var(--purple-700));
  color: #fff; padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 42px; height: 42px; border-radius: 10px; }
.brand-name { font-size: 24px; font-weight: 800; letter-spacing: .5px; line-height: 1; }
.brand-sub { font-size: 12px; opacity: .85; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.user-chip { background: rgba(255,255,255,.16); padding: 5px 10px; border-radius: 999px; font-size: 14px; }

/* Botones y formularios */
.btn {
  appearance: none; border: 0; cursor: pointer; border-radius: 12px;
  background: var(--purple-800); color: #fff; font-weight: 700;
  padding: 12px 18px; font-size: 16px; min-height: 48px;
}
.btn:hover { background: var(--purple-700); }
.btn.pink { background: var(--pink); }
.btn.pink:hover { background: var(--pink-dark); }
.btn.ghost { background: transparent; border: 1.5px solid rgba(255,255,255,.7); color: #fff; min-height: 40px; padding: 7px 12px; }
.btn.light { background: var(--purple-100); color: var(--purple-800); }
.btn.danger { background: var(--bad); }
.btn.small { min-height: 40px; padding: 7px 12px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
label { display: block; font-weight: 600; margin: 12px 0 5px; font-size: 15px; }
input, select, textarea {
  width: 100%; padding: 12px; font-size: 16px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input[type="file"] { padding: 9px; }
.hint { color: var(--muted); font-size: 14px; }
.error-box { background: #fdecec; border: 1px solid #f3b8b8; color: #8c2323; padding: 10px 12px; border-radius: 10px; margin: 10px 0; }
.ok-box { background: #e8f7ee; border: 1px solid #b5e3c8; color: #14663d; padding: 10px 12px; border-radius: 10px; margin: 10px 0; }

/* Estructura */
.app { max-width: 1060px; margin: 0 auto; padding: 18px 14px 40px; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 0 0 16px; box-shadow: 0 1px 3px rgba(36,16,71,.05);
}
.card h2 { margin: 0 0 6px; font-size: 21px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 820px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.tab {
  border: 1.5px solid var(--line); background: #fff; color: var(--purple-800);
  padding: 9px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 15px;
}
.tab.active { background: var(--purple-800); color: #fff; border-color: var(--purple-800); }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 10px 30px; }

/* Hero de bienvenida */
.hero {
  background: linear-gradient(135deg, var(--purple-900), var(--purple-700));
  color: #fff; border-radius: var(--radius); padding: 26px 20px; margin-bottom: 16px; text-align: center;
}
.hero h1 { margin: 0 0 8px; font-size: 30px; }
.hero p { margin: 0 auto; max-width: 560px; opacity: .92; }
.hero img { width: 74px; height: 74px; }

/* Pedidos */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--purple-100); color: var(--purple-800);
}
.badge.nuevo { background: #fff2d9; color: #8a5a00; }
.badge.en_preparacion { background: #e3ecff; color: #274b9f; }
.badge.en_camino { background: #ffe3ee; color: #a11344; }
.badge.entregado { background: #dff5e8; color: #14663d; }
.badge.cancelado, .badge.no_recibido { background: #fdecec; color: #8c2323; }
.badge.pago { background: #efe9fb; color: var(--purple-800); }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-items { white-space: pre-wrap; background: #faf8ff; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.totals { font-size: 15px; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .grand { font-weight: 800; border-top: 1px solid var(--line); margin-top: 5px; padding-top: 7px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.map { height: 260px; border-radius: 12px; margin-top: 12px; border: 1px solid var(--line); z-index: 0; }
.stars { display: flex; gap: 4px; }
.stars button {
  font-size: 28px; background: none; border: 0; cursor: pointer; color: #cfc6e6; padding: 2px; line-height: 1;
}
.stars button.on { color: #f5a623; }

/* Tablero del dueño */
.board { display: grid; gap: 14px; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(4, 1fr); } }
.board-col h3 { font-size: 16px; margin: 0 0 8px; }
.mini-order { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
.table-wrap { overflow-x: auto; }

/* Chat del asistente */
.chat { display: flex; flex-direction: column; height: 430px; }
.chat-log { flex: 1; overflow-y: auto; padding: 6px 2px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; font-size: 15.5px; }
.msg.bot { background: var(--purple-100); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--purple-800); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-opts { display: flex; gap: 7px; flex-wrap: wrap; padding: 8px 0; }
.chat-opts button {
  border: 1.5px solid var(--purple-800); color: var(--purple-800); background: #fff;
  border-radius: 999px; padding: 8px 13px; font-weight: 700; cursor: pointer; font-size: 14.5px;
}
.chat-opts button:hover { background: var(--purple-100); }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; }
.stat { text-align: center; }
.stat .num { font-size: 28px; font-weight: 800; color: var(--purple-800); }
.stat .lbl { color: var(--muted); font-size: 13.5px; }
