:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-soft: #fff7ed;
  --green: #22c55e;
  --green-dark: #16a34a;
  --bg: #f5f5f4;
  --card: #ffffff;
  --text: #1c1917;
  --muted: #78716c;
  --border: #e7e5e4;
  --danger: #ef4444;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 0.95rem; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fecaca 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 32px;
  text-align: center;
}

.login-logo { font-size: 2.6rem; }
.login-title { font-size: 1.4rem; margin: 8px 0 4px; font-weight: 800; }
.login-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 22px; }

.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-green { background: var(--green); }
.btn-green:hover { background: var(--green-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #fafaf9; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 10px; font-size: 0.8rem; border-radius: 8px; }

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  text-align: left;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 100;
  animation: slideIn 0.25s ease;
}
.toast.success { background: var(--green-dark); }
.toast.error { background: var(--danger); }

@keyframes slideIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- Header ---------- */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.brand .logo { font-size: 1.6rem; }
.brand span span { color: var(--primary); }

.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav button {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
}
.nav button.active { background: var(--primary-soft); color: var(--primary-dark); }
.nav button:hover { background: #fafaf9; color: var(--text); }

.user-box { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.user-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
}

/* ---------- Main / sections ---------- */
.main { flex: 1; padding: 20px 0 40px; }

.section-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 4px; }
.section-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }

/* ---------- Shop ---------- */
.shop-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
}

.categories { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card .emoji { font-size: 2.4rem; text-align: center; }
.card h3 { font-size: 0.98rem; font-weight: 700; line-height: 1.25; min-height: 40px; }
.card .desc { font-size: 0.82rem; color: var(--muted); flex: 1; }
.card .meta { display: flex; align-items: center; justify-content: space-between; }
.price { font-weight: 800; font-size: 1.02rem; color: var(--primary-dark); }
.stock {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.stock.ok { background: #dcfce7; color: #15803d; }
.stock.low { background: #fef9c3; color: #a16207; }
.stock.no { background: #fee2e2; color: #b91c1c; }

.add-btn { width: 100%; }

/* ---------- Cart ---------- */
.cart {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  position: sticky;
  top: 80px;
}
.cart h3 { font-size: 1.02rem; font-weight: 800; margin-bottom: 12px; display: flex; justify-content: space-between; }
.cart-empty { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 18px 0; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .info .name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item .info .sub { font-size: 0.78rem; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 700;
  line-height: 1;
}
.qty button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty span { min-width: 20px; text-align: center; font-weight: 700; font-size: 0.9rem; }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  margin: 14px 0;
  font-size: 1.05rem;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafaf9; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
tr.clickable td { cursor: pointer; }
tr.clickable:hover td { background: var(--primary-soft); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stat .label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value { font-size: 1.4rem; font-weight: 800; margin-top: 4px; }

.sale-detail { background: var(--bg); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.sale-detail h4 { font-size: 0.95rem; margin-bottom: 8px; }

/* ---------- Products manage ---------- */
.manage-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .manage-grid { grid-template-columns: 1fr; } }

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.form-card h3 { font-size: 1.02rem; font-weight: 800; margin-bottom: 14px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row .field:last-child:nth-child(odd) { grid-column: 1 / -1; }

.inline-edit { display: flex; gap: 6px; align-items: center; }
.inline-edit input { width: 80px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.inline-edit .w-stock { width: 70px; }
.inline-edit .w-price { width: 110px; }

.search { width: 100%; max-width: 320px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; }
.search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.modal h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 16px; }

.order-summary {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 0.88rem;
}
.order-summary .row { display: flex; justify-content: space-between; padding: 3px 0; }
.order-summary .row.total { font-weight: 800; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- Misc ---------- */
.spinner {
  width: 34px; height: 34px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 60px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center { text-align: center; color: var(--muted); padding: 30px 0; }
.muted { color: var(--muted); }
.badge { font-size: 0.72rem; font-weight: 700; background: var(--bg); border-radius: 999px; padding: 3px 9px; color: var(--muted); }

/* ---------- Botones extendidos ---------- */
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px; }
.btn-outline { background: transparent; border: 2px solid #fff; color: #fff; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.15); }

/* ---------- Landing ---------- */
.landing-nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  background: rgba(28, 25, 23, 0.35);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.landing-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.landing-nav .brand { color: #fff; }
.landing-nav .nav button {
  border: none; background: transparent; padding: 8px 12px;
  border-radius: 10px; font-weight: 600; color: #fff; font-size: 0.9rem;
}
.landing-nav .nav button:hover { background: rgba(255, 255, 255, 0.15); }
.landing-nav .nav-cta {
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 10px;
}

.hero { position: relative; min-height: 82vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(28, 25, 23, 0.82) 0%, rgba(28, 25, 23, 0.45) 55%, rgba(28, 25, 23, 0.2) 100%);
}
.hero-content { position: relative; z-index: 2; color: #fff; max-width: 640px; padding: 120px 16px 80px; }
.hero-eyebrow {
  display: inline-block;
  background: rgba(249, 115, 22, 0.9);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.hero-content h1 { font-size: 2.6rem; line-height: 1.15; font-weight: 900; margin-bottom: 14px; }
.hero-content p { font-size: 1.05rem; opacity: 0.92; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .hero-content h1 { font-size: 1.9rem; }
}

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding: 48px 16px; }
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.feature-icon { font-size: 1.9rem; margin-bottom: 8px; }
.feature h3 { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.feature p { font-size: 0.88rem; color: var(--muted); }

.cta-band { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding: 48px 0; margin-top: 40px; }
.cta-band-inner { text-align: center; }
.cta-band h2 { font-size: 1.7rem; font-weight: 900; margin-bottom: 8px; }
.cta-band p { opacity: 0.95; margin-bottom: 20px; }
.cta-band .btn { background: #fff; color: var(--primary-dark); }
.cta-band .btn:hover { background: var(--primary-soft); }

.footer { background: #1c1917; color: #cfcfc7; padding: 28px 0; margin-top: 0; }
.footer p { font-size: 0.9rem; }

/* ---------- Auth hero (login / registro) ---------- */
.auth-hero { min-height: 100vh; display: flex; }
.auth-image { position: relative; flex: 1 1 50%; min-height: 100vh; display: none; }
.auth-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-image-overlay { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(249, 115, 22, 0.55), rgba(28, 25, 23, 0.75)); }
.auth-image-text {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  color: #fff; padding: 40px;
}
.auth-image-text h2 { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; }
.auth-image-text p { opacity: 0.92; }
@media (min-width: 900px) {
  .auth-image { display: block; }
}

.auth-panel {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 20px;
  background: var(--bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.5rem; font-weight: 900; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 20px; }
.back-link {
  align-self: flex-start;
  margin-bottom: 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.back-link:hover { color: var(--text); }
.auth-switch { margin-top: 16px; font-size: 0.88rem; color: var(--muted); }
.auth-switch a { color: var(--primary-dark); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ---------- Usuarios ---------- */
.role-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.role-select:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Reportes ---------- */
.report-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.report-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.report-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.report-section { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.report-section h3 { margin: 0 0 12px; }
.report-ai { border-left: 4px solid var(--accent, #4a7dff); }
.report-ai-text { white-space: pre-wrap; font-family: inherit; line-height: 1.6; background: #f7f8fa; border: 1px solid var(--border); border-radius: 8px; padding: 14px; font-size: 0.95rem; margin: 0; }
.small { font-size: 0.8rem; }
.alert-error { background: #fdecea; border: 1px solid #f5c6c2; color: #b3261e; }
.alert-warn { background: #fff8e1; border: 1px solid #ffe082; color: #7a5c00; }
.alert-error, .alert-warn { border-radius: 8px; padding: 10px 14px; margin: 10px 0; }

/* ---------- Markdown (reporte IA) ---------- */
.md-view { font-size: 0.95rem; line-height: 1.6; }
.md-view h3, .md-view h4 { margin: 14px 0 6px; color: var(--primary-dark); }
.md-view h3:first-child, .md-view h4:first-child { margin-top: 0; }
.md-view p { margin: 6px 0; }
.md-view ul, .md-view ol { margin: 6px 0 6px 22px; }
.md-view li { margin: 3px 0; }
.md-view blockquote {
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}
.report-ai-text { background: #f7f8fa; border: 1px solid var(--border); border-radius: 8px; padding: 14px; }

/* ---------- Citas ---------- */
.appt-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.appt-status.pending { background: #fef9c3; color: #a16207; }
.appt-status.confirmed { background: #dcfce7; color: #15803d; }
.appt-status.done { background: #e0e7ff; color: #3730a3; }
.appt-status.cancelled { background: #fee2e2; color: #b91c1c; }

/* ---------- Chat widget ---------- */
.chat-widget { position: fixed; right: 18px; bottom: 18px; z-index: 200; }
.chat-fab {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(249, 115, 22, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 34px rgba(249, 115, 22, 0.55); }
.chat-fab-icon { font-size: 1.9rem; line-height: 1; }
.chat-fab .chat-fab-icon { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3)); }

.chat-panel {
  position: fixed;
  right: 18px;
  bottom: 90px;
  width: 360px;
  max-width: calc(100vw - 36px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  animation: chatIn 0.22s ease;
}
@keyframes chatIn {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}
.chat-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.chat-title { flex: 1; line-height: 1.3; }
.chat-title strong { font-size: 0.95rem; display: block; }
.chat-title span { font-size: 0.75rem; opacity: 0.9; }
.chat-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.05rem;
  padding: 4px 6px;
  border-radius: 8px;
}
.chat-close:hover { background: rgba(255, 255, 255, 0.18); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f7f5;
}
.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.chat-bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.chat-msg.bot .chat-bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-top-right-radius: 4px;
}
.chat-msg.user .chat-bubble .md-view p { color: #fff; }
.chat-msg.user .chat-bubble .md-view ul,
.chat-msg.user .chat-bubble .md-view ol { color: #fff; }
.chat-msg.user .chat-bubble .md-view li { color: #fff; }
.chat-msg.user .chat-bubble .md-view blockquote { color: #fff; background: rgba(255,255,255,0.16); border-left-color: #fff; }
.chat-bubble.typing span {
  display: inline-block;
  animation: bounce 1.2s infinite;
  margin-right: 3px;
  color: var(--muted);
  font-weight: 800;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-4px); } }

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.chat-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.75rem;
  font-weight: 600;
}
.chat-chip:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.86rem;
  outline: none;
}
.chat-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); }
.chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}
.chat-send:hover { background: var(--primary-dark); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

