/* Panel del Hogar — tema oscuro para pantalla siempre encendida */
:root {
  --bg: #0b1020;
  --card: #141a2e;
  --card-2: #1b2340;
  --line: #263055;
  --text: #eef2ff;
  --muted: #8f9bc2;
  --accent: #7dd3fc;
  --warn: #fbbf24;
  --ok: #4ade80;
  --radius: 18px;
  --gap: clamp(10px, 1.4vw, 20px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "HarmonyOS Sans", sans-serif;
  font-size: clamp(14px, 1.35vw, 19px);
  line-height: 1.35;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.muted { color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; }

.panel {
  height: calc(100% - 30px);
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  gap: var(--gap);
  padding: var(--gap) var(--gap) 0;
}
.col { min-height: 0; display: flex; flex-direction: column; gap: var(--gap); }
.col-agenda, .col-tasks {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--gap);
}
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.col-head h2 { font-size: 1.15em; font-weight: 650; letter-spacing: .01em; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.empty { color: var(--muted); padding: 1em 0; }

.btn {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35em .9em;
  font-size: .85em;
}
.btn:active { background: var(--line); }

/* ---------- Familia ---------- */
.family {
  font-size: 1.05em;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--warn);
  padding: .1em .35em 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Reloj ---------- */
.clock { padding: .2em .3em 0; }
.time {
  font-size: clamp(64px, 10.5vw, 150px);
  font-weight: 250;
  line-height: .95;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.secs { font-size: .28em; color: var(--muted); margin-left: .25em; letter-spacing: 0; vertical-align: top; position: relative; top: .35em; }
.date { font-size: 1.55em; color: var(--accent); margin-top: .25em; font-weight: 500; }

/* ---------- Clima ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: var(--gap); }
.weather { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--gap); justify-content: space-between; }
.w-now { display: flex; align-items: center; gap: .6em; }
.w-ico { font-size: 3.6em; line-height: 1; }
.w-temp { font-size: 3em; font-weight: 300; line-height: 1; }
.w-desc { font-size: 1.05em; margin: .15em 0; }
.w-hours, .w-days { display: flex; justify-content: space-between; text-align: center; gap: 4px; }
.w-hours { border-top: 1px solid var(--line); padding-top: .7em; }
.w-days { border-top: 1px solid var(--line); padding-top: .7em; }
.hour, .day { flex: 1; font-size: .92em; }
.ico { font-size: 1.55em; line-height: 1.3; }
.rain { font-size: .78em; color: var(--accent); }

/* ---------- Agenda ---------- */
.legend { display: flex; gap: .8em; font-size: .78em; color: var(--muted); }
.legend i { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .3em; }
.a-day { margin-bottom: .9em; }
.a-day h3 { font-size: .8em; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: .35em; }
.a-today h3 { color: var(--accent); }
.a-in { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .75; margin-left: .3em; }
.a-multi { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 18%, var(--card-2)), var(--card-2) 70%); }
.a-multi .a-time { font-size: .82em; }
.a-ev {
  display: flex; align-items: center; gap: .7em;
  background: var(--card-2);
  border-left: 4px solid var(--c);
  border-radius: 10px;
  padding: .45em .7em;
  margin-bottom: .35em;
}
.a-time { flex: 0 0 auto; min-width: 3.2em; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--c); font-size: .92em; }
.a-title { flex: 1; min-width: 0; }
.a-title small { display: block; color: var(--muted); font-size: .8em; }
.a-past { opacity: .45; }
.a-now { box-shadow: 0 0 0 1px var(--c) inset; }
.pill { font-size: .7em; background: var(--c); color: var(--bg); border-radius: 999px; padding: .1em .6em; font-weight: 700; }

/* ---------- Tareas ---------- */
.all-done { background: #14321f; color: var(--ok); border-radius: 12px; padding: .6em .8em; margin-bottom: .7em; font-weight: 600; }
.member { background: var(--card-2); border-radius: 12px; padding: .55em .75em .6em; margin-bottom: .55em; }
.m-head { display: flex; align-items: center; gap: .45em; }
.m-emoji { font-size: 1.2em; }
.m-count { margin-left: auto; color: var(--c); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 5px; background: var(--line); border-radius: 3px; margin: .4em 0 .35em; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c); border-radius: 3px; transition: width .6s; }
.member ul { list-style: none; font-size: .9em; }
.member li { padding: .12em 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-verified span { color: var(--muted); text-decoration: line-through; }
.t-done span { color: var(--muted); }
.m-free { font-size: .88em; }

/* ---------- Pie ---------- */
.status { height: 30px; display: flex; align-items: center; justify-content: flex-end; gap: .6em; padding: 0 var(--gap); font-size: 12px; color: var(--muted); }
.status .warn { color: var(--warn); }
.link { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 0 .3em; }

/* ---------- App Hogar superpuesta ---------- */
.overlay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: var(--bg); z-index: 20; display: flex; flex-direction: column; }
.overlay[hidden] { display: none; }
.overlay-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: var(--card); }
.overlay iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- Modo noche ---------- */
.night { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 2s; z-index: 30; }

/* ---------- Pantallas angostas / vertical ---------- */
@media (max-width: 900px) {
  body { overflow: auto; }
  .panel { height: auto; grid-template-columns: 1fr; padding-bottom: var(--gap); }
  .time { font-size: 22vw; }
  .col-agenda, .col-tasks { max-height: none; }
  .scroll { overflow: visible; }
}
@media (min-width: 901px) and (max-width: 1150px) {
  .panel { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; }
  .col-now { grid-column: 1 / -1; flex-direction: row; align-items: stretch; }
  .col-now .clock { flex: 0 0 auto; }
  .col-now .weather { flex: 1; }
  .w-hours { display: none; }
}
