:root {
  --navy: #0f172a;
  --navy-2: #1e293b;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #d97706;
  --blue: #2563eb;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

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

/* ---- Navbar ---- */
.navbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 0;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar .brand { font-weight: 700; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.navbar .brand .dot { width: 10px; height: 10px; background: var(--orange); border-radius: 50%; display: inline-block; }
.navbar .brand img.brand-logo { height: 36px; width: auto; border-radius: 5px; display: block; }
.navbar nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.navbar nav a { color: #cbd5e1; font-size: 0.95rem; }
.navbar nav a:hover, .navbar nav a.active { color: #fff; }
.navbar .pill { background: rgba(255,255,255,0.08); padding: 6px 12px; border-radius: 999px; font-size: 0.85rem; }

/* ---- Layout helpers ---- */
.page { padding: 32px 0 60px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h2, .card h3 { margin-top: 0; }

h1 { font-size: 1.8rem; margin: 0 0 6px; }
h2 { font-size: 1.3rem; }
.subtitle { color: var(--muted); margin-bottom: 24px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--navy); }
.btn-danger { background: #fee2e2; color: var(--red); }
.btn-success { background: #dcfce7; color: var(--green); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: var(--navy-2); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 16px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); border-color: var(--orange); }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

/* ---- Badges (estado) ---- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.badge-recibido { background: #e0e7ff; color: #4338ca; }
.badge-diagnostico { background: #fef3c7; color: var(--yellow); }
.badge-esperando_aprobacion { background: #fee2e2; color: var(--red); }
.badge-en_reparacion { background: #dbeafe; color: var(--blue); }
.badge-control_calidad { background: #ede9fe; color: #7c3aed; }
.badge-listo_para_retiro { background: #dcfce7; color: var(--green); }
.badge-entregado { background: #f1f5f9; color: var(--muted); }
.badge-cancelado { background: #f1f5f9; color: var(--muted); }
.badge-pendiente { background: #fef3c7; color: var(--yellow); }
.badge-aprobado { background: #dcfce7; color: var(--green); }
.badge-rechazado { background: #fee2e2; color: var(--red); }
.badge-solicitada { background: #fef3c7; color: var(--yellow); }
.badge-confirmada { background: #dcfce7; color: var(--green); }
.badge-contado { background: #f1f5f9; color: var(--navy-2); }
.badge-credito { background: #dbeafe; color: var(--blue); }
.badge-al_dia { background: #dbeafe; color: var(--blue); }
.badge-por_vencer { background: #fef3c7; color: var(--yellow); }
.badge-vencida { background: #fee2e2; color: var(--red); }
.badge-pagada { background: #dcfce7; color: var(--green); }

/* ---- Timeline ---- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding-left: 26px; padding-bottom: 20px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li:last-child { border-left: 2px solid transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); }
.timeline .fecha { font-size: 0.78rem; color: var(--muted); }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

/* ---- Chat ---- */
.chat-box {
  display: flex;
  flex-direction: column;
  height: 60vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 75%; padding: 10px 14px; border-radius: 14px; font-size: 0.92rem; }
.msg-cliente { align-self: flex-end; background: var(--orange); color: #fff; border-bottom-right-radius: 4px; }
.msg-ia, .msg-admin { align-self: flex-start; background: #f1f5f9; color: var(--text); border-bottom-left-radius: 4px; }
.msg-admin { border: 1px solid var(--navy); }
.msg small { display: block; opacity: 0.7; font-size: 0.7rem; margin-bottom: 3px; }
.chat-input { display: flex; border-top: 1px solid var(--border); padding: 10px; gap: 8px; }
.chat-input input { margin-bottom: 0; flex: 1; }
.chat-input button { flex-shrink: 0; }

/* ---- Misc ---- */
.muted { color: var(--muted); }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 700; color: var(--navy); }
.stat .label { color: var(--muted); font-size: 0.85rem; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.flash-error { background: #fee2e2; color: var(--red); }
.flash-success { background: #dcfce7; color: var(--green); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

.hero {
  background-image: linear-gradient(135deg, rgba(15,23,42,0.90) 0%, rgba(30,58,95,0.85) 100%), url('/static/img/taller_fachada.jpg');
  background-size: cover;
  background-position: center 60%;
  color: #fff;
  padding: 70px 0;
}
.hero h1 { font-size: 2.4rem; max-width: 620px; }
.hero p { color: #cbd5e1; max-width: 560px; font-size: 1.05rem; }
.hero .actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.features { padding: 60px 0; }
.feature-icon { width: 42px; height: 42px; border-radius: 10px; background: #fff7ed; color: var(--orange); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 10px; }

/* ---- Info del taller (landing) ---- */
.taller-info { padding: 0 0 70px; }
.taller-card { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 28px; }
.taller-card img.logo { height: 72px; width: auto; border-radius: 8px; flex-shrink: 0; }
.taller-card .datos { flex: 1; min-width: 220px; }
.taller-card .datos h3 { margin: 0 0 8px; }
.taller-card .datos p { margin: 4px 0; color: var(--text); font-size: 0.95rem; }
.taller-card .datos a { color: var(--text); }
.taller-card .datos a:hover { color: var(--orange); }

.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.slot { padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 0.88rem; }
.slot.selected { background: var(--orange); color: #fff; border-color: var(--orange); }
.slot.taken { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

.vehicle-card { display: flex; justify-content: space-between; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; background: #fff; }
.vehicle-card:hover { border-color: var(--orange); }
