/* Visual de Vigía: CSS literal del prototipo v2 aprobado (referencias/prototipo/demo_prototipo_v2.html). No inventar estilos nuevos: ampliar solo con clases nuevas al final. */
  :root{
    --navy:#1F3864; --blue:#2E5C8A; --auto:#3E7CB1; --auto-bg:#EAF2FB; --auto-border:#B9D3EA;
    --amber:#C97A1A; --amber-bg:#FDF1E3; --amber-border:#F0CE9E;
    --green:#3E8E5A; --green-bg:#E9F5EE; --green-border:#BFE3CD;
    --red:#C0392B; --red-bg:#FBE4E1; --red-border:#F1B7AE;
    --ia:#6B3FA0; --ia-bg:#F3EEFA; --ia-border:#CDBCE6;
    --grey:#6B7280; --grey-bg:#F1F2F4; --border:#E3E6EB; --text:#1A1A1A; --sub:#5B6472; --bg:#F5F7FA;
  }
  *{box-sizing:border-box;}
  body{ margin:0; font-family:'Segoe UI', Arial, sans-serif; background:var(--bg); color:var(--text); }
  .app{ max-width:1180px; margin:0 auto; min-height:100vh; background:#fff; box-shadow:0 0 40px rgba(20,30,50,0.08); display:flex; flex-direction:column; }

  .topbar{ background:linear-gradient(135deg, var(--navy), var(--blue)); color:#fff; padding:16px 32px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
  .topbar .brand{ font-size:17px; font-weight:700; display:flex; align-items:center; gap:12px;}
  .topbar .logo-badge{ background:#fff; border-radius:8px; padding:6px 10px; display:flex; align-items:center; box-shadow:0 1px 3px rgba(0,0,0,0.2); flex:none; }
  .topbar .logo-badge svg{ height:26px; width:auto; display:block; }
  .product{ display:flex; flex-direction:column; line-height:1.15; padding-left:14px; border-left:1px solid rgba(255,255,255,.35); }
  .product .name{ font-size:22px; font-weight:700; letter-spacing:.3px; display:flex; align-items:center; gap:8px; }
  .product .name svg{ width:20px; height:20px; flex:none; }
  .product .tag{ font-size:12px; font-weight:600; opacity:.85; }
  .topbar-right{ display:flex; align-items:center; gap:10px; }
  .nav-btn{ background:rgba(255,255,255,0.14); border:1px solid rgba(255,255,255,0.4); color:#fff; padding:8px 14px; border-radius:8px; font-size:13px; font-weight:700; cursor:pointer; }
  .nav-btn:hover, .nav-btn.active{ background:rgba(255,255,255,0.3); }
  .user{ font-size:12.5px; opacity:.95; padding-left:10px; border-left:1px solid rgba(255,255,255,.35); line-height:1.3; }
  .user b{ display:block; font-size:13px; }

  .demo-strip{ background:#FFF8EC; border-bottom:1px solid var(--amber-border); color:#5a3d12; font-size:12.5px; padding:7px 32px; }

  .stepper{ display:flex; padding:18px 32px 14px 32px; background:#fff; border-bottom:1px solid var(--border); align-items:center; flex-wrap:wrap; row-gap:8px; }
  .step{ display:flex; align-items:center; gap:8px; cursor:pointer; opacity:0.45; }
  .step.active, .step.done{ opacity:1; }
  .step-circle{ width:28px; height:28px; border-radius:50%; background:var(--grey-bg); border:2px solid var(--grey); color:var(--grey); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12.5px; flex:none; }
  .step.active .step-circle{ background:var(--auto); border-color:var(--auto); color:#fff; }
  .step.done .step-circle{ background:var(--green); border-color:var(--green); color:#fff; }
  .step-label{ font-size:12.5px; font-weight:600; }
  .step-line{ flex:0 0 18px; height:2px; background:var(--border); margin:0 6px; }

  .content{ flex:1; padding:30px 40px 28px 40px; }
  .screen{ display:none; }
  .screen.active{ display:block; }
  h1.title{ font-size:23px; color:var(--navy); margin:0 0 6px 0; }
  .desc{ color:var(--sub); font-size:14.5px; margin-bottom:20px; max-width:820px; line-height:1.5;}
  .card{ background:#fff; border:1px solid var(--border); border-radius:12px; padding:20px 24px; margin-bottom:16px; }
  .card-title{ font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:0.4px; color:var(--blue); margin-bottom:12px; display:flex; justify-content:space-between; align-items:center; gap:10px; }
  .grid2{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
  .grid3{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }

  .btn{ background:var(--auto); color:#fff; border:none; padding:12px 22px; border-radius:9px; font-size:14.5px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:8px; }
  .btn:hover{ background:var(--navy); }
  .btn.secondary{ background:#fff; color:var(--blue); border:1.5px solid var(--auto-border); }
  .btn.secondary:hover{ background:var(--auto-bg); }
  .btn.success{ background:var(--green); } .btn.success:hover{ background:#2E6B44; }
  .btn.danger{ background:#fff; color:var(--red); border:1.5px solid var(--red-border); }
  .btn.small{ padding:7px 14px; font-size:13px; }
  .btn-row{ display:flex; gap:12px; margin-top:18px; flex-wrap:wrap; }

  .field-grid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px 20px; }
  .field label{ display:block; font-size:11.5px; font-weight:700; color:var(--sub); text-transform:uppercase; letter-spacing:0.3px; margin-bottom:4px; }
  .field input, .field select{ width:100%; font:inherit; font-size:14.5px; color:var(--text); background:var(--auto-bg); border:1px solid var(--auto-border); border-radius:7px; padding:8px 11px; }
  .field input.key{ background:#fff; border:2px solid var(--navy); font-weight:700; }
  .field input.missing{ background:var(--amber-bg); border-color:var(--amber-border); }
  .field .hint{ font-size:11.5px; color:var(--sub); margin-top:3px; }
  .ia-tag{ display:inline-block; font-size:10.5px; font-weight:700; color:var(--ia); background:var(--ia-bg); border:1px solid var(--ia-border); border-radius:100px; padding:1px 8px; text-transform:none; letter-spacing:0; }

  table.t{ width:100%; border-collapse:collapse; }
  table.t th{ background:var(--navy); color:#fff; font-size:12px; text-align:left; padding:8px 11px; }
  table.t td{ padding:9px 11px; font-size:13.5px; border-bottom:1px solid var(--border); vertical-align:top; }
  table.t tr:nth-child(even) td{ background:#FAFBFC; }
  .pill{ display:inline-block; padding:2px 9px; border-radius:100px; font-size:11.5px; font-weight:700; white-space:nowrap; }
  .pill.warn{ background:var(--amber-bg); color:var(--amber); border:1px solid var(--amber-border); }
  .pill.ok{ background:var(--green-bg); color:var(--green); border:1px solid var(--green-border); }
  .pill.danger{ background:var(--red-bg); color:var(--red); border:1px solid var(--red-border); }
  .pill.neutral{ background:var(--grey-bg); color:var(--grey); border:1px solid var(--border); }
  .pill.info{ background:var(--auto-bg); color:var(--blue); border:1px solid var(--auto-border); }
  .pill.ia{ background:var(--ia-bg); color:var(--ia); border:1px solid var(--ia-border); }

  .callout{ display:flex; gap:12px; padding:12px 16px; border-radius:10px; margin-top:12px; font-size:13.5px; line-height:1.5; }
  .callout.info{ background:var(--auto-bg); border:1px solid var(--auto-border); color:#233; }
  .callout.warn{ background:var(--amber-bg); border:1px solid var(--amber-border); color:#4a3210; }
  .callout.ia{ background:var(--ia-bg); border:1px solid var(--ia-border); color:#3b2560; }
  .callout.danger{ background:var(--red-bg); border:1px solid var(--red-border); color:#5a1a12; }

  .inbox-row{ display:grid; grid-template-columns:28px 1.7fr 1fr 150px 130px; gap:12px; align-items:center; padding:11px 4px; border-bottom:1px solid var(--border); font-size:13.5px; }
  .inbox-row.head{ font-size:11.5px; font-weight:700; color:var(--sub); text-transform:uppercase; letter-spacing:.3px; }
  .inbox-row.discard{ color:var(--grey); }
  .inbox-row.sel{ background:var(--auto-bg); border-radius:8px; }
  .dot{ width:10px; height:10px; border-radius:50%; background:var(--auto); }
  .inbox-row.discard .dot{ background:#C9CED6; }

  .dropzone{ border:2px dashed var(--auto-border); border-radius:12px; padding:22px; text-align:center; color:var(--sub); background:#FAFCFF; font-size:14px; }
  .file-row{ display:flex; justify-content:space-between; align-items:center; padding:9px 0; border-bottom:1px solid var(--border); font-size:13.5px; gap:10px; }
  .file-row:last-child{ border-bottom:none; }

  textarea.mail, textarea.ip{ width:100%; font-family:'Consolas', monospace; font-size:13px; line-height:1.6; border:1px solid var(--border); border-radius:8px; padding:14px 16px; color:#222; resize:vertical; }
  textarea.mail{ min-height:290px; }
  textarea.ip{ min-height:430px; }
  .mail-head{ display:grid; grid-template-columns:70px 1fr; gap:6px 10px; font-size:13.5px; margin-bottom:12px; }
  .mail-head span{ color:var(--sub); font-weight:700; }

  .deadline{ border:1px solid var(--border); border-radius:12px; padding:16px 18px; }
  .deadline.warn{ border-color:var(--amber-border); background:#FFFCF7; }
  .deadline.off{ background:#FAFBFC; color:var(--grey); }
  .deadline .dl-name{ font-weight:700; font-size:14px; color:var(--navy); margin-bottom:2px; }
  .deadline .dl-rule{ font-size:12px; color:var(--sub); margin-bottom:10px; }
  .deadline .dl-big{ font-size:24px; font-weight:700; }
  .deadline.warn .dl-big{ color:var(--amber); }
  .deadline .dl-row{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--sub); padding:2px 0; }
  .deadline .dl-row b{ color:var(--text); }

  .audit{ font-size:12.5px; color:var(--sub); }
  .audit div{ padding:5px 0; border-bottom:1px dashed var(--border); }
  .audit b{ color:var(--text); }

  .doc-page{ background:#fff; border:1px solid var(--border); border-radius:4px; padding:26px 30px; font-family:'Consolas', monospace; font-size:13px; line-height:1.7; color:#222; white-space:pre-wrap; }
  .chips{ display:flex; gap:8px; flex-wrap:wrap; }
  .case-chip{ border:1px solid var(--ia-border); background:var(--ia-bg); color:var(--ia); border-radius:8px; padding:6px 10px; font-size:12.5px; }
  .case-chip b{ color:#3b2560; }

  .check-item{ display:flex; align-items:flex-start; gap:10px; padding:9px 0; border-bottom:1px solid var(--border); font-size:13.5px; line-height:1.45; cursor:pointer; }
  .check-item input{ margin-top:3px; width:17px; height:17px; flex:none; }
  .approved{ display:none; }

  .timeline{ position:relative; padding-left:26px; }
  .timeline:before{ content:""; position:absolute; left:9px; top:6px; bottom:6px; width:2px; background:var(--border); }
  .tl-item{ position:relative; margin-bottom:14px; }
  .tl-item:before{ content:""; position:absolute; left:-22px; top:5px; width:12px; height:12px; border-radius:50%; background:var(--green); border:2px solid #fff; box-shadow:0 0 0 1px var(--green); }
  .tl-item.now:before{ background:var(--auto); box-shadow:0 0 0 1px var(--auto); }
  .tl-item.next:before{ background:#fff; box-shadow:0 0 0 1.5px var(--grey); }
  .tl-item.later:before{ background:#fff; box-shadow:0 0 0 1.5px var(--grey); }
  .tl-item.later{ opacity:.75; }
  .tl-title{ font-weight:700; font-size:14px; }
  .tl-text{ font-size:13px; color:var(--sub); line-height:1.45; }
  .mejora{ border:1.5px dashed var(--grey); border-radius:10px; padding:12px 14px; color:var(--grey); background:#FAFBFC; font-size:13px; }
  .mejora b{ color:var(--sub); }

  .dashboard{ display:none; padding:30px 40px 28px 40px; }
  .kpi-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
  .kpi-tile{ background:#fff; border:1px solid var(--border); border-radius:12px; padding:14px 18px; }
  .kpi-tile .num{ font-size:26px; font-weight:700; color:var(--navy); }
  .kpi-tile.danger .num{ color:var(--red); } .kpi-tile.warn .num{ color:var(--amber); } .kpi-tile.ok .num{ color:var(--green); }
  .kpi-tile .lbl{ font-size:12px; color:var(--sub); margin-top:3px; }
  .filter-row{ display:flex; gap:8px; margin:0 0 14px 0; flex-wrap:wrap; align-items:center; }
  .filter-label{ font-size:11.5px; color:var(--sub); font-weight:700; text-transform:uppercase; letter-spacing:0.3px; margin-right:4px; }
  .chip{ background:#fff; border:1px solid var(--border); color:var(--text); padding:5px 13px; border-radius:100px; font-size:12.5px; font-weight:600; cursor:pointer; }
  .chip.active{ background:var(--navy); border-color:var(--navy); color:#fff; }
  .link{ color:var(--blue); font-weight:700; cursor:pointer; text-decoration:underline; }

  /* ---- Panel de Gestión: gráficos ---- */
  .charts-grid{ display:grid; grid-template-columns:1.3fr 1fr; gap:16px; margin-bottom:18px; }
  .chart-card{ background:#fff; border:1px solid var(--border); border-radius:12px; padding:20px 22px; min-width:0; }
  .chart-card.full{ grid-column:1 / -1; }
  .chart-title{ font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:0.4px; color:var(--blue); margin-bottom:2px; }
  .chart-subtitle{ font-size:12px; color:var(--sub); margin-bottom:16px; }

  .bar-chart{ position:relative; height:172px; margin:8px 8px 0 34px; display:flex; align-items:flex-end; justify-content:space-between; gap:10px; }
  .bar-chart .gridline{ position:absolute; left:-34px; right:0; height:1px; background:var(--border); }
  .bar-chart .gridline .tick{ position:absolute; left:0; top:-7px; font-size:10.5px; color:var(--grey); width:28px; text-align:right; }
  .bar-col{ position:relative; flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; z-index:1; }
  .bar-col .bar-value{ font-size:12px; font-weight:700; color:var(--text); margin-bottom:5px; }
  .bar-col .bar{ width:22px; border-radius:4px 4px 0 0; transition:filter .15s, opacity .15s; cursor:default; }
  .bar-col .bar:hover{ filter:brightness(0.88); }
  .bar-col .bar-label{ font-size:11.5px; color:var(--sub); margin-top:8px; text-align:center; line-height:1.3; }
  .bar-chart.incidencia{ margin-left:8px; }

  .donut-wrap{ display:flex; align-items:center; gap:22px; }
  .donut-svg circle{ transition:opacity .15s; cursor:default; }
  .donut-svg circle:hover{ opacity:0.82; }
  .donut-center{ position:relative; width:150px; height:150px; flex:none; }
  .donut-center .center-num{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
  .donut-center .center-num .n{ font-size:28px; font-weight:700; color:var(--navy); line-height:1; }
  .donut-center .center-num .l{ font-size:10.5px; color:var(--sub); margin-top:3px; text-align:center; max-width:80px; }
  .donut-legend{ flex:1; }
  .donut-legend .legend-row{ display:flex; align-items:center; gap:9px; padding:6px 0; font-size:13px; }
  .donut-legend .swatch{ width:12px; height:12px; border-radius:3px; flex:none; }
  .donut-legend .legend-label{ color:var(--text); flex:1; }
  .donut-legend .legend-value{ color:var(--sub); font-weight:700; font-variant-numeric:tabular-nums; }

  .charts-note{ font-size:12px; color:var(--grey); margin-top:2px; }

  /* ---- Carga por abogado / filtro ---- */

  .workload-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; }
  .workload-tile{ border:1px solid var(--border); border-radius:10px; padding:14px 16px; cursor:pointer; transition:border-color .15s, background .15s; min-width:0; }
  .workload-tile:hover{ border-color:var(--auto); background:var(--auto-bg); }
  .workload-tile .wt-name{ font-weight:700; font-size:14px; color:var(--navy); margin-bottom:8px; }
  .workload-tile .wt-row{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--sub); padding:2px 0; }
  .workload-tile .wt-row b{ color:var(--text); font-variant-numeric:tabular-nums; }
  .workload-tile.risk{ border-color:#F1B7AE; background:#FFF8F7; }
  .workload-tile.risk:hover{ background:#FCEEEC; }

  .footer-note{ padding:12px 40px; border-top:1px solid var(--border); font-size:12px; color:var(--grey); background:#FAFBFC; text-align:center; line-height:1.5; }

/* ---- Añadidos de la aplicación (no existen en el prototipo, que es una sola página) ---- */
.topbar .logo-badge img{ height:26px; width:auto; display:block; }
a.nav-btn{ text-decoration:none; display:inline-block; }
.rol-badge{ display:block; width:fit-content; margin-top:3px; background:rgba(255,255,255,0.18); border:1px solid rgba(255,255,255,0.4); border-radius:100px; padding:0 8px; font-size:10.5px; font-weight:700; }
.sel-rol{ font:inherit; font-size:13px; padding:5px 8px; border:1px solid var(--auto-border); border-radius:7px; background:var(--auto-bg); }
.sel-rol:disabled{ opacity:.6; }
.nav-btn{ white-space:nowrap; }

/* ---------- Barra superior (Vigia_Issue_0002, prototipo de Premierplus del 28/10/2026) ---------- */
.vg-header{ background:linear-gradient(135deg, var(--navy), var(--blue)); color:#fff; } /* fondo a todo el ancho */
.vg-header-in{ max-width:1180px; margin:0 auto; padding:14px 32px; display:flex; align-items:center; gap:20px; }
.vg-brand{ display:flex; align-items:center; gap:12px; color:inherit; text-decoration:none; border-radius:8px; flex:0 0 auto; }
.vg-logo{ background:#fff; border-radius:8px; padding:6px 10px; display:flex; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.vg-logo img{ height:26px; display:block; }
.vg-product{ display:flex; flex-direction:column; line-height:1.15; padding-left:14px; border-left:1px solid rgba(255,255,255,.35); }
.vg-name{ font-size:22px; font-weight:700; letter-spacing:.3px; display:flex; align-items:center; gap:8px; }
.vg-name svg{ width:20px; height:20px; }
.vg-tag{ font-size:12px; font-weight:600; opacity:.85; white-space:nowrap; }
.vg-nav{ flex:1 1 auto; display:flex; justify-content:center; }
.vg-nav ul{ list-style:none; margin:0; padding:0; display:flex; gap:6px; }
.vg-nav a{ display:flex; align-items:center; gap:7px; padding:8px 14px; border-radius:8px; color:#fff; text-decoration:none; font-size:13.5px; font-weight:600; white-space:nowrap; border:1px solid transparent; }
.vg-nav a svg{ width:16px; height:16px; flex:0 0 auto; }
.vg-nav a:hover{ background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.25); }
.vg-nav a[aria-current="page"]{ background:#fff; color:var(--navy); font-weight:700; box-shadow:0 1px 3px rgba(0,0,0,.18); }
.vg-user{ position:relative; flex:0 0 auto; margin-left:auto; }
.vg-user-btn{ display:flex; align-items:center; gap:10px; background:transparent; border:1px solid rgba(255,255,255,.35); color:#fff; border-radius:999px; padding:4px 12px 4px 4px; cursor:pointer; font:inherit; }
.vg-user-btn:hover{ background:rgba(255,255,255,.12); }
.vg-avatar{ width:30px; height:30px; border-radius:50%; background:#fff; color:var(--navy); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12.5px; }
.vg-user-txt{ display:flex; flex-direction:column; align-items:flex-start; line-height:1.2; text-align:left; }
.vg-user-txt b{ font-size:13px; }
.vg-user-txt span{ font-size:12px; opacity:.9; }
.vg-caret{ width:12px; height:12px; opacity:.85; }
.vg-menu{ position:absolute; right:0; top:calc(100% + 8px); width:280px; background:#fff; color:var(--text); border:1px solid var(--border); border-radius:10px; box-shadow:0 10px 30px rgba(20,30,50,.18); padding:6px; z-index:10; }
.vg-menu[hidden]{ display:none; }
.vg-menu-head{ padding:10px 12px 12px; border-bottom:1px solid var(--border); margin-bottom:6px; }
.vg-menu-head b{ display:block; font-size:14px; color:var(--navy); }
.vg-menu-head .mail{ font-size:12.5px; color:var(--sub); word-break:break-all; }
.vg-chips{ display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.vg-chip{ font-size:12px; font-weight:600; padding:2px 9px; border-radius:999px; background:#EAF2FB; color:var(--navy); border:1px solid #B9D3EA; }
.vg-menu a{ display:flex; align-items:center; gap:8px; padding:9px 12px; border-radius:6px; color:var(--text); text-decoration:none; font-size:13.5px; }
.vg-menu a:hover{ background:var(--grey-bg); }
.vg-menu a svg{ width:16px; height:16px; color:var(--sub); }
.vg-menu-nota{ display:block; padding:9px 12px; font-size:12.5px; color:var(--sub); }
/* Foco del tabulador bien visible sobre el azul marino */
.vg-header a:focus-visible, .vg-header button:focus-visible{ outline:3px solid #F2C14E; outline-offset:2px; }
.vg-menu a:focus-visible{ outline:2px solid var(--auto); outline-offset:-2px; }
/* Anchos estrechos: la barra cabe sin desplazamiento horizontal */
@media (max-width:1100px){ .vg-tag{ display:none; } .vg-user-txt span{ display:none; } }
@media (max-width:900px){ .vg-user-txt{ display:none; } .vg-user-btn{ padding:4px; } .vg-caret{ display:none; } .vg-nav a{ padding:8px 10px; } }
@media (max-width:760px){ .vg-nav a .lbl{ display:none; } .vg-header-in{ padding:12px 16px; gap:12px; } .vg-product{ padding-left:10px; } }

/* Iconos dibujados en títulos y pestañas (Vigia_Issue_0002, observación 2 de la verificación) */
.title .icono{ width:24px; height:24px; vertical-align:-4px; margin-right:8px; color:var(--navy); }
.chip .icono{ width:14px; height:14px; vertical-align:-2px; margin-right:5px; }
.callout > .icono{ flex:none; width:18px; height:18px; margin-top:1px; }
