/* Vera — "presence" theme: deep night glass, iridescent ion/aurora accent, mono read-outs. */
:root {
  --night: #070b1a;
  --night-2: #0c1330;
  --glass: rgba(18, 26, 56, 0.62);
  --line: rgba(143, 216, 255, 0.14);
  --line-strong: rgba(143, 216, 255, 0.32);
  --text: #e8ecff;
  --muted: #8c96c4;
  --ion: #8fd8ff;
  --aurora: #c3a6ff;
  --pulse: #7cf0c8;
  --signal: #ffb577;
  --danger: #ff6b81;
  --iridescent: linear-gradient(120deg, var(--ion), var(--aurora));
  --radius: 14px;
  --display: "Michroma", "Eurostile", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 var(--body);
  color: var(--text);
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(143, 216, 255, 0.16), transparent 70%),
    radial-gradient(800px 420px at 100% 0%, rgba(195, 166, 255, 0.10), transparent 70%),
    linear-gradient(180deg, var(--night-2), var(--night) 480px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ion); text-decoration-color: rgba(143, 216, 255, 0.4); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--ion); outline-offset: 2px; border-radius: 6px; }
main { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1rem 4rem; }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 { font-size: 1.05rem; margin: 0.5rem 0 1.25rem; }
h2 { font-size: 0.72rem; margin: 0 0 0.75rem; color: var(--muted); }

/* ---------- Presence orb (signature) ---------- */
.orb {
  --size: 28px;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0 6%, transparent 22%),
    radial-gradient(circle at 70% 75%, rgba(195, 166, 255, 0.95), transparent 60%),
    radial-gradient(circle at 30% 70%, rgba(143, 216, 255, 0.95), transparent 62%),
    #3a4a8a;
  box-shadow:
    0 0 calc(var(--size) * 0.5) rgba(143, 216, 255, 0.45),
    0 0 calc(var(--size) * 1.2) rgba(195, 166, 255, 0.25),
    inset 0 0 calc(var(--size) * 0.25) rgba(7, 11, 26, 0.6);
  animation: breathe 5.5s ease-in-out infinite;
}
.orb.busy { animation: breathe 1.6s ease-in-out infinite, shimmer 3s linear infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(1); filter: brightness(0.95); }
  50% { transform: scale(1.06); filter: brightness(1.15); }
}
@keyframes shimmer { to { filter: hue-rotate(360deg) brightness(1.1); } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.7rem 1rem;
  background: rgba(7, 11, 26, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-size: 0.85rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
}
.topbar nav { flex: 1; min-width: 0; }
.topbar ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none;
}
.topbar ul::-webkit-scrollbar { display: none; }
.topbar li { margin: 0; flex: none; }
.topbar li:last-child { margin-left: auto; }
.topbar a, .topbar button.link {
  display: inline-block; padding: 0.35rem 0.7rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: 0.9rem;
}
.topbar a:hover, .topbar button.link:hover { color: var(--text); background: rgba(143, 216, 255, 0.08); }
.topbar a[aria-current="page"] { color: var(--night); background: var(--iridescent); }
.topbar form { margin: 0; }
button.link { background: none; border: 0; font: inherit; cursor: pointer; }

/* ---------- Hero (dashboard) ---------- */
.hero { display: flex; align-items: center; gap: 1.1rem; margin: 1rem 0 1.5rem; }
.hero .orb { --size: 64px; }
.hero .greeting { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.hero .date { margin: 0.2rem 0 0; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { padding: 0.55rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.card li:first-child { border-top: 0; padding-top: 0.1rem; }
.card li:last-child { padding-bottom: 0.1rem; }
.card > :last-child { margin-bottom: 0; }
details.card > summary { color: var(--muted); }
summary { cursor: pointer; }

.muted { color: var(--muted); font-size: 0.85rem; }
.card li .muted, .row .muted { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.02em; }
.done { text-decoration: line-through; color: var(--muted); }
.note-body { white-space: pre-wrap; }

/* ---------- Status HUD ---------- */
.status { display: grid; gap: 0.9rem; border-color: var(--line-strong); }
.status::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--iridescent); opacity: 0.35;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.status > * { margin: 0; }
.phones { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.phone {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.3rem 0.35rem 0.3rem 0.8rem; margin: 0;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(7, 11, 26, 0.4);
}
.timer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.timer span { font-family: var(--mono); font-size: 1.05rem; letter-spacing: 0.02em; }
.timer form { margin: 0; }
.jobs { color: var(--muted); font-size: 0.9rem; }
.jobs strong {
  margin-right: 0.4rem; color: var(--muted);
  font-family: var(--display); font-weight: 400; font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.missed { border-color: rgba(255, 181, 119, 0.4); }
.missed h2 { color: var(--signal); }

/* ---------- Forms ---------- */
label { display: block; margin-bottom: 1rem; color: var(--muted); font-size: 0.85rem; }
input, textarea, select {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.7rem 0.8rem;
  font: inherit; font-size: 1rem; color: var(--text);
  background: rgba(7, 11, 26, 0.6); border: 1px solid var(--line-strong); border-radius: 10px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ion); box-shadow: 0 0 0 3px rgba(143, 216, 255, 0.18); }
input[type="date"], input[type="datetime-local"] { font-family: var(--mono); font-size: 0.9rem; }
.search { display: flex; gap: 0.5rem; align-items: flex-end; margin-bottom: 1rem; }
.search label { flex: 1; margin: 0; }
.row { display: flex; align-items: center; gap: 0.75rem; }
.row > span { flex: 1; }
.row form { margin: 0; }
li form { display: inline-block; margin: 0.4rem 0.4rem 0 0; }

/* ---------- Buttons ---------- */
/* Default: quiet ghost button. Primary only where a form's main action lives. */
button {
  font: inherit; font-size: 0.9rem; cursor: pointer;
  padding: 0.45rem 0.85rem; border-radius: 999px;
  color: var(--text); background: rgba(143, 216, 255, 0.06);
  border: 1px solid var(--line-strong);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
button:hover { background: rgba(143, 216, 255, 0.14); border-color: var(--ion); }
button:active { transform: translateY(1px); }

button.primary,
form.card > button[type="submit"],
.search button,
body.login button[type="submit"] {
  padding: 0.6rem 1.15rem; font-weight: 600;
  color: var(--night); background: var(--iridescent); border: 0;
  box-shadow: 0 6px 22px rgba(143, 216, 255, 0.25);
}
button.primary:hover,
form.card > button[type="submit"]:hover,
.search button:hover,
body.login button[type="submit"]:hover { background: var(--iridescent); box-shadow: 0 8px 30px rgba(195, 166, 255, 0.4); }

button.toggle { min-width: 3.4rem; padding: 0.3rem 0.75rem; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; }
button.toggle.on { color: var(--night); background: var(--pulse); border-color: var(--pulse); box-shadow: 0 0 16px rgba(124, 240, 200, 0.45); }
button.toggle.off { color: var(--muted); background: transparent; }
button.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
button.danger:hover { background: #ff8597; border-color: #ff8597; }
button.link:hover { background: none; }

/* ---------- Messages ---------- */
.error {
  color: #ffd5db; background: rgba(255, 107, 129, 0.12);
  border: 1px solid rgba(255, 107, 129, 0.45); border-radius: 10px; padding: 0.65rem 0.8rem;
}
.pager { display: flex; justify-content: space-between; margin-bottom: 1rem; font-family: var(--mono); font-size: 0.85rem; }

/* ---------- Login ---------- */
body.login main { max-width: 22rem; margin-top: 12vh; text-align: center; }
body.login .orb { --size: 88px; margin: 0 auto 1.5rem; }
body.login h1 { font-size: 1.3rem; letter-spacing: 0.4em; margin-bottom: 2rem; }
body.login form { text-align: left; }
body.login button[type="submit"] { width: 100%; margin-top: 0.5rem; }

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: 0.5rem; }
  .topbar nav { flex-basis: 100%; }
  .hero .orb { --size: 52px; }
  .hero .greeting { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .orb, .orb.busy { animation: none; }
  button { transition: none; }
}
