/* Access Point · Panel de administración
   Se carga después de ../css/styles.css (header, footer y colores del sitio). */

.adm { background: var(--soft); padding-top: 66px; }
.adm .nav { background: rgba(6, 26, 48, .97); }
.adm .ico { width: 1.1em; height: 1.1em; }

/* ---------- Botones del panel ---------- */
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: .6em 1.1em; border-radius: 10px; border: 0; background: linear-gradient(90deg, var(--cyan), var(--teal)); color: var(--navy-900); font: inherit; font-weight: 700; font-size: .88rem; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .2s, box-shadow .2s; }
.a-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(29, 181, 143, .3); }
.a-btn--ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.a-btn--ghost:hover { border-color: var(--teal); box-shadow: none; }
.a-btn--danger { background: #fdecec; color: #b42318; }
.a-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Franja del panel (debajo del header del sitio) ---------- */
.a-bar { position: sticky; top: 66px; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px rgba(11, 42, 74, .06); }
.a-bar__inner { width: min(1280px, 100% - 32px); margin: 0 auto; display: flex; align-items: center; gap: 18px; min-height: 58px; }
.a-bar__title { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--navy); padding-right: 18px; border-right: 1px solid var(--line); }
.a-bar__title .ico { color: var(--teal); }
.a-tabs { display: flex; gap: 2px; margin-right: auto; overflow-x: auto; scrollbar-width: none; }
.a-tabs::-webkit-scrollbar { display: none; }
.a-tabs a { position: relative; padding: 1.1em .9em; font-weight: 600; font-size: .92rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.a-tabs a::after { content: ""; position: absolute; left: .9em; right: .9em; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); transform: scaleX(0); transition: transform .3s; }
.a-tabs a:hover { color: var(--navy); }
.a-tabs a.is-on { color: var(--navy); }
.a-tabs a.is-on::after { transform: scaleX(1); }
.a-badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.5; }
.a-range { display: flex; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 3px; flex: none; }
.a-range a { padding: .4em .85em; border-radius: 9px; font-weight: 600; font-size: .84rem; color: var(--muted); }
.a-range a.is-on { background: var(--navy); color: #fff; }

/* ---------- Contenido ---------- */
.a-wrap { width: min(1280px, 100% - 32px); margin: 0 auto; padding: 26px 0 70px; min-height: 60vh; }
.a-panel { animation: aEntra .45s cubic-bezier(.22, 1, .36, 1); }
@keyframes aEntra { from { opacity: 0; transform: translateY(10px); } }
.a-nota { margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.a-nota b { color: var(--navy); }

.a-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.a-kpi { background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 2px; cursor: help; }
.a-kpi span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.a-kpi strong { font-size: 1.75rem; color: var(--navy); line-height: 1.2; }
.a-var { font-style: normal; font-size: .74rem; font-weight: 600; color: var(--muted); }
.a-var--up { color: #138a5e; }
.a-var--down { color: #c4321f; }
.a-kpi--accent { background: linear-gradient(135deg, var(--navy), var(--navy-700)); }
.a-kpi--accent span, .a-kpi--accent .a-var { color: rgba(255, 255, 255, .75); }
.a-kpi--accent .a-var--up { color: #7cf0c5; }
.a-kpi--accent strong { color: var(--cyan); }

.a-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.a-grid--3 { grid-template-columns: repeat(3, 1fr); }
.a-card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.a-card--wide { grid-column: 1 / -1; }
.a-card h2 { font-size: 1rem; color: var(--navy); margin: 0 0 14px; letter-spacing: -.01em; }
.a-card h2 small { font-weight: 500; color: var(--muted); font-size: .82rem; margin-left: 6px; }
.a-chart { position: relative; height: 250px; }
.a-chart--tall { height: 320px; }
.a-vacio { color: var(--muted); margin: 0; font-size: .92rem; }
.a-pie { margin: 14px 0 0; font-size: .84rem; color: var(--muted); }
.a-pie b { color: var(--navy); }

.a-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.a-lista li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; overflow: hidden; font-size: .88rem; }
.a-lista li i { position: absolute; inset: 0 auto 0 0; background: #e3f3ff; border-radius: 10px; }
.a-lista li span, .a-lista li b { position: relative; z-index: 1; }
.a-lista li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-lista li small { color: var(--muted); font-weight: 500; margin-left: 4px; }

/* Embudo */
.a-embudo { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.a-embudo li { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--soft); overflow: hidden; font-size: .9rem; }
.a-embudo li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: linear-gradient(90deg, rgba(29, 181, 143, .28), rgba(63, 182, 255, .22)); border-radius: 12px; }
.a-embudo span, .a-embudo b { position: relative; }
.a-embudo b { color: var(--navy); }
.a-embudo small { color: var(--teal); font-weight: 700; margin-left: 4px; }

/* Mapa de calor */
.a-calor { display: grid; gap: 4px; overflow-x: auto; }
.a-calor__row { display: grid; grid-template-columns: 40px repeat(24, minmax(16px, 1fr)); gap: 4px; align-items: center; }
.a-calor__row > span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.a-calor__head span { text-align: left; }
.a-calor i { display: block; height: 22px; border-radius: 5px; background: #eef3f8; position: relative; }
.a-calor i::after { content: ""; position: absolute; inset: 0; border-radius: 5px; background: var(--teal); opacity: var(--o); }

/* Tablas */
.a-tabla-wrap { overflow-x: auto; }
.a-tabla-wrap--scroll { max-height: 420px; overflow-y: auto; }
.a-tabla { width: 100%; border-collapse: collapse; font-size: .88rem; }
.a-tabla th, .a-tabla td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.a-tabla th { position: sticky; top: 0; background: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.a-tabla .num { text-align: right; }
.a-tabla .muted { color: var(--muted); white-space: normal; }
.a-tabla tbody tr:hover { background: #f6fbff; }
.a-meter { display: inline-block; width: 60px; height: 6px; border-radius: 6px; background: #e6eef6; vertical-align: middle; overflow: hidden; }
.a-meter i { display: block; height: 100%; background: var(--teal); }

/* Solicitudes */
.a-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.a-head h2 { font-size: 1.25rem; color: var(--navy); display: flex; align-items: center; gap: 10px; margin: 0; }
.a-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.a-tools form { margin: 0; }
.a-tools input { font: inherit; padding: .6em 1em; border-radius: 10px; border: 1.5px solid var(--line); min-width: 260px; background: #fff; }
.a-sols { display: grid; gap: 10px; }
.a-sol { background: #fff; border-radius: 14px; box-shadow: var(--shadow); border-left: 4px solid transparent; }
.a-sol--nueva { border-left-color: var(--teal); }
.a-sol summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.a-sol summary::-webkit-details-marker { display: none; }
.a-sol__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.a-sol--nueva .a-sol__dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(29, 181, 143, .18); }
.a-sol__who { display: grid; flex: 1; min-width: 0; }
.a-sol__who b { color: var(--navy); }
.a-sol__who small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-sol time { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.a-sol[open] summary { border-bottom: 1px solid var(--line); }
.a-sol__body { padding: 16px 18px 18px 42px; }
.a-sol__body dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 14px; }
.a-sol__body dt { font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.a-sol__body dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.a-sol__body dd a { color: #0d7fbf; }
.a-sol__msg { background: var(--soft); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.a-sol__acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Actividad */
.a-feed { list-style: none; margin: 0; padding: 0; }
.a-feed__item { display: flex; align-items: center; gap: 14px; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.a-feed__item:last-child { border-bottom: 0; }
.a-feed__ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #e6f1fb; color: #0d7fbf; }
.a-feed__item--clic .a-feed__ico { background: #fff4e0; color: #b86e00; }
.a-feed__item--form .a-feed__ico { background: #efe9ff; color: #6a45d9; }
.a-feed__item--solicitud .a-feed__ico { background: #ddf7ee; color: #138a5e; }
.a-feed__txt { flex: 1; min-width: 0; }
.a-feed__txt b { color: var(--navy); }
.a-feed__txt small { display: block; color: var(--muted); font-size: .8rem; }
.a-feed__item time { color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* ---------- Inicio de sesión ---------- */
.a-login { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 50px 16px; background: radial-gradient(circle at 20% 10%, var(--navy-700), var(--navy-900) 65%); }
.a-login__card { width: min(400px, 100%); background: #fff; border-radius: 22px; padding: 36px 30px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); display: grid; gap: 14px; text-align: center; animation: aEntra .6s cubic-bezier(.22, 1, .36, 1); }
.a-login__logo { width: 56px; height: 56px; margin: 0 auto; color: var(--navy); }
.a-login__card h1 { font-size: 1.5rem; font-weight: 500; color: var(--navy); letter-spacing: .03em; margin: 0; }
.a-login__card h1 b { font-weight: 800; }
.a-login__sub { margin: -8px 0 6px; color: var(--muted); font-size: .9rem; }
.a-login__card label { display: grid; gap: 6px; text-align: left; font-size: .85rem; font-weight: 700; color: var(--navy); }
.a-login__card input { font: inherit; padding: .8em 1em; border-radius: 12px; border: 1.5px solid var(--line); background: var(--soft); }
.a-login__card input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(29, 181, 143, .15); }
.a-login__card .a-btn { padding: .9em; font-size: 1rem; margin-top: 6px; }
.a-aviso { margin: 0; padding: 10px 12px; border-radius: 10px; background: #e8f4ff; color: var(--navy); font-size: .88rem; }
.a-aviso--error { background: #fdecec; color: #b42318; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .a-kpis { grid-template-columns: repeat(2, 1fr); }
  .a-grid, .a-grid--3 { grid-template-columns: 1fr; }
  .a-sol__body dl { grid-template-columns: 1fr 1fr; }
  .a-bar__inner { flex-wrap: wrap; gap: 0 14px; padding-top: 6px; }
  .a-tabs { order: 3; width: 100%; margin: 0; }
  .a-range { margin-left: auto; }
}
@media (max-width: 640px) {
  .adm { padding-top: 64px; }
  .a-bar { top: 64px; }
  .a-bar__title { border: 0; }
  .a-tabs a { padding: .9em .7em; }
  .a-tools input { min-width: 0; width: 100%; }
  .a-sol summary { flex-wrap: wrap; }
  .a-sol__body { padding-left: 18px; }
  .a-sol__body dl { grid-template-columns: 1fr; }
  .a-chart, .a-chart--tall { height: 240px; }
  .a-kpi strong { font-size: 1.4rem; }
}
