/* ============ TuClienteFácil — Panel de cliente ============ */

/* ---------- Login ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; position: relative;
}
.auth-wrap::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px 400px at 20% 10%, var(--hero-glow), transparent 60%),
    radial-gradient(500px 350px at 85% 90%, var(--hero-glow2), transparent 60%);
}
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); padding: 40px 36px;
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-logo img { width: 56px; height: 56px; border-radius: 16px; }
.auth-card h1 { font-size: 24px; text-align: center; color: var(--navy); letter-spacing: -.02em; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14.5px; margin: 8px 0 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 13px 16px; font-family: var(--font); font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }
.auth-row { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; margin: 4px 0 22px; }
.auth-row label { display: flex; align-items: center; gap: 7px; color: var(--muted); cursor: pointer; }
.auth-row a { color: var(--accent-dark); font-weight: 700; }
.auth-row a:hover { text-decoration: underline; }
.auth-card .btn { width: 100%; justify-content: center; height: 52px; font-size: 15.5px; }
.auth-div { display: flex; align-items: center; gap: 14px; margin: 26px 0 18px; color: var(--muted); font-size: 13px; }
.auth-div::before, .auth-div::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-foot { text-align: center; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--accent-dark); font-weight: 700; }
.auth-foot a:hover { text-decoration: underline; }
.auth-back { position: absolute; top: 22px; left: 24px; z-index: 2; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.auth-back:hover { color: var(--accent-dark); }
.auth-lang { position: absolute; top: 22px; right: 24px; z-index: 2; }

/* ---------- Dashboard layout ---------- */
body.dash { background: #F4F6F8; overflow-x: visible; }
.dash-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.dash-side {
  width: 248px; flex-shrink: 0; background: var(--navy); color: #fff;
  display: flex; flex-direction: column; padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
}
.dash-side .logo { color: #fff; font-size: 18px; padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 16px; }
.dash-side .logo img { width: 34px; height: 34px; border-radius: 10px; }
.side-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 14px 10px 8px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10.5px 12px; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; color: rgba(255,255,255,.66);
  transition: background .12s, color .12s;
}
.side-nav a .si { width: 19px; height: 19px; flex-shrink: 0; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: var(--accent); color: #fff; }
.side-nav a .badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 2px 8px; }
.side-nav a.active .badge { background: rgba(255,255,255,.25); }
.side-plan {
  margin-top: auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 14px;
}
.side-plan b { display: block; font-size: 13.5px; }
.side-plan span { font-size: 12px; color: rgba(255,255,255,.55); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; margin-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; }
.side-user b { display: block; font-size: 13.5px; line-height: 1.25; }
.side-user span { font-size: 12px; color: rgba(255,255,255,.5); }

/* Main */
.dash-main { flex: 1; min-width: 0; padding: 26px 34px 60px; }
.dash-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.dash-top h1 { font-size: 24px; color: var(--navy); letter-spacing: -.02em; }
.dash-top .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.dash-tools { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; position: relative;
}
.icon-btn .si { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.demo-flag { background: var(--accent-soft); color: var(--accent-deep); font-size: 12px; font-weight: 700; border-radius: 99px; padding: 5px 12px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.kpi .k-head { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.kpi .k-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-deep); display: flex; align-items: center; justify-content: center; }
.kpi .k-ic .si { width: 16px; height: 16px; }
.kpi .k-num { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k-foot { font-size: 12.5px; margin-top: 4px; color: var(--muted); }
.kpi .k-foot .up { color: #16A34A; font-weight: 700; }

/* Panels grid */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.panel h2 { font-size: 16.5px; color: var(--navy); display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel h2 a { font-size: 13px; color: var(--accent-dark); font-weight: 700; }
.panel h2 a:hover { text-decoration: underline; }

/* Agenda */
.appt { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.appt:last-child { border-bottom: 0; }
.appt .time { width: 58px; flex-shrink: 0; font-weight: 800; font-size: 13.5px; color: var(--navy); font-variant-numeric: tabular-nums; }
.appt .who { flex: 1; min-width: 0; }
.appt .who b { display: block; font-size: 14px; color: var(--ink); }
.appt .who span { font-size: 12.5px; color: var(--muted); }
.chip { font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 4px 11px; white-space: nowrap; }
.chip.ok { background: var(--accent-soft); color: var(--accent-deep); }
.chip.wait { background: #FEF3C7; color: #92400E; }
.chip.moved { background: #E0E7FF; color: #3730A3; }
.chip.new { background: #DBEAFE; color: #1E40AF; }

/* Conversaciones */
.convo { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.convo:last-child { border-bottom: 0; }
.convo .avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; }
.convo .txt { flex: 1; min-width: 0; }
.convo .txt .top { display: flex; justify-content: space-between; gap: 8px; }
.convo .txt b { font-size: 14px; color: var(--ink); }
.convo .txt time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.convo .txt p { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo .txt .bot-tag { color: var(--accent-dark); font-weight: 700; }
.convo .unread { background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 99px; display: flex; align-items: center; justify-content: center; padding: 0 6px; flex-shrink: 0; }

/* Leads pipeline */
.pipe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pipe-col { background: #F8FAFB; border: 1px solid var(--line); border-radius: 13px; padding: 12px; }
.pipe-col h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 10px; }
.pipe-col h3 span { background: var(--accent-soft); color: var(--accent-deep); border-radius: 99px; padding: 1px 8px; }
.lead-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }
.lead-card b { display: block; font-size: 13.5px; color: var(--ink); }
.lead-card span { font-size: 12px; color: var(--muted); }
.lead-card:last-child { margin-bottom: 0; }

/* Campaña */
.camp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.camp-stat { background: #F8FAFB; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.camp-stat span { font-size: 12px; color: var(--muted); font-weight: 700; }
.camp-stat b { display: block; font-size: 21px; color: var(--navy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 9px; height: 130px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.bars .bar em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 700; }
.bars .bar b { font-size: 12.5px; color: var(--navy); font-variant-numeric: tabular-nums; }

/* Actividad */
.feed { display: flex; flex-direction: column; }
.feed .ev { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed .ev:last-child { border-bottom: 0; }
.feed .ev-ic { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.feed .ev-ic .si { width: 15px; height: 15px; }
.ev-ic.g { background: var(--accent-soft); color: var(--accent-deep); }
.ev-ic.b { background: #DBEAFE; color: #1E40AF; }
.ev-ic.a { background: #FEF3C7; color: #92400E; }
.feed .ev p { flex: 1; color: var(--ink); }
.feed .ev p b { color: var(--navy); }
.feed .ev time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* Responsive */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .dash-side { display: none; }
  .dash-main { padding: 20px 18px 50px; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .k-num { font-size: 24px; }
  .camp-stats { grid-template-columns: 1fr; }
  .dash-main { padding: 16px 14px 44px; }
}

/* Mobile sidebar (off-canvas) */
.side-toggle { display: none; }
@media (max-width: 860px) {
  .side-toggle { display: flex; }
  .dash-side { display: flex; position: fixed; z-index: 300; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 60px rgba(0,0,0,.35); }
  .dash-side.open { transform: none; }
  .side-veil { position: fixed; inset: 0; z-index: 290; background: rgba(11,30,58,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-veil.show { opacity: 1; pointer-events: auto; }
}

.side-nav .logout-link { display: flex; align-items: center; gap: 11px; padding: 10.5px 12px; border-radius: 11px; font-size: 14.5px; font-weight: 600; color: rgba(255,255,255,.66); background: none; border: none; cursor: pointer; width: 100%; font-family: inherit; transition: background .12s, color .12s; }
.side-nav .logout-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav .logout-link .si { width: 19px; height: 19px; flex-shrink: 0; }
