/* =============== THEME =============== */
:root{
  /* Paleta industrial (modo oscuro por defecto) */
  --bg: #0b1119;
  --surface: #0f172a;
  --surface-2: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;

  --green: #22c55e;
  --green-30: rgba(34,197,94,.30);
  --green-15: rgba(34,197,94,.15);

  --red: #ef4444;
  --red-30: rgba(239,68,68,.30);
  --red-15: rgba(239,68,68,.15);

  --yellow: #f59e0b;

  --ring: rgba(255,255,255,.08);
  --shadow: 0 10px 20px rgba(0,0,0,.35);
  --radius-xl: 16px;
  --radius-lg: 14px;
  --radius-md: 12px;

  --gap: 1rem;
  --gap-lg: 1.25rem;

  --font-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light){
  :root{
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --muted: #475569;
    --ring: rgba(17,24,39,.1);
  }
}

/* =============== BASE =============== */
* { box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

/* ⬇️ Ancho del contenedor levemente mayor para 6 columnas cómodas */
.wrap{ width:min(1400px, 94vw); margin-inline:auto; }

.app-header{
  border-bottom: 1px solid var(--ring);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0)) , var(--surface);
}
.app-title{ margin: 1.25rem 0 .25rem; font-size:clamp(1.4rem, 2.4vw, 1.9rem); }
.app-subtitle{ margin:0 0 1rem; color:var(--muted); font-size:.95rem; }

.legend{ list-style:none; padding:0; margin:0 0 1rem; display:flex; gap:1rem; color:var(--muted); font-size:.95rem; }
.dot{ width:.9rem; height:.9rem; display:inline-block; border-radius:50%; margin-right:.45rem; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
.dot--green{ background:var(--green); }
.dot--red{ background:var(--red); }

/* =============== GRID =============== */
/* ✔️ Nueva estrategia responsive por breakpoints con tope en 6 columnas */
.grid{
  display:grid;
  gap: var(--gap-lg);
  padding: 1.25rem 0 2rem;
  grid-template-columns: repeat(1, 1fr);           /* móvil */
}

@media (min-width: 560px){
  .grid{ grid-template-columns: repeat(2, 1fr); }  /* phablet */
}
@media (min-width: 820px){
  .grid{ grid-template-columns: repeat(3, 1fr); }  /* tablet */
}
@media (min-width: 1024px){
  .grid{ grid-template-columns: repeat(4, 1fr); }  /* notebook */
}
@media (min-width: 1200px){
  .grid{ grid-template-columns: repeat(5, 1fr); }  /* desktop mediano */
}
@media (min-width: 1360px){
  .grid{ grid-template-columns: repeat(6, 1fr); }  /* ✅ desktop ancho: 6 columnas */
}

/* =============== CARD =============== */
.card{
  position:relative;
  overflow:hidden;
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  border: 1px solid var(--ring);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  outline: none;
}
.card:focus-within{
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 0 0 3px rgba(255,255,255,.08), var(--shadow);
  transform: translateY(-2px);
}

/* Franja superior */
.card__stripe{
  height: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,.5), transparent 40%);
  opacity:.35;
}

/* Head */
.card__head{ padding: 1rem 1rem .5rem; }
.card__title{
  margin:0;
  font-size: clamp(1.05rem, 2vw, 1.25rem); /* leve ajuste para 6 col */
  letter-spacing:.2px;
}
.card__subtitle{
  margin:.35rem 0 0;
  color:var(--muted);
  font-size:.92rem;
}

/* Body */
.card__body{
  display:grid;
  gap:.6rem;
  padding: .25rem 1rem 1.1rem;
}

.status{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  font-weight:600;
  font-size:.9rem;
  letter-spacing:.2px;
  padding:.3rem .55rem;
  border-radius: 999px;
  border:1px solid var(--ring);
  width: fit-content;
  background: rgba(255,255,255,.04);
}
.status--green{ color: var(--green); box-shadow: inset 0 0 0 1px rgba(34,197,94,.35); }
.status--red{ color: var(--red); box-shadow: inset 0 0 0 1px rgba(239,68,68,.35); }

.clock{
  display:flex; align-items:center; justify-content:center;
  min-height: 70px; /* leve ajuste para encajar en 6 col */
  border-radius: var(--radius-lg);
  border: 1px dashed var(--ring);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.08));
}
.clock__value{
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  letter-spacing: .06em;
  user-select: none;
}

/* Barra inferior decorativa */
.card__foot{ padding: 0 1rem 1rem; }
.bar{
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  position: relative;
}
.bar__fill{
  position:absolute; inset:0 auto 0 0;
  width: var(--fill, 50%);
  background: linear-gradient(90deg, rgba(255,255,255,.25), rgba(255,255,255,0));
  mix-blend-mode: screen;
}
.card.is-active .bar__fill{ background:
  linear-gradient(90deg, rgba(34,197,94,.65), rgba(34,197,94,.25)); }
.card.is-inactive .bar__fill{ background:
  linear-gradient(90deg, rgba(239,68,68,.65), rgba(239,68,68,.25)); }

/* Estado visual principal */
.card.is-active{
  background:
    linear-gradient(180deg, var(--green-15), transparent 55%),
    var(--surface-2);
  border-color: rgba(34,197,94,.40);
  box-shadow:
    0 0 0 1px rgba(34,197,94,.25),
    0 10px 30px -10px rgba(34,197,94,.25),
    var(--shadow);
}
.card.is-inactive{
  background:
    linear-gradient(180deg, var(--red-15), transparent 55%),
    var(--surface-2);
  border-color: rgba(239,68,68,.35);
  box-shadow:
    0 0 0 1px rgba(239,68,68,.22),
    0 10px 30px -10px rgba(239,68,68,.22),
    var(--shadow);
}

/* Footer */
.app-footer{
  color:var(--muted);
  padding: .5rem 0 2rem;
  border-top: 1px solid var(--ring);
}

/* Accesibilidad extra */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; }
}
