/* app.directlead.es — misma identidad que directlead.es */
:root {
  --bg: #f5f8f9; --bg-2: #eaf0f2; --surface: #fff; --fg: #16262f; --fg-2: #4f626c;
  --line: #d3dde1; --navy: #1e3a4c; --navy-ink: #fff; --teal: #238c8e; --teal-dark: #1f7d7f;
  --teal-soft: #dff1f1; --amber: #b9741a; --amber-soft: #fbeedb; --red: #b3382c; --red-soft: #fbe3df;
  --green: #2f7d4f; --green-soft: #e1f2e6; --shadow: 0 14px 40px -22px rgba(22,38,47,.35);
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif; --body: "Source Sans 3", "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--teal); }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 700; } h2 { font-size: 1.25rem; font-weight: 700; } h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; } .muted { color: var(--fg-2); } .small { font-size: .88rem; }
.mono { font-family: var(--mono); font-size: .8rem; }

/* Layout */
.topbar { background: var(--navy); color: var(--navy-ink); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; max-width: 1180px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.brand .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--teal); display: grid; place-items: center; }
.brand b { color: #6fd0d1; font-weight: 700; }
.brand small { font-family: var(--body); font-weight: 400; font-size: .78rem; opacity: .75; margin-left: 6px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: rgba(255,255,255,.8); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: .95rem; }
.topbar nav a:hover, .topbar nav a.on { background: rgba(255,255,255,.12); color: #fff; }
.topbar form { margin: 0; }
.topbar .user { display: flex; align-items: center; gap: 10px; font-size: .9rem; opacity: .9; }
.btn-link { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-block: 26px 48px; display: grid; gap: 22px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-head .sub { color: var(--fg-2); margin-top: 4px; }

/* Cards & grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; }
.card h2, .card h3 { margin-bottom: 10px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.kpi .n { font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--fg-2); font-size: .88rem; margin-top: 6px; }

/* Pilot bar */
.piloto { border: 1px solid var(--line); border-left: 5px solid var(--teal); background: var(--surface); border-radius: 12px; padding: 16px 20px; display: grid; gap: 10px; }
.piloto.aviso { border-left-color: var(--amber); } .piloto.urgente { border-left-color: var(--red); } .piloto.fin { border-left-color: var(--fg-2); }
.piloto-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.piloto-head strong { font-family: var(--display); font-size: 1.1rem; }
.bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.piloto.aviso .bar > span { background: var(--amber); } .piloto.urgente .bar > span { background: var(--red); }
.piloto .msg { color: var(--fg-2); font-size: .95rem; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--bg-2); color: var(--fg-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-teal { background: var(--teal-soft); color: var(--teal); } .pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-green { background: var(--green-soft); color: var(--green); } .pill-red { background: var(--red-soft); color: var(--red); }
.pill-navy { background: var(--navy); color: #fff; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; font-family: var(--body); background: var(--teal); color: #fff; }
.btn:hover { background: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); } .btn-ghost:hover { background: var(--bg-2); border-color: var(--fg-2); }
.btn-sm { padding: 6px 11px; font-size: .85rem; } .btn-danger { background: var(--red); } .btn-danger:hover { background: #932d22; }
.btn-amber { background: var(--amber); } .btn-amber:hover { background: #9a5f14; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
form.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; } .field label { font-size: .88rem; font-weight: 600; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); } @media (max-width: 600px) { .row { grid-template-columns: 1fr; } }
input, select, textarea { width: 100%; font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
textarea { min-height: 90px; resize: vertical; }
select.inline { width: auto; padding: 5px 28px 5px 8px; font-size: .85rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; } .check input { width: auto; margin-top: 4px; }
.alert { padding: 12px 14px; border-radius: 10px; font-size: .95rem; border: 1px solid; }
.alert-ok { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.alert-err { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.alert-info { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-dark); }
.alert-warn { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); font-family: var(--mono); font-weight: 500; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; text-align: right; } th.num { text-align: right; }
.empty { padding: 30px; text-align: center; color: var(--fg-2); border: 1px dashed var(--line); border-radius: 12px; }

/* Opportunity card */
.op { display: grid; grid-template-columns: 1fr auto; gap: 12px 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.op:last-child { border-bottom: 0; }
.op h3 { font-size: 1.05rem; } .op .meta { color: var(--fg-2); font-size: .9rem; }
.op .kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin-top: 8px; font-size: .92rem; }
.op .kv dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-2); } .op .kv dd { margin: 0; }
.op .vender { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.op .vender > div { background: var(--navy); color: #fff; border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.op .vender .lbl { font-family: var(--mono); font-size: .66rem; letter-spacing: .07em; text-transform: uppercase; color: #6fd0d1; }
.op .vender strong { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.op .guion { margin-top: 8px; border-left: 3px solid var(--teal); background: var(--teal-soft); padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: .92rem; }
.op .acciones { display: grid; gap: 8px; align-content: start; min-width: 170px; }
@media (max-width: 700px) { .op { grid-template-columns: 1fr; } }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: min(440px, 100%); padding: 28px; display: grid; gap: 18px; }
.auth .brand { color: var(--fg); justify-content: center; } .auth .brand b { color: var(--teal); }
.auth .brand .mark { background: var(--navy); }
.footer { color: var(--fg-2); font-size: .85rem; text-align: center; padding: 20px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--fg-2); border: 1px solid var(--line); font-size: .88rem; background: var(--surface); }
.tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details.box { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
details.box summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
details.box .inner { padding: 0 16px 16px; }

.tel-mask { font-family: var(--mono); letter-spacing: .04em; }
