/* Eleanor: Richard's layout in a Pixel 9 "Wintergreen" palette -- a soft sage green,
   deepened for the navbar and sign-in panel and tinted for surfaces. */
:root {
  --bg: #f6faf7; --fg: #15201b; --muted: #61736a; --line: #dce7e0; --line-strong: #c4d4ca;
  --panel: #ffffff; --soft: #ecf3ee; --input: #ffffff;
  --blue: #3d7a64; --blue-dark: #2f6552; --nav: #2f5d50;
  --blue-soft: #e4efe8; --blue-soft-text: #28574a; --blue-soft-line: #bcd5c7;
  --ok: #16a34a; --bad: #dc2626; --bad-soft: #fef2f2; --bad-line: #fecaca; --bad-text: #b91c1c;
  --warn: #d97706; --shadow: 0 1px 2px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b110e; --fg: #e8f0eb; --muted: #94a89d; --line: #25352d; --line-strong: #35483f;
    --panel: #111a15; --soft: #1a2820; --input: #1a2820;
    --blue: #6bb99c; --blue-dark: #4f9d80;
    --blue-soft: #15281f; --blue-soft-text: #c2e6d4; --blue-soft-line: #27493a;
    --bad-soft: #450a0a; --bad-line: #7f1d1d; --bad-text: #fca5a5; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { max-width: 100vw; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.02rem; }
a { color: inherit; text-decoration: none; }
code { background: var(--soft); border-radius: 4px; padding: .05rem .35rem; font-size: .85em; }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.icon { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }

/* Navbar (same blue and proportions as Richard's) */
.nav { position: sticky; top: 0; z-index: 10; background: var(--nav); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1); user-select: none; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1rem; flex-wrap: wrap; }
.nav__brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: x-large; }
.nav__links { display: flex; gap: .5rem; flex-wrap: wrap; }
.nav__link { display: inline-flex; align-items: center; gap: .4rem; color: #e1efe7; background: none;
  border: 0; font: inherit; font-size: .93rem; padding: .3rem .6rem; border-radius: 6px; cursor: pointer; }
.nav__link:hover { background: rgba(255,255,255,.12); }
.nav__link--active { background: rgba(255,255,255,.22); color: #fff; }

/* Account menu */
.menu { position: relative; font-size: .875rem; }
.menu__pill { display: flex; align-items: center; gap: .5rem; border: 0; cursor: pointer; color: #fff;
  background: rgba(255,255,255,.15); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
  border-radius: 999px; padding: .25rem .65rem .25rem .25rem; font: inherit; }
.menu__pill:hover { background: rgba(255,255,255,.25); }
.menu__card { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 50; width: 16rem;
  background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 16px;
  padding: .75rem; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.menu__who { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .5rem 0 .75rem; text-align: center; }
.menu__item { display: flex; align-items: center; gap: .6rem; width: 100%; background: none; border: 0;
  color: inherit; font: inherit; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; text-align: left; }
.menu__item:hover { background: var(--soft); }
.avatar { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; }
.pill { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; padding: .1rem .55rem;
  font-size: .75rem; font-weight: 600; background: var(--blue-soft); color: var(--blue-soft-text); }

main { padding: 1.25rem 1rem; max-width: 1100px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1rem;
  display: flex; flex-direction: column; gap: .6rem; box-shadow: var(--shadow); }
.stack-sm { display: flex; flex-direction: column; gap: .55rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
label.row { font-weight: 400; margin: 0; }
.field { flex: 1 1 160px; min-width: 120px; }
input[type=text], input[type=password], select {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--input); color: var(--fg); font: inherit; box-shadow: var(--shadow); outline: none;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--blue); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem 1rem;
  border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--fg);
  font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
  transition: background .15s; }
.btn:hover { background: var(--soft); }
.btn.primary { background: linear-gradient(#45856d, #2f6552); border-color: transparent; color: #fff; }
.btn.primary:hover { background: linear-gradient(#3d7a64, #285847); }
.btn.danger { color: var(--bad-text); border-color: var(--bad-line); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.block { width: 100%; padding: .65rem 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.spinner { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--soft);
  border-radius: 999px; padding: .1rem .6rem; font-size: .83rem; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font: inherit; }
.chip button:hover { color: var(--bad); }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--muted); }
.dot.up { background: #34c27a; box-shadow: 0 0 0 3px rgba(52,194,122,.25); } .dot.down { background: #f87171; }
.alert { border-radius: 8px; padding: .65rem .8rem; font-size: .875rem; margin: 0; }
.alert.info { border: 1px solid var(--blue-soft-line); background: var(--blue-soft); color: var(--blue-soft-text); }
.alert.error { border: 1px solid var(--bad-line); background: var(--bad-soft); color: var(--bad-text); }
.hint { color: var(--warn); font-size: .8rem; }

#toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 80; }
.toast { background: #111827; color: #fff; padding: .6rem .9rem; border-radius: 8px; max-width: 360px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: .75rem; }
.overlay > div { width: 100%; max-width: 24rem; }

/* Sign-in screens (the same frame as Richard's AuthShell) */
.auth { display: grid; min-height: 100vh; }
@media (min-width: 1024px) { .auth { grid-template-columns: 1.15fr 1fr; } }
.auth-hero { display: none; position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(160,208,184,.38), transparent 60%),
              linear-gradient(145deg, #356b5b 0%, #2a5246 55%, #1c3a31 100%); }
@media (min-width: 1024px) { .auth-hero { display: flex; flex-direction: column; justify-content: space-between; padding: 3rem; } }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .brandrow { display: flex; align-items: center; gap: .75rem; font-size: 1.5rem; font-weight: 600; }
.auth-hero h2 { font-size: 2.25rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 1rem; }
.auth-hero p { color: rgba(226,241,232,.92); margin: 0; max-width: 28rem; }
.auth-hero .foot { font-size: .75rem; color: rgba(226,241,232,.62); }
.auth-grid { position: absolute !important; inset: 0; z-index: 0 !important;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse at 30% 40%, #000 25%, transparent 75%); }
.auth-traces { position: absolute !important; inset: 0; width: 100%; height: 100%; z-index: 0 !important; }
.auth-form { display: grid; place-items: center; padding: 1.25rem 2rem; }
@media (min-width: 640px) { .auth-form { padding: 2rem; } }
.auth-form > div { width: 100%; max-width: 24rem; display: flex; flex-direction: column; gap: 1.5rem; }
.auth-mobile-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.25rem; font-weight: 600; }
@media (min-width: 1024px) { .auth-mobile-brand { display: none; } }
.auth-mobile-brand .logo { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 8px; background: var(--nav); }
.auth-form h1 { font-size: 1.9rem; margin: 0 0 .25rem; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.inwrap { position: relative; margin-top: .4rem; }
.inwrap .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.inwrap input { padding-left: 2.4rem; padding-top: .65rem; padding-bottom: .65rem; }
.inwrap button.eye { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); background: none; border: 0;
  color: #9ca3af; cursor: pointer; padding: .3rem; border-radius: 6px; display: grid; }
.inwrap button.eye:hover { color: var(--fg); }
.inwrap button.eye .icon { position: static; transform: none; color: inherit; }
.inwrap.has-eye input { padding-right: 2.4rem; }

@keyframes auth-flow { to { stroke-dashoffset: -260; } }
@keyframes auth-pulse { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: 1; transform: scale(1.7); } }
.auth-trace { stroke-dasharray: 10 14; animation: auth-flow 9s linear infinite; }
.auth-trace--slow { animation-duration: 16s; } .auth-trace--fast { animation-duration: 6s; }
.auth-node { transform-box: fill-box; transform-origin: center; animation: auth-pulse 3.2s ease-in-out infinite; }
.auth-node--b { animation-delay: 1.1s; } .auth-node--c { animation-delay: 2.1s; }
@media (prefers-reduced-motion: reduce) { .auth-trace, .auth-node { animation: none; } }
