/* Rosello CRM — tema oscuro con paneles de vidrio. */
:root {
  --bg: #0A0E17;
  --text: #EEF1F7;
  --soft: #C9D0DD;
  --muted: #9AA3B5;
  --line: rgba(255, 255, 255, 0.09);
  --glass: rgba(255, 255, 255, 0.045);
  --accent: #4FD1C5;
  --accent-ink: #06201D;
  --warn: #F5C065;
  --bad: #FF9DB0;
  --good: #6EE7A0;
  --display: Fraunces, Georgia, serif;
  --body: Manrope, "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body); font-size: 14px; line-height: 1.45; color: var(--text);
  background: radial-gradient(900px 520px at 88% -8%, rgba(79, 209, 197, 0.16), transparent 62%),
    radial-gradient(760px 520px at -8% 104%, rgba(110, 168, 255, 0.13), transparent 60%), var(--bg);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #8CE6DD; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, p { margin: 0; }
small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }

/* Estructura */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 1 1 248px; padding: 28px 20px; display: flex; flex-direction: column; gap: 28px;
  background: rgba(255, 255, 255, 0.03); border-right: 1px solid var(--line);
}
.main { flex: 999 1 560px; min-width: 0; padding: 32px clamp(16px, 3vw, 40px) 48px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand strong { display: block; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; font-weight: 500; color: var(--soft); }
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav a.on { font-weight: 600; color: var(--accent); background: rgba(79, 209, 197, 0.12); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.side-sites { display: flex; flex-direction: column; gap: 4px; }
.side-sites .eyebrow { padding: 0 12px 6px; }
.side-sites a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: var(--text); }
.side-sites a:hover { background: rgba(255, 255, 255, 0.05); }
.side-sites .num { color: var(--muted); }
.me { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.me strong { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.icon-btn { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--soft); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

/* Cabecera de página */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head h1 { font-family: var(--display); font-weight: 500; font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
.head .sub { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.head .after { font-size: 14px; color: var(--muted); margin-top: 8px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* Controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px;
  font: inherit; font-weight: 600; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16); cursor: pointer;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.btn.primary { font-weight: 700; color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.btn.primary:hover { background: #6FDDD3; color: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: rgba(255, 157, 176, 0.45); background: transparent; }
.btn.sm { height: 40px; padding: 0 14px; border-radius: 10px; font-size: 13px; }
.btn.block { width: 100%; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; font: inherit; color: var(--text);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.14);
}
select { background-color: #141A27; }
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #8690A3; }
label { font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { margin-top: 6px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px 16px; }
.fields > div { display: flex; flex-direction: column; gap: 6px; }
.fields .wide { grid-column: 1 / -1; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline input, .inline select { width: auto; flex: 1 1 180px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--soft); border: 1px solid rgba(255, 255, 255, 0.16); }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tab.on { color: var(--accent-ink); background: var(--text); border-color: transparent; }
.flash { padding: 12px 16px; border-radius: 12px; font-weight: 600; border: 1px solid rgba(110, 231, 160, 0.45); background: rgba(110, 231, 160, 0.09); color: #B9F5D0; }
.flash.err { border-color: rgba(255, 157, 176, 0.5); background: rgba(255, 157, 176, 0.09); color: #FFC9D3; }
.flash.warn { border-color: rgba(245, 192, 101, 0.5); background: rgba(245, 192, 101, 0.09); color: #FBDFA6; }

/* Tarjetas */
.card { border-radius: 18px; background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.card.pad { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.card > .card-head { padding: 20px 22px; }
.card.pad > .card-head { padding: 0; }
.card h2 { font-size: 16px; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; align-items: start; }
.col-stack { display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.kpi { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-family: var(--display); font-size: 44px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.kpi em.up { color: var(--good); font-weight: 600; }
.kpi.hot { background: rgba(79, 209, 197, 0.09); border-color: rgba(79, 209, 197, 0.45); }
.kpi.hot span, .kpi.hot em { color: #B9EFE9; }
.kpi.hot b { color: var(--accent); }

/* Etiquetas */
.chip { flex: none; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--c); border: 1px solid var(--c); background: rgba(255, 255, 255, 0.04); }
.site { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--c); border: 1px solid var(--c); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

/* Barras */
.bar { display: flex; flex-direction: column; gap: 8px; }
.bar > div:first-child { display: flex; justify-content: space-between; gap: 12px; }
.bar b { font-variant-numeric: tabular-nums; }
.track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); }
.track i { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--c, var(--accent)); }
.chart { width: 100%; height: auto; display: block; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Listas y tablas */
.scroll { overflow-x: auto; }
.rows { min-width: 820px; display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 2.3fr 1.5fr 1.4fr 1.1fr 0.9fr; gap: 16px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--text); }
a.row:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.row.th { padding: 10px 22px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.row strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.row small { font-size: 13px; overflow-wrap: anywhere; }
.empty { padding: 28px 22px; border-top: 1px solid var(--line); color: var(--muted); }
table.tbl { width: 100%; min-width: 720px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 14px 16px; text-align: right; border-top: 1px solid var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 22px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 22px; }
.tbl thead th { padding-top: 10px; padding-bottom: 10px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tbl tbody th { font-weight: 600; }
.tbl tr.total > * { font-weight: 700; background: rgba(255, 255, 255, 0.04); border-top-color: rgba(255, 255, 255, 0.16); }
.tbl.left td, .tbl.left th { text-align: left; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Pipeline */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 12px; padding: 14px; min-height: 160px; border-radius: 18px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08); }
.col.over { border-color: var(--c); background: rgba(255, 255, 255, 0.07); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; border-bottom: 2px solid var(--c); }
.col-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.col-head h2 { flex: 1; font-size: 14px; font-weight: 700; }
.col-head b { font-family: var(--display); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kcard { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); cursor: grab; }
.kcard:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.24); }
.kcard.drag { opacity: 0.45; }
.kcard .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.kcard .chip { height: 22px; font-size: 10px; }
.kcard strong { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.kcard .svc { font-size: 13px; color: #B4BCCB; overflow-wrap: anywhere; }
.kcard .next { font-size: 12px; font-weight: 600; color: var(--soft); padding-top: 8px; border-top: 1px solid var(--line); }
.col .more { padding: 4px; font-size: 12px; color: var(--muted); text-align: center; }

/* Ficha del lead */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 8px; padding: 14px; }
.steps button { height: 44px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--soft); background: transparent; border: 1px solid rgba(255, 255, 255, 0.14); cursor: pointer; }
.steps button:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.steps button.on { font-weight: 700; color: #071325; background: var(--c); border-color: transparent; }
dl.data { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px 16px; }
dl.data dt { color: var(--muted); }
dl.data dd { margin: 0; overflow-wrap: anywhere; }
dl.data.sm { font-size: 13px; padding-top: 14px; border-top: 1px solid var(--line); }
.message { font-size: 15px; line-height: 1.6; color: #DDE2EC; white-space: pre-line; overflow-wrap: anywhere; }
.follow { padding: 20px 22px; border-radius: 18px; background: rgba(245, 192, 101, 0.08); border: 1px solid rgba(245, 192, 101, 0.4); display: flex; flex-direction: column; gap: 14px; }
.follow .eyebrow { color: var(--warn); }
.follow.late { background: rgba(255, 157, 176, 0.08); border-color: rgba(255, 157, 176, 0.5); }
.follow.late .eyebrow { color: var(--bad); }
.follow strong { font-size: 15px; font-weight: 600; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline li > i { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--c, var(--muted)); }
.timeline strong { display: block; font-weight: 600; }
.timeline p { margin-top: 4px; color: var(--soft); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.timeline small { margin-top: 4px; }
.todo { display: flex; flex-direction: column; }
.todo a { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); }
.todo a:first-child { border-top: 0; padding-top: 0; }
.todo .late { color: var(--bad); font-weight: 600; }

/* Ajustes */
pre.code { margin: 0; padding: 14px; border-radius: 12px; overflow-x: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; color: #D5F5F1; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
details.site-box { border-top: 1px solid var(--line); }
details.site-box summary { display: flex; align-items: center; gap: 12px; padding: 16px 22px; cursor: pointer; list-style: none; }
details.site-box summary::-webkit-details-marker { display: none; }
details.site-box summary:hover { background: rgba(255, 255, 255, 0.04); }
details.site-box .inner { padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 16px; }

/* Acceso */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 32px; display: flex; flex-direction: column; gap: 14px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.auth-card h1 { font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: -0.02em; }
.auth-card .btn { margin-top: 10px; }

@media (max-width: 720px) {
  .side { gap: 18px; padding: 20px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-sites { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { flex: 1 1 auto; justify-content: center; }
  .me { margin-top: 0; }
  dl.data { grid-template-columns: 90px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .tab, .kcard, .col, a.row { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
}
