/* Guthersa look & feel — paleta real extraída del logo y guthersa.com.
   Verde corporativo dominante (la hoja del logo + ISO 14001). */

:root {
  /* Verde Guthersa (extraído del logo color) */
  --gu-green: #024F2A;
  --gu-green-deep: #013119;
  --gu-green-soft: #E8F2EC;
  --gu-green-mid: #2C7A4F;

  /* Acento heritage / energía */
  --gu-leaf: #6BAE7A;       /* verde hoja más claro, para iconografía */
  --gu-amber: #B8862E;      /* heritage 1985, usar con moderación */
  --gu-amber-light: #F5EBD3;

  --slate-50: #F7F9FC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-600: #475569;
  --slate-800: #1F2A3D;
  --slate-950: #0B1220;

  --success: #2F7D4F;
  --warning: #C97A0E;
  --error: #B83236;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(2, 79, 42, 0.06), 0 1px 3px rgba(2, 79, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(2, 79, 42, 0.10);
  --shadow-lg: 0 12px 32px rgba(2, 79, 42, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--slate-950);
  background: white;
}

a { color: var(--gu-green); text-decoration: none; }
a:hover { text-decoration: underline; }

.serif { font-family: 'Source Serif 4', Georgia, serif; font-style: italic; }
.mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  background: white;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--slate-200);
}
.topbar .brand {
  display: flex; align-items: center; gap: 12px;
}
.topbar .brand img {
  height: 40px;
  width: auto;
  display: block;
}
.topbar .brand-tag {
  font-size: 12px;
  color: var(--slate-600);
  letter-spacing: 0.04em;
  border-left: 1px solid var(--slate-300);
  padding-left: 12px;
  margin-left: 4px;
}
.topbar nav { display: flex; align-items: center; gap: 28px; }
.topbar nav a {
  color: var(--slate-800);
  font-weight: 500;
  font-size: 14px;
}
.topbar nav a:hover { color: var(--gu-green); text-decoration: none; }
.topbar nav a.cta {
  background: var(--gu-green);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius);
}
.topbar nav a.cta:hover { background: var(--gu-green-deep); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(circle at 90% 20%, rgba(107,174,122,0.12) 0%, transparent 60%),
    linear-gradient(180deg, white 0%, var(--gu-green-soft) 100%);
  padding: 80px 40px 96px;
  border-bottom: 1px solid var(--slate-200);
}
.hero-inner { max-width: 1100px; margin: 0 auto; }
.hero .tag {
  display: inline-block;
  background: var(--gu-green-soft);
  color: var(--gu-green);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  border: 1px solid var(--gu-green);
}
.hero h1 {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--gu-green-deep);
  max-width: 800px;
  line-height: 1.12;
}
.hero h1 em {
  font-style: italic;
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  color: var(--gu-green);
}
.hero p.lead {
  font-size: 19px;
  color: var(--slate-600);
  max-width: 680px;
  margin: 0 0 32px;
  line-height: 1.5;
}
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 80ms, box-shadow 120ms, background 120ms;
}
.btn-primary {
  background: var(--gu-green); color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--gu-green-deep); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: white; color: var(--gu-green);
  border: 1px solid var(--gu-green);
}
.btn-secondary:hover { background: var(--gu-green-soft); }

/* ── Categorías de servicio ──────────────────────────────────────────────── */
.section { padding: 72px 40px; background: white; }
.section.alt { background: var(--slate-50); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--gu-green-deep);
  letter-spacing: -0.02em;
}
.section .subtitle {
  color: var(--slate-600);
  margin: 0 0 36px;
  font-size: 17px;
}
.cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.cat {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
}
.cat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gu-green);
}
.cat .icon {
  width: 44px; height: 44px;
  background: var(--gu-green-soft);
  color: var(--gu-green);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  font-weight: 700;
}
.cat h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--gu-green-deep);
}
.cat p {
  font-size: 14px;
  color: var(--slate-600);
  margin: 0;
  line-height: 1.5;
}

/* ── Demo strip (instrucciones para Rodrigo durante la llamada) ─────────── */
.demo-strip {
  background: var(--gu-green-deep);
  color: rgba(255,255,255,0.94);
  padding: 36px 40px;
  border-radius: var(--radius-lg);
  margin: 36px 0;
  border-left: 4px solid var(--gu-leaf);
}
.demo-strip h3 {
  margin: 0 0 8px;
  color: white;
  font-size: 20px;
}
.demo-strip .sub {
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  margin: 0 0 18px;
}
.demo-strip ul { margin: 0; padding-left: 20px; }
.demo-strip li { margin: 8px 0; font-size: 14px; line-height: 1.5; }
.demo-strip li strong { color: var(--gu-leaf); }
.demo-strip code {
  background: rgba(255,255,255,0.14);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: white;
}
.demo-strip select {
  background: white;
  color: var(--slate-950);
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  margin-top: 8px;
  min-width: 320px;
}

/* ── Use cases section ──────────────────────────────────────────────────── */
.use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.uc {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}
.uc.highlight {
  border-color: var(--gu-green);
  box-shadow: var(--shadow-md);
}
.uc.highlight::before {
  content: '⭐ Caso estrella';
  position: absolute;
  top: -10px; left: 16px;
  background: var(--gu-amber);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}
.uc h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gu-green-deep);
  margin: 0 0 8px;
}
.uc p { color: var(--slate-600); font-size: 14px; margin: 0 0 12px; }
.uc .example {
  background: var(--slate-50);
  padding: 10px 14px;
  border-radius: var(--radius);
  border-left: 3px solid var(--gu-green);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--slate-800);
}

/* ── Certificaciones ─────────────────────────────────────────────────────── */
.certs {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
.cert {
  background: white;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-800);
  letter-spacing: 0.04em;
}
.cert-label {
  font-size: 12px;
  color: var(--slate-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 8px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  background: var(--gu-green-deep);
  color: rgba(255,255,255,0.85);
  padding: 48px 40px 24px;
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
}
.footer-grid h4 {
  color: white;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 12px;
}
.footer-grid p { font-size: 14px; line-height: 1.6; margin: 0 0 6px; }
.footer-grid a { color: rgba(255,255,255,0.85); }
.footer-grid img { height: 36px; width: auto; margin-bottom: 12px; }
.footer-bottom {
  max-width: 1100px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom .heritage {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  color: var(--gu-leaf);
}

/* ── Widget (chat flotante) ─────────────────────────────────────────────── */
#gu-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}
#gu-bubble {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--gu-green);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  border: none;
  transition: transform 120ms, background 120ms;
}
#gu-bubble:hover { transform: scale(1.08); background: var(--gu-green-deep); }
#gu-bubble::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 12px; height: 12px;
  background: var(--gu-leaf);
  border: 2px solid white;
  border-radius: 50%;
}

#gu-panel {
  display: none;
  width: 410px;
  height: 620px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  flex-direction: column;
}
#gu-panel.open { display: flex; }
#gu-header {
  background: var(--gu-green);
  color: white;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#gu-header .title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 10px; }
#gu-header .title::before {
  content: '';
  width: 9px; height: 9px;
  background: var(--gu-leaf);
  border-radius: 50%;
  display: inline-block;
}
#gu-header .sub { font-size: 11px; opacity: 0.8; margin-top: 2px; }
#gu-header .close {
  background: transparent; border: none; color: white;
  font-size: 22px; cursor: pointer; line-height: 1;
}
#gu-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gu-msg {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.gu-msg.bot {
  background: white;
  border: 1px solid var(--slate-200);
  align-self: flex-start;
  color: var(--slate-950);
}
.gu-msg.user {
  background: var(--gu-green);
  color: white;
  align-self: flex-end;
}
.gu-msg.tool {
  align-self: flex-start;
  background: var(--gu-amber-light);
  color: var(--gu-amber);
  border: 1px dashed var(--gu-amber);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  white-space: pre-wrap;
}
.gu-typing {
  align-self: flex-start;
  display: inline-flex; gap: 4px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
}
.gu-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gu-green);
  animation: bounce 1.2s infinite;
}
.gu-typing span:nth-child(2) { animation-delay: 0.15s; }
.gu-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
#gu-input-row {
  display: flex;
  border-top: 1px solid var(--slate-200);
  background: white;
}
#gu-input {
  flex: 1;
  border: none;
  padding: 14px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  color: var(--slate-950);
}
#gu-input:focus { background: var(--slate-50); }
#gu-send {
  background: var(--gu-green);
  color: white;
  border: none;
  padding: 0 22px;
  cursor: pointer;
  font-size: 18px;
}
#gu-send:hover { background: var(--gu-green-deep); }
#gu-foot {
  font-size: 11px;
  color: var(--slate-400);
  text-align: center;
  padding: 8px;
  border-top: 1px solid var(--slate-100);
}

/* ── Admin ──────────────────────────────────────────────────────────────── */
.admin-wrap { max-width: 1280px; margin: 32px auto; padding: 0 32px; }
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.kpi {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.kpi .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-600);
  font-weight: 500;
}
.kpi .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gu-green);
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.kpi .delta { font-size: 12px; color: var(--success); }

.panel {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
}
.panel h3 {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--slate-100);
  font-size: 15px;
  font-weight: 600;
  color: var(--gu-green-deep);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table th {
  background: var(--slate-50);
  text-align: left;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--slate-600);
  font-weight: 600;
  padding: 11px 16px;
  border-bottom: 1px solid var(--slate-200);
}
table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-800);
}
table tr:hover td { background: var(--slate-50); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge.resolved { background: rgba(47,125,79,0.15); color: var(--success); }
.badge.escalated { background: var(--gu-amber-light); color: var(--gu-amber); }
.badge.escalation { background: var(--gu-amber-light); color: var(--gu-amber); }
.badge.order_status { background: var(--gu-green-soft); color: var(--gu-green); }
.badge.price { background: var(--gu-green-soft); color: var(--gu-green); }
.badge.lead { background: var(--gu-amber-light); color: var(--gu-amber); }
.badge.general { background: var(--slate-100); color: var(--slate-600); }

.empty {
  padding: 40px;
  text-align: center;
  color: var(--slate-400);
  font-size: 14px;
}

.reset-btn {
  background: white;
  color: var(--error);
  border: 1px solid var(--error);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  margin-left: 12px;
}
.reset-btn:hover { background: var(--error); color: white; }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 34px; }
}
