/* ============================================================
   PORTAL ANA — KDD Business
   Identidad: oscuro premium + dorado KDD (#C6A965)
   ============================================================ */
:root {
  --bg: #0b0b0d;
  --bg2: #101014;
  --card: #15151a;
  --card2: #1b1b21;
  --line: #26262e;
  --text: #f2efe9;
  --muted: #9a958c;
  --gold: #c6a965;
  --gold-l: #e0c88f;
  --gold-dim: rgba(198, 169, 101, .14);
  --ok: #4caf7d;
  --bad: #e06666;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* Regla global: el atributo hidden SIEMPRE oculta, aunque otra clase defina display */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #17171d 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-l); }
.muted { color: var(--muted); font-size: .88rem; }
.empty { text-align: center; padding: 1.5rem 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11,11,13,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 980px; margin: 0 auto; padding: .7rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topbar-brand { display: flex; align-items: center; gap: .6rem; }
.brand-logo { height: 34px; width: auto; }
.brand-name { font-weight: 600; font-size: 1rem; letter-spacing: .5px; }
.brand-name strong { color: var(--gold); }
.topbar-user { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--muted); }
.chip-rol {
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid rgba(198,169,101,.35);
  border-radius: 999px; padding: .15rem .65rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
}
.container { max-width: 980px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* ---------- Botones ---------- */
.btn {
  font-family: inherit; font-size: .92rem; font-weight: 600;
  border: 1px solid transparent; border-radius: 10px;
  padding: .65rem 1.25rem; cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: #17130a; }
.btn-primary:hover { background: var(--gold-l); }
.btn-gold { background: linear-gradient(135deg, var(--gold-l), var(--gold)); color: #17130a; box-shadow: 0 4px 18px rgba(198,169,101,.25); }
.btn-gold:hover { box-shadow: 0 6px 24px rgba(198,169,101,.4); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger { background: rgba(224,102,102,.12); color: var(--bad); border-color: rgba(224,102,102,.4); }
.btn-danger:hover { background: rgba(224,102,102,.22); }
.btn-block { width: 100%; }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1.1rem;
}

/* ---------- Login ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 20% -10%, #1a1a21 0%, transparent 55%),
    radial-gradient(700px 500px at 90% 110%, rgba(198,169,101,.08) 0%, transparent 50%),
    var(--bg);
}
.login-wrap { width: 100%; max-width: 420px; }
.login-card {
  background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.2rem 2rem;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.login-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: .9rem; margin-bottom: 1.8rem; text-align: center;
}
.login-logo { height: 48px; width: auto; }
.login-title h1 {
  font-size: 2.1rem; font-weight: 800; letter-spacing: 2px; line-height: 1;
  background: linear-gradient(120deg, var(--gold-l), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-kicker { font-size: .66rem; letter-spacing: 2.5px; color: var(--muted); font-weight: 700; }
.login-title p { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.login-error { color: var(--bad); font-size: .85rem; margin: .6rem 0; }
.login-ok { color: var(--ok); font-size: .85rem; margin: .6rem 0; background: rgba(76,175,125,.08); border: 1px solid rgba(76,175,125,.35); border-radius: 10px; padding: .7rem .9rem; }
.login-foot { margin-top: 1.4rem; font-size: .78rem; color: var(--muted); text-align: center; line-height: 1.6; }
.login-copy { text-align: center; color: #5d5a54; font-size: .74rem; margin-top: 1.2rem; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
.field input {
  background: #0e0e12; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: .7rem .9rem; font-size: .95rem; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease; width: 100%;
}
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.field small { color: var(--muted); font-size: .75rem; line-height: 1.45; }

/* Mostrar/ocultar contraseña (ojito) */
.pass-toggle { position: relative; }
.pass-toggle input { padding-right: 46px; }
.eye-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border-radius: 8px;
}
.eye-btn:hover { color: var(--gold); }
.eye-btn .eye-off { display: none; }
.eye-btn.on .eye-off { display: block; }
.eye-btn.on .eye-on { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Hero progreso ---------- */
.hero { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.hero-ring { position: relative; width: 132px; height: 132px; flex: 0 0 auto; }
.ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #232329; stroke-width: 10; }
.ring-fg {
  fill: none; stroke: url(#grad) none; stroke: var(--gold);
  stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset .9s cubic-bezier(.4,0,.2,1);
}
.ring-num {
  position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center;
  padding-top: 44px; font-size: 1.9rem; font-weight: 800; color: var(--gold-l);
}
.ring-num small { font-size: 1rem; color: var(--muted); margin-left: 2px; }
.hero-text { flex: 1; min-width: 240px; }
.hero-estado { display: inline-flex; align-items: center; gap: .45rem; font-size: .75rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.hero-estado .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.hero-estado.activo .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.hero-estado.activo { color: var(--ok); }
.hero-text h2 { font-size: 1.5rem; font-weight: 800; margin: .2rem 0 .3rem; }
.hero-text p { color: var(--muted); font-size: .95rem; }
.hero-steps { display: flex; gap: .5rem; margin-top: .9rem; flex-wrap: wrap; }
.hstep {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: .25rem .7rem;
}
.hstep.done { color: var(--ok); border-color: rgba(76,175,125,.4); background: rgba(76,175,125,.08); }
.hstep.cur { color: var(--gold); border-color: rgba(198,169,101,.4); background: var(--gold-dim); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab {
  font-family: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 12px;
  padding: .6rem 1rem; display: inline-flex; align-items: center; gap: .5rem;
  transition: all .15s ease;
}
.tab .tab-n {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--card2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
}
.tab.active { color: var(--gold); border-color: rgba(198,169,101,.5); background: var(--gold-dim); }
.tab.active .tab-n { background: var(--gold); color: #17130a; border-color: var(--gold); }
.tab.done { color: var(--ok); }
.tab.done .tab-n { background: rgba(76,175,125,.15); border-color: rgba(76,175,125,.5); }

/* ---------- Paneles ---------- */
.panel { display: none; }
.panel.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.panel h3, .collapsible h3, .modal h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.panel-hint { font-size: .78rem; color: var(--muted); font-weight: 500; margin-left: .5rem; }
.panel-actions { margin-top: .6rem; display: flex; justify-content: flex-end; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 2rem 1rem; text-align: center; cursor: pointer;
  transition: all .15s ease; margin: .8rem 0;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-dim); }
.dz-icon { font-size: 2rem; }
.dropzone p { margin: .2rem 0; }
.dz-small { font-size: .75rem; color: var(--muted); }

/* ---------- PDFs ---------- */
.pdf-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.pdf-item {
  display: flex; align-items: center; gap: .8rem;
  background: var(--card2); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .9rem; font-size: .88rem;
}
.pdf-item .pdf-icon { font-size: 1.2rem; }
.pdf-item .pdf-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-item .pdf-meta { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.pdf-item .pdf-badge { font-size: .68rem; font-weight: 700; color: var(--gold); border: 1px solid rgba(198,169,101,.4); background: var(--gold-dim); border-radius: 999px; padding: .12rem .55rem; white-space: nowrap; }

/* ---------- Activar ---------- */
.activar-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-color: rgba(198,169,101,.45);
  background: linear-gradient(180deg, rgba(198,169,101,.10), var(--bg2));
  animation: glow 2.5s ease-in-out infinite alternate;
}
@keyframes glow { from { box-shadow: 0 0 0 rgba(198,169,101,0); } to { box-shadow: 0 0 34px rgba(198,169,101,.18); } }
.activar-text h3 { color: var(--gold-l); margin-bottom: .2rem; }
.activar-text p { color: var(--muted); font-size: .88rem; }
.activo-card { border-color: rgba(76,175,125,.4); background: rgba(76,175,125,.06); }
.activo-card h3 { color: var(--ok); }
.act-pasos { list-style: none; margin-top: .8rem; display: flex; flex-direction: column; gap: .4rem; font-size: .85rem; }
.act-paso.ok { color: var(--ok); }
.act-paso.err { color: var(--bad); }
.act-paso small { color: var(--muted); }

/* ---------- Collapsibles ---------- */
.collapsible { padding: 0; overflow: hidden; }
.collapsible-head {
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: .95rem; font-weight: 600; color: var(--text);
  padding: 1.1rem 1.4rem; display: flex; justify-content: space-between; align-items: center;
}
.collapsible-head:hover { color: var(--gold); }
.chev { transition: transform .2s ease; color: var(--muted); }
.collapsible.open .chev { transform: rotate(180deg); }
.collapsible-body { padding: 0 1.4rem 1.4rem; }

/* ---------- JSON / ficha ---------- */
.json {
  background: #0c0c10; border: 1px solid var(--line); border-radius: 10px;
  padding: 1rem; font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: .78rem; line-height: 1.55; color: #cfc9bd;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  max-height: 420px; overflow-y: auto;
}

/* ---------- Admin ---------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; flex-wrap: wrap; gap: .8rem; }
.admin-head h2 { font-size: 1.4rem; font-weight: 800; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 1.1rem; margin-bottom: 0; }
.stat-n { font-size: 1.7rem; font-weight: 800; color: var(--gold-l); }
.stat-l { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.table-card { padding: 0; overflow-x: auto; }
.search-row { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search-row input {
  flex: 1; min-width: 220px;
  background: #0e0e12; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: .55rem .9rem; font-size: .9rem; font-family: inherit;
}
.search-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.paginacion { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .9rem 1rem; border-top: 1px solid var(--line); }
.tabla { width: 100%; border-collapse: collapse; font-size: .87rem; }
.tabla th {
  text-align: left; padding: .85rem 1rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tabla td { padding: .8rem 1rem; border-bottom: 1px solid #1e1e24; vertical-align: middle; }
.tabla tr:last-child td { border-bottom: none; }
.tabla tr:hover td { background: rgba(198,169,101,.03); }
.td-empresa { font-weight: 600; }
.td-progreso { min-width: 130px; }
.mini-bar { height: 6px; border-radius: 99px; background: #232329; overflow: hidden; margin-top: .3rem; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-l)); border-radius: 99px; transition: width .6s ease; }
.chip { display: inline-block; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .2rem .6rem; text-transform: uppercase; letter-spacing: .6px; }
.chip-borrador { color: var(--muted); border: 1px solid var(--line); background: var(--card2); }
.chip-activo { color: var(--ok); border: 1px solid rgba(76,175,125,.45); background: rgba(76,175,125,.1); }
.td-acciones { display: flex; gap: .4rem; justify-content: flex-end; }
@media (max-width: 720px) {
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr { padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
  .tabla td { border: none; padding: .25rem 0; }
  .tabla td:first-child { font-weight: 700; font-size: 1rem; }
  .td-acciones { flex-direction: row; justify-content: flex-start; margin-top: .4rem; }
}

/* ---------- Modales ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5,5,7,.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal { width: 100%; max-width: 480px; margin-bottom: 0; animation: fadein .2s ease; }
.modal-wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.pass-row { display: flex; gap: .45rem; }
.pass-row input { flex: 1; }
.pass-result { margin-top: 1rem; }
.pass-result p { color: var(--ok); font-size: .88rem; margin-bottom: .5rem; }
.priv-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .6rem; }
.del-list { margin: .6rem 0 .6rem 1.2rem; font-size: .9rem; }
.del-list li { margin: .2rem 0; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: 80;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  color: var(--text); font-size: .88rem; padding: .8rem 1.1rem; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 340px;
  animation: slidein .25s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--bad); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
