/* INTECH2.0 — paleta oficial: azul #1A3BAE · azul brillante #2E5BFF · turquesa #1ABC9C · verde #9CCB7B */
:root {
  --brand: #1A3BAE;
  --brand-bright: #2E5BFF;
  --deep: #0F2570;
  --teal: #1ABC9C;
  --teal-dark: #14967D;
  --green: #9CCB7B;
  --brand-soft: #E9EEFB;
  --teal-soft: #E3F7F2;
  --ok: #14967D;
  --ok-soft: #E3F7F2;
  --crit: #C0392B;
  --crit-soft: #FBEAE7;
  --warn: #8A6D1A;
  --warn-soft: #FBF3DA;
  --ink: #16213E;
  --muted: #64708D;
  --line: #E9ECF4;
  --bg: #F6F8FC;
  --shadow-sm: 0 2px 10px rgba(22, 33, 62, .05);
  --shadow-md: 0 8px 26px rgba(22, 33, 62, .08);
  --shadow-float: 0 16px 44px rgba(4, 16, 60, .22);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--crit); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Accesibilidad: quien pide menos movimiento ve la interfaz estática, sin animaciones. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.brand { font-weight: 700; font-size: 18px; letter-spacing: .5px; color: var(--brand); }
.brand span { color: var(--teal); font-weight: 500; }

/* ===== Login: pantalla completa de marca ===== */
#login {
  min-height: 100dvh;
  background: var(--brand);
  background-image: radial-gradient(circle at 50% 0%, #2547C4 0%, var(--brand) 55%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px; text-align: center;
}
#login .logo-mark { height: 92px; margin-bottom: 14px; }
#login .brand { color: #fff; font-size: 22px; letter-spacing: 3px; }
#login .brand span { color: var(--teal); }
#login .tagline { color: #C9D4F2; font-size: 14px; margin: 6px 0 30px; }
.login-card {
  background: #fff; border-radius: 18px; padding: 26px 22px;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow-float);
  text-align: left;
  animation: rise .4s ease both;
}
.login-card label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin: 0 0 6px 2px; }
.login-card input {
  width: 100%; padding: 13px 14px; margin-bottom: 14px;
  border: 1.5px solid var(--line); border-radius: 11px; font-size: 16px;
  background: #FAFBFE; color: var(--ink); outline: none;
  transition: border-color .15s, background .15s;
}
.login-card input:focus { border-color: var(--teal); background: #fff; }
.login-card button {
  width: 100%; padding: 14px; border: 0; border-radius: 11px; margin-top: 4px;
  background: var(--teal); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s;
}
.login-card button:hover { background: var(--teal-dark); }
.login-card button:active { transform: scale(.985); }
#login .foot { margin-top: 26px; font-size: 12px; color: #7d90d4; letter-spacing: 1.5px; text-transform: uppercase; }
#login .err { margin-top: 14px; color: #FFB3A7; }

/* ===== Dashboard: cabecera de marca ===== */
#dash { padding-bottom: 46px; }
.app-top {
  background: var(--brand);
  background-image: linear-gradient(160deg, #2547C4 0%, var(--brand) 60%, var(--deep) 100%);
  padding: 18px 16px 78px;
}
.app-top-in {
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.app-top .id { display: flex; align-items: center; gap: 11px; }
.app-top .logo-mark { height: 38px; }
.app-top .brand { color: #fff; font-size: 17px; }
.app-top .brand span { color: var(--teal); }
.app-top .empresa { font-size: 12.5px; color: #C9D4F2; margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.bell {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff;
  font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 20px; cursor: pointer;
  transition: background .15s;
}
.bell:hover { background: rgba(255,255,255,.26); }
.link { background: none; border: 0; color: #C9D4F2; font-size: 13.5px; cursor: pointer; }
.link:hover { color: #fff; }

.app-body { max-width: 480px; margin: -62px auto 0; padding: 0 16px; }

/* ===== Tarjeta de estado (flota sobre la cabecera) ===== */
.status-card {
  display: flex; align-items: center; gap: 18px;
  padding: 20px; border-radius: 18px; margin-bottom: 16px;
  background: #fff;
  box-shadow: var(--shadow-float);
  transition: background .35s;
  animation: rise .45s ease both;
}
.status-card.verde    { background: var(--ok-soft); }
.status-card.amarillo { background: var(--warn-soft); }
.status-card.rojo     { background: var(--crit-soft); }
#status-title { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.status-card.verde    #status-title { color: var(--teal-dark); }
.status-card.amarillo #status-title { color: var(--warn); }
.status-card.rojo     #status-title { color: var(--crit); }
#status-sub { font-size: 13.5px; margin-top: 2px; }

.semaforo {
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px; border-radius: 15px; background: var(--ink); flex: none;
}
.luz { width: 22px; height: 22px; border-radius: 50%; opacity: .16; transition: opacity .3s, box-shadow .3s; }
.luz.roja     { background: #E24B4A; color: #E24B4A; }
.luz.amarilla { background: #EF9F27; color: #EF9F27; }
.luz.verde    { background: var(--teal); color: var(--teal); }
.luz.on { opacity: 1; box-shadow: 0 0 14px currentColor; }

/* ===== Contadores ===== */
.counts { display: flex; gap: 10px; margin-bottom: 28px; }
.count {
  flex: 1; text-align: center; background: #fff; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 15px; padding: 14px 6px 12px;
  box-shadow: var(--shadow-sm);
}
.count::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.count.seg::before { background: var(--brand); }
.count.sal::before { background: var(--teal); }
.count.tot::before { background: var(--green); }
.count span { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.count.seg span { color: var(--brand); }
.count.sal span { color: var(--teal-dark); }
.count.tot span { color: var(--ink); }
.count label { font-size: 11.5px; color: var(--muted); }

/* ===== Cabeceras de sección ===== */
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
h2 {
  font-size: 13px; font-weight: 700; margin: 0; flex: 1;
  text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted);
}
.plan-badge {
  font-size: 11px; padding: 4px 11px; border-radius: 20px;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap; font-weight: 600;
}
.plan-badge.over { background: var(--crit-soft); color: var(--crit); }
.add-btn {
  background: #fff; border: 1.5px solid var(--teal); border-radius: 20px;
  color: var(--teal-dark); font-size: 11px; font-weight: 600; padding: 5px 12px; cursor: pointer;
  transition: background .15s;
}
.add-btn:hover { background: var(--teal-soft); }

/* ===== Equipos ===== */
.agents { display: flex; flex-direction: column; gap: 9px; margin-bottom: 26px; }
.agent {
  display: flex; align-items: center; gap: 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s;
}
.agent:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.dot.off { background: var(--muted); opacity: .45; }
.agent-name { font-weight: 600; font-size: 14.5px; }
.agent-meta { font-size: 12px; color: var(--muted); margin-left: auto; }
.chip { font-size: 10px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; font-weight: 600; }
.chip.over { background: var(--crit-soft); color: var(--crit); }

/* añadir equipo */
.add-agent {
  background: #fff; border: 1px solid var(--line); border-radius: 15px;
  padding: 16px; margin-bottom: 12px; font-size: 13px;
  box-shadow: var(--shadow-sm); animation: rise .3s ease both;
}
.add-agent p { margin: 0 0 12px; line-height: 1.5; }
.dl-btns { display: flex; gap: 10px; margin-bottom: 12px; }
.dl {
  flex: 1; padding: 12px; border: 0; border-radius: 11px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s;
}
.dl:hover { background: var(--brand-bright); }
.dl:active { transform: scale(.985); }
.steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.steps li { margin-bottom: 7px; }
.steps code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 11px; word-break: break-all; }

/* ===== Avisos ===== */
.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 15px;
  padding: 15px 16px; border-left: 4px solid var(--teal);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: box-shadow .18s, transform .18s, opacity .25s;
  animation: rise .35s ease both;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card.critico { border-left-color: var(--crit); }
.card.rutinario { border-left-color: var(--teal); }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card .titulo { font-weight: 650; font-size: 15px; letter-spacing: -.1px; }
.card .msg { margin: 7px 0 9px; font-size: 14px; line-height: 1.5; color: #2C3A5C; }
.card .meta { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.badge {
  font-size: 10.5px; padding: 3px 9px; border-radius: 20px; white-space: nowrap;
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
}
.badge.critico { background: var(--crit-soft); color: var(--crit); }
.chip-estado {
  display: inline-block; margin-top: 9px; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.chip-estado.activo  { background: var(--warn-soft); color: var(--warn); }
.chip-estado.calmado { background: var(--ok-soft); color: var(--teal-dark); }
.card.vista { opacity: .5; }
.card.vista:hover { opacity: .75; }
.empty {
  text-align: center; color: var(--muted); padding: 34px 16px; font-size: 14px;
  background: #fff; border: 1px dashed var(--line); border-radius: 15px;
}
.empty.small { padding: 20px 14px; font-size: 13px; }

/* ===== Escritorio: dos columnas ===== */
@media (min-width: 900px) {
  .app-top { padding: 22px 24px 86px; }
  .app-top-in { max-width: 980px; }
  .app-top .logo-mark { height: 42px; }
  .app-body { max-width: 980px; margin-top: -66px; padding: 0 24px; }
  .dash-grid { display: grid; grid-template-columns: 430px 1fr; gap: 30px; align-items: start; }
  .col-right { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-md); }
  .col-right .list { max-height: calc(100vh - 210px); overflow-y: auto; padding-right: 6px; }
  .col-right .list::-webkit-scrollbar { width: 8px; }
  .col-right .list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
  .login-card { padding: 34px 30px; }
}
