/* Phishibly · panel (Mi cuenta).
   Hoja propia, separada de la portada: más sobria, para trabajar. Sigue la skill dashboard-design:
   contenido limitado a 1180 px (decisión del usuario: "boxed"), página gris, tarjetas blancas con borde suave,
   un acento (Ocean de la marca) para los análisis y rojo solo para el phishing. Las explicaciones van en tooltips.
   Cada color es un token con valor claro y oscuro. */
:root {
  --page: #f6f7f9;
  --card: #ffffff;
  --soft: #f0f2f5;
  --ink: #101827;
  --ink-2: #3b4454;
  --muted: #5d6676;          /* ≥ 4,5:1 sobre card, soft y page */
  --line: rgb(16 24 39 / 0.08);
  --line-strong: rgb(16 24 39 / 0.16);
  --accent: #1373a8;          /* Ocean de la marca: análisis, selección, foco */
  --accent-rgb: 19 115 168;
  --on-accent: #ffffff;
  --down: #c81e1e;            /* phishing */
  --down-rgb: 200 30 30;
  --warn: #b45309;            /* spam */
  --warn-rgb: 180 83 9;
  --ok: #157347;
  --ok-rgb: 21 115 71;
  --hook: #f5a447;
  --tip: #1b2230;
  --shadow-card: 0 1px 2px rgb(16 24 39 / 0.04), 0 1px 1px rgb(16 24 39 / 0.02);
  --shadow-pop: 0 12px 32px -8px rgb(16 24 39 / 0.22), 0 0 0 1px rgb(16 24 39 / 0.06);
  --radius: 14px;
  --maxw: 1180px;
  --gutter: clamp(16px, 3vw, 32px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0c1018; --card: #131925; --soft: #1a2130; --ink: #eef1f6; --ink-2: #c3cad6; --muted: #8e98a8;
    --line: rgb(255 255 255 / 0.08); --line-strong: rgb(255 255 255 / 0.16);
    --accent: #5fb0e6; --accent-rgb: 95 176 230; --on-accent: #06121d;
    --down: #ff6b6b; --down-rgb: 255 107 107; --warn: #f0a640; --warn-rgb: 240 166 64; --ok: #46c38a; --ok-rgb: 70 195 138;
    --tip: #2a3446;
    --shadow-card: 0 0 0 1px rgb(255 255 255 / 0.02);
    --shadow-pop: 0 12px 32px -8px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.08);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 14px/1.5 Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 15px; font-weight: 600; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.tabular, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 50; background: var(--ink); color: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.box { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
[hidden] { display: none !important; }

/* Controles */
.btn, button { font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
input, select {
  width: 100%; height: 36px; padding: 0 10px; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 10px;
}
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: 10px; min-width: 0; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-card), 0 0 0 1px var(--line); }
.seg.small button { height: 26px; padding: 0 10px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.chip.pro { background: rgb(var(--accent-rgb) / 0.12); color: var(--accent); }
.chip.ok { background: rgb(var(--ok-rgb) / 0.12); color: var(--ok); }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand img { width: 105px; height: 26px; }
.crumb { padding-left: 12px; border-left: 1px solid var(--line-strong); color: var(--muted); font-weight: 500; }
.grow { flex: 1; }
.menu { position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgb(var(--accent-rgb) / 0.14); color: var(--accent); font-weight: 600; cursor: pointer; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--card); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 40; }
.pop-email { padding: 8px 10px 0; font-weight: 500; overflow-wrap: anywhere; }
.pop-plan { padding: 0 10px 8px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop a, .pop button { display: flex; width: 100%; align-items: center; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; }
.pop a:hover, .pop button:hover { background: var(--soft); }

/* Página */
main { padding-block: 24px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.note { margin-bottom: 16px; padding: 10px 12px; border-radius: 10px; background: rgb(var(--warn-rgb) / 0.12); color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 26px; }
.count { color: var(--muted); font-weight: 500; }
.grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.fill { display: flex; flex-direction: column; }
.fill .chart { flex: 1; min-height: 220px; height: auto; }
.span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; }
#historial { margin-bottom: 16px; }
.more-btn { display: flex; justify-content: center; padding: 14px 20px 0; border-top: 1px solid var(--line); margin: 0 -20px; }

/* Cifras */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 16px 18px; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-weight: 500; }
.kpi .ico { width: 26px; height: 26px; border-radius: 8px; background: var(--soft); color: var(--muted); display: grid; place-items: center; flex: none; }
.kpi .ico svg { width: 15px; height: 15px; }
.kpi .val { margin-top: 8px; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .val.alert { color: var(--down); }
.kpi .val small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .base { margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi .meter { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.kpi .meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.kpi .meter i.full { background: var(--warn); }

/* Gráfico */
.chart { position: relative; height: 220px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid-l { stroke: var(--line); }
.chart .bar-all { fill: rgb(var(--accent-rgb) / 0.22); }
.chart .bar-cap { fill: var(--accent); }
.chart .bar-risk { fill: var(--down); }
.chart .bar-today { fill: none; stroke: var(--accent); stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover, .chart .hit:focus { fill: rgb(var(--accent-rgb) / 0.06); outline: none; }
.legend { display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-all { background: rgb(var(--accent-rgb) / 0.35); box-shadow: inset 0 2px 0 var(--accent); }
.sw-risk { background: var(--down); }

/* Listas */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 2px; border-top: 1px solid var(--line); } /* taste-skill-ignore: separadores de lista de datos */
.rows li:first-child { border-top: 0; padding-top: 2px; }
.rows .who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .sub { grid-column: 2; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .when { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
.rows .act { grid-column: 3; justify-self: end; font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 500; }
.rows .act:hover { text-decoration: underline; }
.pct { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lv-critico, .lv-alto { background: rgb(var(--down-rgb) / 0.12); color: var(--down); }
.k-spam.lv-critico, .k-spam.lv-alto { background: rgb(var(--warn-rgb) / 0.13); color: var(--warn); }
.lv-moderado { background: rgb(var(--warn-rgb) / 0.13); color: var(--warn); }
.lv-bajo { background: rgb(var(--ok-rgb) / 0.12); color: var(--ok); }
.empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

.ranked { list-style: none; margin: 0; padding: 0; }
.ranked li { position: relative; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 4px 6px; }
.ranked .name { flex: 1; font-weight: 500; }
.ranked .v { font-variant-numeric: tabular-nums; }
.ranked .share { width: 48px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ranked .track { position: absolute; left: 4px; right: 4px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--soft); }
.ranked .track i { display: block; height: 100%; border-radius: 2px; background: rgb(var(--accent-rgb) / 0.75); }

/* Historial */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); white-space: nowrap; } /* taste-skill-ignore: tabla de datos real */
th { font-size: 12px; font-weight: 500; color: var(--muted); border-top: 0; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td.date { color: var(--muted); font-variant-numeric: tabular-nums; }
td.subj { max-width: 280px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
td.who { max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
td.who .line2 { display: none; }
td.r, th.r { text-align: right; }
tbody tr:hover td { background: var(--soft); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.more { padding: 12px 20px 0; color: var(--muted); font-size: 13px; }

/* Plan e IA */
.price { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.facts { list-style: none; margin: 10px 0 16px; padding: 0; color: var(--ink-2); }
.facts li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); } /* taste-skill-ignore: lista de datos */
.facts li span:last-child { color: var(--ink); font-weight: 500; text-align: right; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }

/* Bloqueado (plan gratuito): muestra de ejemplo difuminada con una sola llamada a la acción */
.locked { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--page) 55%, transparent); backdrop-filter: blur(5px); border-radius: var(--radius); }
.locked-box { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 20px 24px; }
.locked-title { font-weight: 600; font-size: 15px; }
.locked-box .btn { margin-top: 12px; }
.is-sample { pointer-events: none; user-select: none; }

/* Acceso */
.login { max-width: 420px; margin: 8vh auto; text-align: center; padding: 32px 28px; display: grid; justify-items: center; gap: 10px; }
.login .gsi { min-height: 44px; margin-top: 8px; }

/* Tooltip único */
.tip { position: fixed; z-index: 60; max-width: 260px; padding: 8px 10px; border-radius: 8px; background: var(--tip); color: #fff; font-size: 12px; line-height: 1.4; pointer-events: none; box-shadow: var(--shadow-pop); }
.tip b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tip span { color: #c3cad6; }
[data-tip] { cursor: default; }

/* Pie */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 8px 32px; color: var(--muted); font-size: 13px; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* Anchos */
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-7, .span-5, .span-6 { grid-column: span 12; }
  .span-4 { grid-column: span 6; }
  #origen { grid-column: span 12; }
}
@media (max-width: 640px) {
  .hide-s { display: none; }
  .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.three .kpi:first-child { grid-column: span 2; }
  .kpi .val { font-size: 26px; }
  .span-4 { grid-column: span 12; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-head .seg { align-self: stretch; }
  .page-head .seg button { flex: 1; }
  .card-head { flex-wrap: wrap; }
  .legend { display: none; }
  .chart { height: 180px; }
  /* El historial pliega columnas: el asunto y el origen pasan a la segunda línea del remitente */
  th.c-date, td.date, th.c-subj, td.subj, th.c-via, td.via, th.c-ai, td.ai { display: none; }
  td.who { max-width: 210px; padding-left: 20px; }
  td.who .line2 { display: block; font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
