/* Plataforma EMART · estilos de marca
   Colores: navy #003971 · deep #002B57 · sky #29BEEF · yellow #FFD100 · red #C42320 · slate #2B2E49 */
:root {
  --navy: #003971; --deep: #002B57; --sky: #29BEEF; --yellow: #FFD100; --red: #C42320; --slate: #2B2E49;
  --green: #2E9E3E; --amber: #E08A00; --grey: #8A8FA3;
  --bg: #F2F5F9; --surface: #FFFFFF; --surface-2: #F7F9FC; --line: #DCE3EC; --line-strong: #C5CFDC;
  --text: #18202F; --muted: #5B6478; --tint: #E6F0FA; --sky-tint: #E3F6FD; --red-tint: #FBEAEA; --yellow-tint: #FFF6CC; --green-tint: #E7F4EA;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(0, 30, 60, .06), 0 4px 14px rgba(0, 30, 60, .06);
  --shadow-lg: 0 10px 40px rgba(0, 20, 50, .22);
  --fh: 'Bahnschrift', 'DIN Alternate', 'Barlow Semi Condensed', 'Arial Narrow', 'Segoe UI', system-ui, sans-serif;
  --fb: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--fb); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--fh); font-weight: 700; margin: 0; letter-spacing: .2px; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* ── Botones y formularios ── */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  padding: 7px 13px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--navy); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--deep); }
.btn.accent { background: var(--yellow); border-color: var(--yellow); color: var(--slate); }
.btn.danger { color: var(--red); border-color: #E7B9B8; }
.btn.danger:hover { background: var(--red-tint); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--tint); color: var(--navy); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.field small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; background: #fff; min-height: 36px; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(41, 190, 239, .2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.form-error { display: flex; gap: 8px; align-items: center; background: var(--red-tint); color: var(--red); border: 1px solid #EDC3C2;
  padding: 8px 10px; border-radius: var(--radius-sm); margin-bottom: 12px; font-weight: 600; font-size: 13px; }
.note { background: var(--tint); border-left: 3px solid var(--sky); padding: 9px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: var(--slate); }
.note.warn { background: var(--yellow-tint); border-left-color: var(--yellow); }

/* ── Etiquetas, avatares ── */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .2px; white-space: nowrap; background: var(--tint); color: var(--navy); border: 1px solid transparent; }
.tag.navy { background: var(--navy); color: #fff; }
.tag.slate { background: var(--slate); color: #fff; }
.tag.sky { background: var(--sky); color: #04253F; }
.tag.yellow { background: var(--yellow); color: var(--slate); }
.tag.grey { background: #E4E7EE; color: #4A5163; }
.tag.outline { background: transparent; border-color: var(--line-strong); color: var(--muted); }
.tag.warn { background: var(--yellow-tint); color: #7A5B00; border-color: #F0DA80; }
.tag.red { background: var(--red-tint); color: var(--red); border-color: #EDC3C2; }
.tag.green { background: var(--green-tint); color: var(--green); }
.avatar { --av: #8A8FA3; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--av);
  color: #fff; font: 700 12px/1 var(--fh); flex: none; letter-spacing: .3px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 84px; height: 84px; font-size: 30px; border: 3px solid rgba(255,255,255,.85); }
.prio { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ── Banda de demo y estructura ── */
.demo-banner { background: var(--deep); color: rgba(255,255,255,.72); font-size: 11.5px; text-align: center; padding: 4px 12px; letter-spacing: .2px; border-bottom: 1px solid rgba(255,255,255,.08); }
.demo-banner b { color: #fff; font-weight: 600; }
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 24px); }
.sidebar { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 18px 12px 14px; position: sticky; top: 0; height: calc(100vh - 24px); }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.sidebar .brand img { height: 46px; width: auto; }
.sidebar .brand span { font: 600 11px/1.25 var(--fb); color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .8px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.82); text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: #fff; color: var(--navy); }
.nav a.active .ic { color: var(--sky); }
.nav .soon { margin-left: auto; font-size: 9.5px; font-weight: 700; border: 1px solid rgba(255,255,255,.35); color: rgba(255,255,255,.75); padding: 0 6px; border-radius: 99px; text-transform: uppercase; }
.nav a.active .soon { border-color: var(--line-strong); color: var(--muted); }
.nav .sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.45); padding: 14px 10px 4px; font-weight: 700; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 0 6px 10px; }
.side-user b { display: block; font-size: 13px; }
.side-user .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.55); }
.side-user small { color: rgba(255,255,255,.65); font-size: 11.5px; }
.side-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.side-actions button { flex: 1; background: rgba(255,255,255,.08); border: 0; color: #fff; border-radius: 7px; padding: 7px 6px; cursor: pointer;
  font-size: 12px; display: inline-flex; gap: 5px; align-items: center; justify-content: center; }
.side-actions button:hover { background: rgba(255,255,255,.16); }
.main { padding: 22px 22px 40px; min-width: 0; }

/* ── Cabecera de página ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.kicker { font: 700 11.5px/1 var(--fh); color: var(--sky); text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 6px; }
.page-head h1 { font-size: 26px; color: var(--navy); }
.page-head p.sub { margin: 4px 0 0; color: var(--muted); max-width: 720px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; }
.toolbar .search .ic { position: absolute; left: 9px; top: 9px; color: var(--muted); }
.toolbar .search input { padding-left: 32px; width: 240px; }
.toolbar select { width: auto; min-width: 170px; }
.weeknav { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.weeknav button { border: 0; background: transparent; padding: 7px 8px; cursor: pointer; color: var(--navy); display: grid; place-items: center; }
.weeknav button:hover { background: var(--tint); }
.weeknav .wk { padding: 0 8px; font-weight: 700; font-size: 13px; color: var(--navy); min-width: 190px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--navy); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--sky); }
.tabs a .n { background: var(--tint); color: var(--navy); border-radius: 99px; padding: 0 7px; font-size: 11.5px; margin-left: 4px; }

/* ── Panel de equipo (resumen por persona) ── */
.team-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.person-chip { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; cursor: pointer; min-width: 205px; text-align: left; box-shadow: var(--shadow); }
.person-chip:hover { border-color: var(--sky); }
.person-chip.on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.person-chip b { font-size: 13px; display: block; }
.person-chip .nums { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.person-chip .nums .late { color: var(--red); font-weight: 700; }

/* ── Tablero ── */
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: #E9EEF5; border-radius: var(--radius); display: flex; flex-direction: column; min-height: 220px; border-top: 4px solid var(--c, var(--grey)); }
.col header { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; font: 700 13px/1 var(--fh); text-transform: uppercase; letter-spacing: .6px; color: var(--slate); }
.col header .count { margin-left: auto; background: #fff; border-radius: 99px; padding: 2px 8px; font-size: 11.5px; color: var(--muted); }
.col.closed { background: #EEF0F4; }
.col-body { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; border-radius: 0 0 var(--radius) var(--radius); transition: background .12s; }
.col-body.drop-ok { background: rgba(41, 190, 239, .16); outline: 2px dashed var(--sky); outline-offset: -4px; }
.col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 6px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.card { background: var(--surface); border-radius: 9px; padding: 10px 11px; box-shadow: var(--shadow); border: 1px solid var(--line); cursor: pointer; border-left: 4px solid transparent;
  min-width: 0; overflow: hidden; overflow-wrap: anywhere; }
.card[draggable=true] { cursor: grab; }
.card:hover { border-color: var(--sky); border-left-color: var(--sky); }
.card.late { border-left-color: var(--red); }
.card.dragging { opacity: .45; }
.card.closed h3 { color: var(--muted); }
.card-top { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-bottom: 5px; flex-wrap: wrap; }
.card-top .origin { display: inline-flex; align-items: center; gap: 3px; }
.card h3 { font: 600 13.5px/1.3 var(--fb); color: var(--text); margin: 0 0 6px; }
.card .why { font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 5px 7px; margin-bottom: 6px; }
.card-link { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--navy); font-weight: 600; margin-bottom: 8px; background: var(--tint); padding: 3px 7px; border-radius: 6px; max-width: 100%; }
.card-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.card-foot .due { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); white-space: nowrap; }
.card-foot .due.late { background: var(--red-tint); color: var(--red); font-weight: 700; }
.card-foot .due.today { background: #FDF0DC; color: #9A5A00; font-weight: 700; }
.card-foot .due.done { background: var(--green-tint); color: var(--green); }
.card-foot .due.none { font-style: italic; }
.card-foot .who { display: inline-flex; align-items: center; gap: 5px; min-width: 0; flex-shrink: 1; margin-left: auto; }
.card-foot .who > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-late { display: inline-block; width: 4px; height: 14px; background: var(--red); border-radius: 2px; }
.legend .check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-left: auto; }
.legend .check input { accent-color: var(--navy); }
.static { padding: 8px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
table.t.team th.n, table.t.team td.n { text-align: center; }
table.t.team .who b { white-space: nowrap; }
.stack { display: flex; width: 150px; height: 9px; border-radius: 99px; overflow: hidden; background: var(--line); }
.stack i { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ── Historial ── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 22px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--sky); }
.timeline li::after { content: ''; position: absolute; left: 9px; top: 16px; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12px; }
.timeline .what { font-weight: 600; }
.timeline .why { color: var(--slate); font-size: 12.5px; background: var(--surface-2); border-radius: 6px; padding: 4px 8px; margin-top: 3px; display: inline-block; }

/* ── Modal y avisos ── */
.modal-wrap { position: fixed; inset: 0; background: rgba(0, 25, 50, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(820px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; color: var(--navy); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .btn.danger { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
#toast-root { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--slate); color: #fff; padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 13px; transition: opacity .3s, transform .3s; max-width: 380px; }
.toast.ok .ic { color: #7EE29A; }
.toast.error { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); }
.secret { display: flex; align-items: center; gap: 8px; background: var(--slate); color: #fff; padding: 12px 14px; border-radius: 9px; font: 700 18px/1 ui-monospace, Consolas, monospace; letter-spacing: 1px; margin: 8px 0 12px; }
.secret .icon-btn { color: #fff; margin-left: auto; }
.secret .icon-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 600; }

/* ── Login ── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art { background: var(--navy); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 56px solid rgba(41,190,239,.18); }
.login-art img { width: 210px; height: auto; }
.login-art h1 { font-size: 34px; line-height: 1.12; max-width: 460px; }
.login-art h1 em { font-style: normal; color: var(--yellow); }
.login-art p { color: rgba(255,255,255,.75); max-width: 440px; }
.login-art .pill { align-self: flex-start; display: inline-block; background: rgba(255,255,255,.1); padding: 4px 10px; border-radius: 99px; font-size: 12px; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login-card h2 { color: var(--navy); font-size: 24px; margin-bottom: 4px; }
.login-card .btn.primary { width: 100%; justify-content: center; padding: 10px; font-size: 14px; margin-top: 4px; }
.demo-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.demo-box h4 { font: 700 11px/1 var(--fb); text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 8px; }
.demo-accounts { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-accounts button { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 99px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-weight: 600; color: var(--navy); }
.demo-accounts button:hover { border-color: var(--sky); background: var(--sky-tint); }

/* ── Fichas: listado ── */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; position: relative; }
.pcard:hover { border-color: var(--sky); }
.pcard .top { display: flex; gap: 12px; align-items: center; }
.pcard h3 { font-size: 16.5px; color: var(--navy); }
.pcard .meta { color: var(--muted); font-size: 12.5px; }
.pcard .tags { display: flex; gap: 5px; flex-wrap: wrap; }
.pcard .foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 9px; }
.pcard .foot .r { margin-left: auto; }
.pcard .alert-dot { position: absolute; top: 12px; right: 12px; color: var(--red); display: inline-flex; gap: 3px; align-items: center; font-size: 11.5px; font-weight: 700; }
.pnum { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 700 16px/1 var(--fh); color: #fff; background: var(--navy); flex: none; }
.pnum.coach { background: var(--slate); }

/* ── Ficha ── */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 10px; font-size: 13px; }
.back:hover { color: var(--navy); }
.hero { background: linear-gradient(120deg, var(--navy) 0%, var(--deep) 100%); color: #fff; border-radius: 16px; padding: 22px 24px; display: flex; gap: 20px;
  align-items: center; position: relative; overflow: hidden; flex-wrap: wrap; }
.hero::after { content: ''; position: absolute; right: -70px; top: -90px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(41,190,239,.14); }
.hero h1 { font-size: 30px; line-height: 1.1; }
.hero .sub { color: rgba(255,255,255,.8); margin-top: 4px; }
.hero .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.hero .tag.outline { color: #fff; border-color: rgba(255,255,255,.45); }
.hero .facts { margin-left: auto; display: grid; grid-template-columns: repeat(3, auto); gap: 4px 22px; position: relative; z-index: 1; }
.hero .facts div { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.6); }
.hero .facts b { display: block; font: 700 18px/1.2 var(--fh); color: #fff; text-transform: none; letter-spacing: 0; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; width: 100%; justify-content: flex-end; margin-top: -4px; flex-wrap: wrap; }
.hero-actions .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.hero-actions .btn:hover { background: rgba(255,255,255,.2); }
.hero-actions .btn.accent { background: var(--yellow); color: var(--slate); border-color: var(--yellow); }
.alerts { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.alerts .tag { padding: 5px 10px; font-size: 12px; }
.fgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.panel h2 { font-size: 15px; color: var(--navy); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel h2 .r { margin-left: auto; text-transform: none; letter-spacing: 0; }
.panel + .panel { margin-top: 16px; }
.panel .src { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.restricted { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); font-weight: 500; font-style: italic; }
.stepper { display: flex; margin: 4px 0 16px; }
.stepper .st { flex: 1; text-align: center; position: relative; font-size: 11px; color: var(--muted); font-weight: 600; }
.stepper .st::before { content: ''; display: block; width: 22px; height: 22px; border-radius: 50%; margin: 0 auto 6px; background: #fff; border: 2px solid var(--line-strong); position: relative; z-index: 1; }
.stepper .st::after { content: ''; position: absolute; top: 10px; left: calc(-50% + 11px); right: calc(50% + 11px); height: 2px; background: var(--line-strong); }
.stepper .st:first-child::after { display: none; }
.stepper .st.done::before { background: var(--navy); border-color: var(--navy); }
.stepper .st.done::after, .stepper .st.cur::after { background: var(--navy); }
.stepper .st.cur::before { background: var(--yellow); border-color: var(--navy); box-shadow: 0 0 0 4px rgba(255,209,0,.35); }
.stepper .st.cur { color: var(--navy); }
.plan { display: grid; gap: 10px; }
.plan .row { display: grid; grid-template-columns: 128px 1fr; gap: 10px; font-size: 13px; }
.plan .row > span:first-child { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; padding-top: 1px; }
.radar-wrap { display: grid; place-items: center; }
.radar-wrap svg { width: 100%; max-width: 340px; height: auto; }
.radar-legend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.radar-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.minilist { list-style: none; margin: 0; padding: 0; }
.minilist li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.minilist li:last-child { border-bottom: 0; }
.minilist li .r { margin-left: auto; }
.minilist a { text-decoration: none; font-weight: 600; }
.report { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; }
.report .h { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.report p { margin: 6px 0 0; font-size: 13px; }
.scores { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.scores span { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.scores b { color: var(--navy); }

/* ── Tablas ── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font: 700 11.5px/1 var(--fb); text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--surface-2); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--sky-tint); }
table.t .who { display: flex; align-items: center; gap: 9px; }
table.t .who b { display: block; }
table.t .who small { color: var(--muted); }
table.perm th.role { text-align: center; min-width: 108px; white-space: normal; line-height: 1.3; }
table.perm td.c { text-align: center; }
table.perm tr.grp td { background: var(--tint); font: 700 12px/1 var(--fh); text-transform: uppercase; letter-spacing: .8px; color: var(--navy); padding: 9px 12px; }
table.perm input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; }
table.perm input[type=checkbox]:disabled { cursor: not-allowed; }
.perm-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; font-size: 13px; }
.perm-list li { display: flex; gap: 6px; align-items: flex-start; }
.perm-list li .ic { color: var(--green); margin-top: 1px; }
.perm-list li.off { color: var(--muted); }
.perm-list li.off .ic { color: var(--grey); }

/* ── Informes (próximamente) ── */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: stretch; margin: 6px 0 18px; }
.flow .step { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); position: relative; }
.flow .step .ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; margin-bottom: 10px; }
.flow .step.ai .ico { background: var(--sky); color: #04253F; }
.flow .step.human .ico { background: var(--yellow); color: var(--slate); }
.flow .step h3 { font-size: 15px; color: var(--navy); margin-bottom: 4px; }
.flow .step p { margin: 0; font-size: 12.5px; color: var(--muted); }
.flow .step .n { position: absolute; top: 12px; right: 14px; font: 700 22px/1 var(--fh); color: var(--line-strong); }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Responsive ── */
@media (max-width: 1180px) {
  .fgrid { grid-template-columns: 1fr 1fr; }
  .fgrid > :nth-child(3) { grid-column: 1 / -1; }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; overflow-x: auto; }
  .sidebar .brand { border: 0; margin: 0; padding: 0; }
  .sidebar .brand img { height: 34px; }
  .sidebar .brand span, .nav .sep, .side-user div { display: none; }
  .nav { flex-direction: row; }
  .nav a { white-space: nowrap; padding: 8px 10px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
  .side-user { padding: 0; }
  .side-actions button span { display: none; }
  .main { padding: 16px 16px 32px; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 24px; gap: 18px; }
  .login-art img { width: 150px; }
  .login-art h1 { font-size: 26px; }
  .fgrid, .cards2 { grid-template-columns: minmax(0, 1fr); }
  .hero .facts { margin-left: 0; }
  .flow { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .toolbar .search input { width: 100%; }
  .toolbar .search { flex: 1 1 200px; }
  .toolbar select { flex: 1 1 170px; }
}

/* ── Conexión con la API (v0.2) ── */
.net-banner { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--red-tint); color: var(--red);
  border-bottom: 1px solid #EDC3C2; padding: 8px 16px; font-size: 13px; }
.net-banner span { flex: 1 1 260px; color: #7A1E1C; }
.net-panel { max-width: 640px; }
.net-panel h2 { display: flex; gap: 8px; align-items: center; color: var(--red); }
.api-banner { background: #2B2E49; }
.api-banner a { color: #9FE3FA; }
.badge-api { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; background: rgba(255,255,255,.14); color: rgba(255,255,255,.8); border-radius: 99px; padding: 1px 7px; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.cand-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cand-list li { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--surface-2); }
.cand-list li .r { margin-left: auto; }
.rev-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.rev-card .rev-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.rev-card .rev-head .r { margin-left: auto; }
.rev-card p { margin: 6px 0; }
.rev-card .rev-refs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.rev-card .rev-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.conf-bar { display: inline-block; width: 60px; height: 6px; border-radius: 99px; background: var(--line); vertical-align: middle; overflow: hidden; margin-right: 6px; }
.conf-bar i { display: block; height: 100%; background: var(--sky); }
.rev-card .rev-refs .tag { white-space: normal; max-width: 100%; }
.stepper .st { min-width: 0; }
dl.kv dd { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .stepper { overflow-x: auto; padding-bottom: 4px; } .stepper .st { flex: 1 0 66px; font-size: 10.5px; } }
