/* Altadia · tema corporativo claro */
:root {
  color-scheme: light;
  --bg: #f4f5f7; --surface: #fff; --text: #111318; --muted: #62697a; --border: #e2e5ea;
  --accent: #ff4b4b; --accent-dark: #d93636; --accent-soft: #fff0f0; --ink: #14171f; --ink-2: #3a4152; --grey: #c9ced8;
  --ok: #167a4a; --ok-bg: #e3f4ec; --warn: #8f5f00; --warn-bg: #fff3d3; --err: #b42318; --err-bg: #fde8e6;
  --info: #2457c5; --info-bg: #e8eefb; --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .grow { flex: 1; margin: 0; }
.spacer { flex: 1; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; text-align: center; max-width: 380px; width: 100%; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }

.who { display: flex; align-items: center; gap: 12px; color: var(--muted); }
main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }

.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--info-bg); color: var(--info); }
.badge.mock { background: var(--warn-bg); color: var(--warn); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.attention b { color: var(--err); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); font: inherit; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }
#q { flex: 1 1 260px; }

.btn { font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.danger { color: var(--err); border-color: var(--err); }
.btn.ghost { background: none; } .btn.small { padding: 4px 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; } tbody tr.clickable:hover { background: var(--bg); }
td .sub { color: var(--muted); font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 32px; }

.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; margin: 0 4px 4px 0; background: var(--info-bg); color: var(--info); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); } .pill.neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

dialog { border: 1px solid var(--border); border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 24px)); background: var(--surface); color: var(--text); max-height: calc(100vh - 24px); }
dialog::backdrop { background: rgba(10, 12, 16, .5); }
dialog form { padding: 22px; display: grid; gap: 12px; }
dialog h2 { margin: 0; font-size: 18px; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
label input, label select { font-size: 14px; color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } .topbar { padding: 12px 16px; } }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0; }
legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.team { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; color: var(--text); font-size: 14px; }
.team input { margin: 3px 0 0; padding: 0; flex: none; width: 16px; height: 16px; } .team small { display: block; color: var(--muted); }
fieldset:disabled { opacity: .5; }
.plan { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.plan code, code { font: 12px ui-monospace, Menlo, monospace; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.warn { background: var(--warn-bg); color: var(--warn); padding: 8px 10px; border-radius: 8px; margin: 0; font-size: 13px; }
.error { background: var(--err-bg); color: var(--err); padding: 8px 10px; border-radius: 8px; margin: 0; }
#history ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card h3 { margin: 0 0 6px; font-size: 14px; font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.card p { margin: 4px 0; }
.drift-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.drift-block h3 { margin: 0 0 8px; font-size: 14px; }
.drift-block ul { margin: 0; padding-left: 18px; }

.toasts { position: fixed; bottom: 16px; right: 16px; display: grid; gap: 8px; z-index: 20; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--err); color: #fff; }

/* Marca */
.topbar { padding: 10px 28px; box-shadow: var(--shadow); }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-sep { width: 1px; height: 26px; background: var(--border); }
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; display: flex; flex-direction: column; line-height: 1.15; }
.brand-title small { font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.login { background: linear-gradient(160deg, #fff 0%, var(--bg) 100%); }
.login-card { box-shadow: 0 10px 40px rgba(16,24,40,.08); border-radius: 16px; }
.login-logo { height: 38px; margin-bottom: 24px; }
.login-card h1 { font-size: 20px; letter-spacing: -.01em; }
.login-card .btn { margin-top: 24px; }
.badge { background: var(--info-bg); }

/* Resumen */
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 12px; }
.section-title h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.section-title span { color: var(--muted); font-size: 12px; }
.subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-bottom: 24px; }
@media (max-width: 520px) { .subs { grid-template-columns: 1fr; } }
.sub-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; position: relative; overflow: hidden; }
.sub-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.sub-card.std::before { background: var(--ink); }
.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.sub-head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.sub-head small { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.sub-body { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.gauge { position: relative; width: 120px; height: 120px; flex: none; }
.gauge svg { width: 100%; height: 100%; }
.gauge .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge .center b { font-size: 24px; line-height: 1; letter-spacing: -.02em; }
.gauge .center span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.track { fill: none; stroke: var(--bg); } .arc { fill: none; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 12px 24px; flex: 1; min-width: 220px; }
.metric b { display: block; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.metric span { font-size: 11px; color: var(--muted); }
.term { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.term .row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.term strong { color: var(--text); }
.bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .6s ease; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .label { font-size: 12px; color: var(--muted); display: block; }
.kpi b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1.15; margin: 4px 0 8px; }
.kpi .hint { font-size: 12px; color: var(--muted); }
.kpi.alert b { color: var(--accent-dark); }
.kpi .bar { margin-top: 2px; }
.kpi .bar > i { background: var(--accent); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 420px) { .charts { grid-template-columns: 1fr; } }
.chart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.chart h3 { margin: 0 0 2px; font-size: 14px; letter-spacing: -.01em; }
.chart > p { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { position: relative; width: 150px; height: 150px; flex: none; }
.donut svg { width: 100%; height: 100%; }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center b { font-size: 26px; letter-spacing: -.02em; line-height: 1; }
.donut .center span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.legend { display: grid; gap: 8px; flex: 1; min-width: 150px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend em { margin-left: auto; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend small { color: var(--muted); }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--bg); margin-bottom: 14px; }
.stack i { display: block; height: 100%; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar .val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 36px; text-align: right; }
.hbar .val small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.hbar .bar { height: 8px; }
.hbar .bar > i { background: var(--accent); }
.chart.wide { grid-column: span 2; }
@media (max-width: 760px) { .chart.wide { grid-column: auto; } }
.chart.wide .hbar { grid-template-columns: minmax(120px, 270px) 1fr auto; }

/* Cabeceras de página y diálogo de miembros */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.page-head p { margin: 2px 0 0; max-width: 62ch; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
dialog.wide { width: min(780px, calc(100vw - 24px)); }
.dlg-body { padding: 22px; display: grid; gap: 14px; }
.dlg-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dlg-head h2 { margin: 0; font-size: 18px; } .dlg-head p { margin: 2px 0 0; font-size: 12px; }
.table-wrap.tall { max-height: 52vh; overflow: auto; }

/* Banner y tarjetas de estado */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.banner.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe3d0; }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0dca0; }
.banner.err { background: var(--err-bg); color: var(--err); border-color: #f4c3be; }
.banner .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.banner small { font-weight: 400; opacity: .85; display: block; }
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin-bottom: 24px; }
.gcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.gcard.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.gcard.clickable:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.gcard .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.gcard h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.gcard code.mail { display: block; font: 10.5px ui-monospace, Menlo, monospace; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.gcard .nums { display: flex; gap: 20px; }
.gcard .nums b { font-size: 24px; letter-spacing: -.03em; line-height: 1.1; display: block; }
.gcard .nums span { font-size: 11px; color: var(--muted); }
.gcard .who { font-size: 12px; color: var(--ink-2); margin: 0; }
.gcard .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gcard .foot { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.ratio { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; position: relative; }
.ratio > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .6s ease; }
.ratio.bad > i { background: var(--accent); }
.pill.sens-interna { background: var(--info-bg); color: var(--info); }
.pill.sens-confidencial { background: var(--warn-bg); color: var(--warn); }
.pill.sens-restringida { background: var(--err-bg); color: var(--err); }
.deltas { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.skeleton { display: inline-block; width: 28px; height: 22px; border-radius: 6px; background: linear-gradient(90deg, var(--bg), var(--border), var(--bg)); background-size: 200% 100%; animation: shimmer 1.2s infinite; vertical-align: middle; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Tablas de incidencias y filtros */
.block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.block > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.block > header h3 { margin: 0; font-size: 14px; } .block > header p { margin: 0; font-size: 12px; color: var(--muted); }
.block .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { font: inherit; font-size: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); padding: 4px 11px; border-radius: 99px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip small { opacity: .7; margin-left: 4px; }
.pill.t-missing { background: var(--err-bg); color: var(--err); } .pill.t-extra { background: var(--warn-bg); color: var(--warn); } .pill.t-unreg { background: var(--info-bg); color: var(--info); }
td.actions { text-align: right; white-space: nowrap; }
.empty-ok { padding: 28px; text-align: center; color: var(--ok); }
.progress-line { height: 3px; background: var(--accent); width: 0; transition: width .2s; position: fixed; top: 0; left: 0; z-index: 30; }

/* Grupos y accesos */
.section-gap { margin-top: 28px; }
.matrix th, .matrix td { text-align: center; padding: 10px 12px; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix thead tr.layer th { background: var(--ink); color: #fff; font-size: 11px; letter-spacing: .06em; }
.matrix thead tr.layer th:nth-child(odd) { background: var(--ink-2); }
.matrix .yes { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.matrix .no { color: var(--grey); }
.matrix th small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); margin-top: 2px; }
.profiles { display: grid; gap: 10px; padding: 14px 18px; }
.profile { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.profile:last-child { border-bottom: 0; }
.profile b { font-size: 13px; } .profile .sub { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .profile { grid-template-columns: 1fr; } }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 16px 18px; }
.step { display: flex; gap: 12px; }
.step .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step b { display: block; font-size: 13px; } .step span { font-size: 12px; color: var(--muted); }
.pill.cap { background: var(--bg); color: var(--ink-2); border: 1px solid var(--border); }
.pill.cap.on { background: var(--accent-soft); color: var(--accent-dark); border-color: #ffc9c9; }

/* Modo desarrollo / producción */
.badge.prod { background: var(--ok-bg); color: var(--ok); }
.mode-bar { display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid #f0dca0; font-size: 13px; position: sticky; top: 46px; z-index: 4; flex-wrap: wrap; }
.mode-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.mode-bar b { font-weight: 600; }
label.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
label.check input { width: 18px; height: 18px; flex: none; }

/* Logos de Gemini Enterprise */
.brand-ge { height: 22px; width: auto; display: block; }
.brand-title { gap: 2px; }
.login-ge { height: 34px; width: auto; display: block; margin: 0 auto 14px; }
.login-logo { margin-bottom: 18px; }

/* Menú de enlaces a las apps */
.apps-menu { position: relative; }
.apps-menu summary { list-style: none; cursor: pointer; }
.apps-menu summary::-webkit-details-marker { display: none; }
.apps-menu[open] summary { border-color: var(--ink); }
.apps-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(16,24,40,.15); padding: 6px; min-width: 260px; display: grid; gap: 2px; }
.apps-pop a, .app-link { text-decoration: none; color: var(--text); }
.apps-pop a { display: block; padding: 9px 12px; border-radius: 8px; }
.apps-pop a:hover { background: var(--bg); }
.apps-pop b { display: block; font-size: 13px; } .apps-pop span { font-size: 12px; color: var(--muted); }
.app-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 24px; }
.app-link { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.app-link:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.app-link .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; font-weight: 700; flex: none; }
.app-link b { display: block; font-size: 14px; } .app-link small { color: var(--muted); font-size: 12px; }
.app-link .go { margin-left: auto; color: var(--muted); }

/* Mapa interactivo */
.mapcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 24px; }
.mapcard h3 { margin: 0 0 2px; font-size: 14px; } .mapcard > p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; }
@media (max-width: 860px) { .map-grid { grid-template-columns: 1fr; } }
.map-wrap { position: relative; background: #f6f8fb; border-radius: 10px; overflow: hidden; }
.map-svg { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; user-select: none; }
.map-svg.dragging { cursor: grabbing; }
.country { stroke: #fff; stroke-width: .5; vector-effect: non-scaling-stroke; }
.country:not(.has) { fill: #dfe3ea; } /* los países con usuarios llevan el color calculado en el atributo fill */
.country.listed { fill: #f1e0e0; }
.country.has, .country.listed { cursor: pointer; }
.country.has:hover, .country.listed:hover { stroke: var(--ink); stroke-width: 1.4; }
.map-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; z-index: 3; transform: translate(12px, 12px); }
.map-tip b { display: block; font-size: 13px; }
.map-ctrl { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; z-index: 2; }
.map-ctrl button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font: 600 16px/1 system-ui; cursor: pointer; color: var(--ink); }
.map-ctrl button:hover { border-color: var(--ink); }
.map-scale { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 10px; }
.map-scale i { display: block; height: 8px; width: 120px; border-radius: 99px; background: linear-gradient(90deg, rgb(255,214,214), rgb(217,54,54)); }
.map-rank { display: grid; gap: 4px; align-content: start; max-height: 420px; overflow: auto; }
.map-rank button { display: grid; grid-template-columns: 1fr auto; gap: 8px; text-align: left; border: 0; background: none; font: inherit; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--text); }
.map-rank button:hover { background: var(--bg); }
.map-rank b { font-variant-numeric: tabular-nums; }
.map-rank .rbar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.map-rank .rbar i { display: block; height: 100%; background: var(--accent); }

/* Login en layout dividido: fotografía + panel (manual de identidad Altadia) */
.login { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; padding: 0; background: var(--surface); place-items: stretch; }
.login-photo { position: relative; overflow: hidden; background: #dcdcdc url('/login-hero.jpg') center / cover no-repeat; }
.login-photo .marks { position: absolute; left: 0; bottom: 0; width: 260px; height: 260px; transform: translate(-34%, 34%); background: url('/altadia-symbol.svg') center / contain no-repeat; }
.login-panel { display: grid; place-items: center; padding: 32px 24px; }
.login-card { border: 0; box-shadow: none; background: transparent; padding: 0; max-width: 400px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: 190px auto; }
  .login-photo .marks { width: 150px; height: 150px; }
}

/* Banner del Resumen */
.hero { position: relative; overflow: hidden; border-radius: var(--radius); margin-bottom: 24px; min-height: 150px; display: flex; align-items: center; padding: 26px 30px; color: #fff;
  background: linear-gradient(90deg, rgba(69,66,64,.94) 0%, rgba(69,66,64,.78) 48%, rgba(69,66,64,.18) 100%), url('/banner-produccion.jpg') center / cover no-repeat; box-shadow: var(--shadow); }
.hero h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.hero p { margin: 0; font-size: 14px; color: #fff; opacity: .92; }
.hero-text { position: relative; z-index: 1; max-width: 62%; }
.hero-marks { position: absolute; right: 22px; top: 50%; width: 120px; height: 120px; transform: translateY(-50%); background: url('/altadia-symbol-white.svg') center / contain no-repeat; opacity: .95; }
@media (max-width: 640px) { .hero-text { max-width: 100%; } .hero-marks { display: none; } }
