/* Univox Client AI Dashboard — brand styles. Rounded corners by house rule.
   Brand palette sampled from the official Univox logo (univox-logo.jpg):
   wordmark blue #095587 (dominant) / #165D8D (weighted avg),
   swirl orange #EF8E0F (weighted avg) / #EF8903 (dominant). */
:root {
  --brand: #0B5FA5;
  --blue: #095587;
  --blue-mid: #2E86C1;
  --orange: #EF8E0F;
  --ink: #17222b;
  --muted: #6b7a86;
  --line: #dde5ea;
  --bg: #EDF3F8;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
.muted { color: var(--muted); }
.error { color: #b3261e; }

.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--orange); border-radius: 16px; padding: 28px; width: min(380px, 92vw); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 34px rgba(9,85,135,.12); }
.login-card h1 { color: var(--blue); margin: 0; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.login-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; }
.login-card button { background: var(--blue); color: #fff; border: 0; border-radius: 10px; padding: 11px; font-size: 15px; cursor: pointer; }

.brand-strip { height: 5px; background: linear-gradient(90deg, var(--blue) 0%, var(--blue-mid) 45%, var(--orange) 100%); }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: 0 2px 12px rgba(9,85,135,.06); }
/* Tab bar — sits directly under the topbar; the active tab is brand blue
   on a light tint with the sampled swirl-orange underline. */
.tabs { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(9,85,135,.04); }
.tabs-in { max-width: 1080px; margin: 0 auto; padding: 0 20px; display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 13px 16px 10px; color: #5B7C99; text-decoration: none; font-size: 15px; border-bottom: 3px solid transparent; border-radius: 10px 10px 0 0; }
.tab:hover { color: var(--blue); background: #F2F7FB; }
.tab.active { color: var(--blue); font-weight: 700; background: #E9F1F7; border-bottom: 3px solid var(--orange); }

.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { color: var(--blue); font-size: 17px; }
.logo { height: 30px; border-radius: 8px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 3px 12px rgba(9,85,135,.07); }
.card .num { font-size: 30px; font-weight: 700; color: var(--brand); }
.card .lbl { font-size: 13px; color: var(--muted); }

.panel, .detail { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 22px; box-shadow: 0 3px 14px rgba(9,85,135,.06); }
.panel h2 { margin-top: 0; color: var(--blue); font-size: 19px; }
.panel h3 { margin: 18px 0 8px; color: var(--blue); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 .panel { margin-bottom: 22px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.chart .val { font-size: 13px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.chart .lbl { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.callouts { display: flex; gap: 22px; flex-wrap: wrap; margin: 12px 0 0; font-size: 14px; }
.callouts strong { color: var(--orange); }

.donut { width: 190px; height: 190px; flex: 0 0 auto; display: block; }
.donut .dc-num { font-size: 36px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.donut .dc-lbl { font-size: 12.5px; fill: var(--muted); text-anchor: middle; }
.donut-wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; }
.legend { list-style: none; margin: 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 14px; }
.legend .dot { width: 13px; height: 13px; border-radius: 4px; display: inline-block; flex: 0 0 auto; }
.legend-inline { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 8px; }
.legend-inline li { padding: 2px 0; }

.hbar-row { display: grid; grid-template-columns: 168px 1fr 88px; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.hbar-track { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; height: 16px; overflow: hidden; }
.hbar-fill { background: var(--brand); height: 100%; border-radius: 999px; }
.hbar-num { text-align: right; color: var(--muted); font-size: 13px; white-space: nowrap; }

.stackbar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); margin-top: 12px; }
.stackbar > div { height: 100%; }

.ministats { display: flex; gap: 26px; flex-wrap: wrap; margin: 6px 0 10px; }
.ministats > div { display: flex; flex-direction: column; gap: 2px; }
.ministats .n { font-size: 24px; font-weight: 700; color: var(--blue); }
.ministats .l { font-size: 12px; color: var(--muted); max-width: 200px; }
.big-money { font-size: 36px; font-weight: 700; color: var(--orange); margin: 4px 0; }
.funnel { font-size: 15px; margin: 12px 0 4px; }
.funnel strong { color: var(--blue); }
table.calls { width: 100%; border-collapse: collapse; font-size: 14px; }
table.calls th, table.calls td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.calls th { color: var(--muted); font-weight: 600; }
td.summary { max-width: 340px; }

.seed-badge { display: inline-block; background: #fff3cd; color: #7a5b00; border: 1px solid #e6cf7a; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.transcript { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; white-space: pre-wrap; font-size: 13px; max-height: 380px; overflow: auto; }
.foot { margin: 16px 2px; font-size: 12px; }

/* Reportes tab — period presets, custom range and the PDF button. */
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.presets a { padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--blue); background: #fff; font-size: 14px; }
.presets a:hover { background: #F2F7FB; }
.presets a.active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.range-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.range-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.range-form input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; }
.range-form button { background: var(--blue); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; }
.btn-pdf { display: inline-block; background: var(--orange); color: #fff; font-weight: 700; font-size: 15px; padding: 12px 22px; border-radius: 12px; text-decoration: none; box-shadow: 0 3px 12px rgba(239,142,15,.35); }
.btn-pdf:hover { background: #d97f06; }
.money-inline { color: var(--orange); font-size: 20px; }

/* Cobranzas (owner-only section, public/cobranzas.php) — status chips are
   pills in the brand palette; forms and buttons keep the rounded house rule. */
.flash { border-radius: 12px; padding: 13px 16px; font-size: 14px; margin: 0 0 18px; border: 1px solid var(--line); }
.flash-ok { background: #E6F4F1; border-color: #9fd4ca; color: #14532d; }
.flash-err { background: #FDECEA; border-color: #f0b8b3; color: #7c1d16; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
.chip { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-pendiente { background: #EDF1F5; color: #45617a; border: 1px solid #c9d6df; }
.chip-llamado { background: #E9F1F7; color: var(--blue); border: 1px solid #a9c8df; }
.chip-promesa { background: #FCF0DB; color: #8a5a00; border: 1px solid #ecc987; }
.chip-pagado { background: #E6F4F1; color: #0f6a4f; border: 1px solid #9fd4ca; }
.chip-sin_contacto { background: #FDECEA; color: #8c2b23; border: 1px solid #f0b8b3; }
.cob-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cob-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cob-search input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; min-width: 260px; font-family: inherit; }
.cob-search button { background: var(--blue); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; }
.btn-fire { display: inline-block; background: var(--orange); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 18px; border: 0; border-radius: 12px; text-decoration: none; cursor: pointer; box-shadow: 0 3px 12px rgba(239,142,15,.35); }
.btn-fire:hover { background: #d97f06; }
.btn-fire-sm { background: var(--orange); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 13px; border: 0; border-radius: 10px; cursor: pointer; }
.btn-fire-sm:hover { background: #d97f06; }
.btn-ghost { display: inline-block; background: #fff; color: var(--blue); font-size: 14px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; cursor: pointer; }
.btn-ghost:hover { background: #F2F7FB; }
.btn-ghost-sm { display: inline-block; background: #fff; color: var(--blue); font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; cursor: pointer; }
.btn-ghost-sm:hover { background: #F2F7FB; }
td.actions { white-space: nowrap; }
td.actions .inline-form { display: inline-block; margin: 0 4px 4px 0; }
.case-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.case-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.case-form input, .case-form select, .case-form textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--ink); }
.case-form .wide { grid-column: 1 / -1; }
.more-options { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.more-options summary { cursor: pointer; color: var(--blue); font-size: 14px; font-weight: 600; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 12px; }
.form-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 860px) { .case-form, .more-grid { grid-template-columns: 1fr; } }
