/* ===========================================================================
   Strava Dashboard — "Daybreak": fancy, light, airy
   Coral→amber gradient accent · violet secondary · glass cards
   =========================================================================== */
:root {
  --bg:        #F4F5FB;
  --surface:   #FFFFFF;
  --surface-2: #F1F3FB;
  --glass:     rgba(255,255,255,.72);

  --ink:       #15182A;
  --muted:     #5B6280;
  --faint:     #969CB6;
  --border:    #E7E9F4;
  --border-2:  #DDE0EE;

  --coral:     #FF6A3D;
  --amber:     #FF9E2C;
  --violet:    #6C5CE7;
  --violet-2:  #A66BFF;
  --teal:      #17C0B8;

  --grad-a: linear-gradient(120deg, #FF6A3D 0%, #FF9E2C 100%);
  --grad-v: linear-gradient(120deg, #6C5CE7 0%, #A66BFF 100%);
  --grad-text: linear-gradient(115deg, #FF5E7A 0%, #FF6A3D 42%, #FF9E2C 100%);

  --z1: #63D29A; --z2: #29B473; --z3: #F4C13D; --z4: #F2884A; --z5: #EB5160;

  --shadow-sm: 0 1px 2px rgba(21,24,42,.04), 0 4px 12px rgba(21,24,42,.05);
  --shadow:    0 2px 6px rgba(21,24,42,.05), 0 18px 40px -18px rgba(76,60,150,.22);
  --shadow-lg: 0 30px 60px -24px rgba(76,60,150,.35);

  --radius: 20px;
  --grid-line: rgba(21,24,42,.07);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.accentic { color: var(--coral); font-weight: 600; }

/* ---- Aurora backdrop ---- */
.aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42rem 32rem at 12% -8%, rgba(255,106,61,.20), transparent 60%),
    radial-gradient(40rem 34rem at 92% 4%, rgba(108,92,231,.18), transparent 62%),
    radial-gradient(38rem 30rem at 70% 96%, rgba(23,192,184,.14), transparent 60%),
    radial-gradient(36rem 30rem at 20% 88%, rgba(255,158,44,.14), transparent 62%);
  filter: saturate(1.05);
}

/* ---- Topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad-a); color: #fff; font-size: 13px; box-shadow: 0 6px 16px -4px rgba(255,106,61,.6);
  transform: rotate(0deg);
}
.brand-name { letter-spacing: -.01em; }
.brand-thin { color: var(--faint); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(23,192,184,.16); }
.live-pill.stale .live-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(255,158,44,.16); }
.btn-refresh {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 600; color: #fff;
  background: var(--grad-a); border: 0; border-radius: 999px; padding: 8px 16px;
  box-shadow: 0 8px 20px -8px rgba(255,106,61,.7);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
}
.btn-refresh:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(255,106,61,.8); }
.btn-refresh:active { transform: translateY(0); }
.btn-refresh:disabled { opacity: .6; cursor: default; }
.btn-refresh.spinning .refresh-ico { display: inline-block; animation: spin 1s linear infinite; }
.refresh-ico { font-size: 15px; line-height: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Layout ---- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 8px 24px 80px; }

.hero { padding: 40px 4px 26px; }
.eyebrow {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600;
  color: transparent; background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  margin: 0 0 12px;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(38px, 6.4vw, 68px);
  line-height: .98; letter-spacing: -.03em; margin: 0; text-wrap: balance;
  color: transparent; background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  background-size: 200% auto;
}
@media (prefers-reduced-motion: no-preference) {
  .hero h1 { animation: shimmer 8s ease-in-out infinite; }
  @keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
}
.hero .sub { color: var(--muted); font-size: 16px; max-width: 56ch; margin: 14px 0 0; }

/* ---- Panels ---- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  margin-top: 22px;
}
.panel-head { margin-bottom: 18px; }
.panel h2 { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; margin: 0; }
.h-note { font-size: 13px; color: var(--faint); margin: 4px 0 0; }

.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; margin-top: 22px; }
.grid-2 > .panel, .grid-3 > .panel { margin-top: 0; }
.grid-3 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; margin-top: 22px; }

/* ---- KPI ---- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 8px; }
.kpi {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad-a); }
.kpi.v::before { background: var(--grad-v); }
.kpi .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.kpi .value { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; margin-top: 8px; }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Chart ---- */
.chart { width: 100%; height: 250px; display: block; }
.legend { display: flex; gap: 18px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.swatch.grad-a { background: var(--grad-a); }
.swatch.grad-v { background: var(--grad-v); }

/* ---- Sport breakdown ---- */
.sport-row { display: flex; flex-direction: column; gap: 16px; }
.sport { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: baseline; }
.sport .name { font-size: 14px; font-weight: 600; }
.sport .meta { font-size: 12px; color: var(--muted); }
.sport .val { font-size: 14px; font-weight: 700; font-family: var(--font-mono); }
.track { grid-column: 1 / -1; height: 9px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.track > div { height: 100%; border-radius: 6px; }

/* ---- Records ---- */
.rec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rec {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px;
  display: flex; flex-direction: column;
}
.rec .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.rec .v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.rec .l { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-top: 8px; }
.rec .sub2 { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Heart rate ---- */
.hr-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.hr-stat { display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 15px 16px; }
.hr-stat .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.hr-stat .v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.hr-stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-top: 7px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; margin: 4px 0 20px; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: transparent; border: 0; padding: 8px 16px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button:hover:not(.on) { color: var(--ink); }
.seg button:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

.zone-stack { display: flex; height: 42px; border-radius: 12px; overflow: hidden; margin-bottom: 22px; box-shadow: inset 0 0 0 1px rgba(21,24,42,.05); }
.zone-stack > div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; min-width: 0; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.zone-detail { display: flex; flex-direction: column; }
.zrow { display: grid; grid-template-columns: 16px minmax(120px, 172px) 1fr 100px; gap: 14px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.zrow:last-child { border-bottom: none; }
.zchip { width: 16px; height: 16px; border-radius: 5px; }
.zname { font-weight: 600; font-size: 14px; }
.zname small { display: block; font-weight: 400; font-size: 11px; color: var(--faint); font-family: var(--font-mono); margin-top: 1px; }
.zbar-track { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.zbar-track > div { height: 100%; border-radius: 6px; }
.zval { text-align: right; }
.zval strong { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.zval small { display: block; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.hr-sub { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 28px 0 6px; }
.hr-trend { width: 100%; height: 220px; display: block; }
.mini-stack { display: inline-flex; height: 10px; width: 108px; border-radius: 6px; overflow: hidden; background: var(--surface-2); vertical-align: middle; }
.mini-stack > div { height: 100%; }

/* ---- Tables ---- */
.tbl-wrap { overflow-x: auto; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
thead th { text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 0 14px 11px; border-bottom: 1px solid var(--border-2); }
thead th.num, tbody td.num { text-align: right; }
tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--surface-2); }
.act-name { font-weight: 600; }
.act-date { font-size: 12px; color: var(--faint); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: rgba(255,106,61,.10); color: var(--coral); }
.pill.walk { background: rgba(108,92,231,.10); color: var(--violet); }
.effort-chip { display: inline-flex; align-items: center; gap: 7px; justify-content: flex-end; }
.effort-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }

/* ---- Gear + zones ---- */
.gear { display: flex; flex-direction: column; gap: 14px; }
.gear-item { display: flex; gap: 14px; align-items: center; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.gear-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-a); color: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 6px 16px -6px rgba(255,106,61,.6); }
.gear-ico svg { width: 22px; height: 22px; }
.g-name { font-weight: 600; font-size: 14px; }
.g-meta { font-size: 12px; color: var(--muted); }
.gear-dist { margin-left: auto; text-align: right; font-family: var(--font-mono); font-weight: 600; font-size: 15px; }
.gear-dist small { display: block; font-size: 10px; color: var(--faint); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-family: var(--font-body); }

.zones { display: flex; flex-direction: column; gap: 18px; }
.zblock .z-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.z-title { font-size: 13px; font-weight: 600; }
.z-sub { font-size: 12px; color: var(--faint); }
.zbars { display: flex; gap: 5px; }
.zbars > div { flex: 1; text-align: center; }
.zbars .zb { height: 32px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.zbars .zl { font-size: 10px; color: var(--faint); margin-top: 6px; font-family: var(--font-mono); }
.ftp-row { display: flex; gap: 10px; }
.ftp-box { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; }
.ftp-box .fv { font-family: var(--font-display); font-size: 21px; font-weight: 700; }
.ftp-box .fl { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }

.foot { margin-top: 34px; text-align: center; font-size: 12px; color: var(--faint); }

/* ---- Overlay ---- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(244,245,251,.86); backdrop-filter: blur(6px); transition: opacity .4s; }
.overlay.hide { opacity: 0; pointer-events: none; }
.overlay-card { display: flex; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px 26px; box-shadow: var(--shadow-lg); max-width: 90vw; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,106,61,.18); border-top-color: var(--coral); animation: spin 1s linear infinite; flex-shrink: 0; }
.overlay-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin: 0; }
.overlay-sub { font-size: 13px; color: var(--muted); margin: 5px 0 0; }
.overlay-body code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.overlay-body a { color: var(--coral); }

/* ---- Filter bar ---- */
.filterbar { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; margin: 8px 4px 2px; }
.fgroup { display: flex; align-items: center; gap: 10px; }
.flabel { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.seg-sm button { padding: 6px 13px; font-size: 12.5px; }

/* ---- Calendar heatmap ---- */
.cal-wrap { overflow-x: auto; padding-bottom: 4px; }
.cal-grid { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 3px; min-width: 520px; }
.cal-cell { width: 100%; aspect-ratio: 1 / 1; border-radius: 3px; }
.cal-cell.s0 { background: #E9ECF6; }
.cal-cell.s1 { background: #FFE0CF; }
.cal-cell.s2 { background: #FFB98F; }
.cal-cell.s3 { background: #FF8A54; }
.cal-cell.s4 { background: #FF6A3D; }
.cal-legend { display: flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 11px; color: var(--faint); }
.cal-legend .cal-cell { width: 13px; height: 13px; aspect-ratio: auto; }

/* ---- Training load + heatmap ---- */
.load-chart { width: 100%; height: 240px; display: block; }
.heatmap { width: 100%; height: 340px; display: block; border-radius: 14px; background: radial-gradient(circle at 50% 42%, #1b1233 0%, #120c22 72%); }

/* ---- Power ---- */
#powerTop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.power-bars { display: flex; flex-direction: column; gap: 10px; }
.pbar-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) 3fr auto; gap: 12px; align-items: center; }
.pbar-name { font-size: 13px; font-weight: 600; }
.pbar-name small { display: block; font-weight: 400; color: var(--faint); font-size: 11px; }
.pbar-track { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.pbar-track > div { height: 100%; border-radius: 6px; background: var(--grad-a); }
.pbar-val { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---- Gear + service ---- */
.gear-block { border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.gear-row { display: flex; gap: 14px; align-items: center; }
.gear-info { min-width: 0; }
.gear-row .gear-dist { margin-left: auto; }
.svc-list { display: flex; flex-direction: column; gap: 9px; }
.svc-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.svc-rem { color: var(--muted); font-variant-numeric: tabular-nums; }
.svc-rem.warn { color: var(--coral); font-weight: 600; }
.svc-track { height: 7px; border-radius: 5px; background: var(--border); overflow: hidden; }
.svc-track > div { height: 100%; border-radius: 5px; background: var(--teal); }
.svc-track > div.warn { background: var(--coral); }

/* ---- Misc ---- */
.hint { font-weight: 400; font-size: 12px; color: var(--faint); letter-spacing: 0; text-transform: none; }
tr.clickable { cursor: pointer; }
.ftp-box .fu { font-size: 12px; color: var(--muted); }

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(21,24,42,.5); backdrop-filter: blur(4px); }
.modal-card { position: relative; z-index: 1; width: min(680px, 100%); max-height: 90vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; box-shadow: var(--shadow-lg); }
.modal-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 14px; }
.modal-x:hover { color: var(--ink); }
.modal-card h2 { font-family: var(--font-display); font-size: 22px; margin: 2px 0 0; }
.modal-stats { display: flex; flex-wrap: wrap; gap: 20px; margin: 16px 0 18px; }
.mstat { display: flex; flex-direction: column; }
.mstat .mv { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.mstat .ml { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-top: 2px; }
.modal-chart { width: 100%; height: 260px; display: block; }
.modal-msg { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 18px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hr-top { grid-template-columns: repeat(2, 1fr); }
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  #powerTop { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .kpis, .rec-grid, .hr-top, #powerTop { grid-template-columns: 1fr; }
  .refresh-label { display: none; }
  .wrap { padding: 8px 16px 64px; }
  .pbar-row { grid-template-columns: 1fr auto; }
  .pbar-track { grid-column: 1 / -1; }
}

/* ============================ Auth / account UI ============================ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 30px; box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 16px; margin-bottom: 18px; }
.auth-card h1 { font-family: var(--font-display); font-size: 26px; margin: 0; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); font-size: 14px; margin: 6px 0 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select { font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--coral); outline-offset: 1px; border-color: transparent; }
.btn-primary { width: 100%; font: inherit; font-weight: 700; font-size: 14px; color: #fff; background: var(--grad-a); border: 0; border-radius: 10px; padding: 12px; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(255,106,61,.6); transition: transform .15s; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; cursor: default; transform: none; }
.auth-msg { font-size: 13px; margin-top: 14px; min-height: 18px; color: var(--teal); }
.auth-msg.err { color: #D64545; }

/* user menu in topbar */
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px 5px 6px; cursor: pointer; }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--grad-a); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.user-drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 60; }
.user-drop.open { display: block; }
.user-drop a, .user-drop button { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 9px 12px; cursor: pointer; text-decoration: none; }
.user-drop a:hover, .user-drop button:hover { background: var(--surface-2); }
.user-drop .u-name { font-weight: 600; padding: 8px 12px 2px; }
.user-drop .u-mail { font-size: 11px; color: var(--faint); padding: 0 12px 8px; }
.user-drop .sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* settings / admin pages */
.page-wrap { max-width: 820px; margin: 0 auto; padding: 24px 24px 72px; }
.admin-wrap { max-width: 1080px; }
.page-wrap .panel { margin-top: 20px; }
.conn-row { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); margin-bottom: 12px; flex-wrap: wrap; }
.conn-info { display: flex; align-items: center; gap: 12px; }
.conn-logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; }
.conn-name { font-weight: 600; }
.conn-status { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge.on { background: rgba(23,192,184,.16); color: #0E9C93; }
.badge.off { background: var(--surface); color: var(--faint); border: 1px solid var(--border); }
.btn-outline { font: inherit; font-size: 13px; font-weight: 600; color: var(--coral); background: var(--surface); border: 1px solid rgba(255,106,61,.35); border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-outline.btn-danger { color: #D64545; border-color: rgba(214,69,69,.32); }
.role-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(108,92,231,.14); color: var(--violet); }
.role-pill.user { background: var(--surface-2); color: var(--muted); }
.st-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.st-pill.active { background: rgba(23,192,184,.16); color: #0E9C93; }
.st-pill.disabled { background: rgba(214,69,69,.12); color: #D64545; }
.copybox { display: flex; gap: 8px; margin-top: 12px; }
.copybox input { flex: 1; font: inherit; font-size: 12px; font-family: var(--font-mono); padding: 9px 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); color: var(--ink); }
.mini-btn { font: inherit; font-size: 12px; font-weight: 600; padding: 7px 11px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; color: var(--ink); }
.mini-btn:hover { background: var(--surface-2); }
.mini-btn.danger { color: #D64545; border-color: rgba(214,69,69,.3); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; }
.needs-connect { text-align: center; padding: 52px 24px; }
.needs-connect .nc-icon { font-size: 42px; }
.needs-connect h2 { font-family: var(--font-display); margin: 14px 0 6px; }
.needs-connect p { color: var(--muted); margin: 0 0 20px; }
.form-msg { font-size: 13px; margin-top: 10px; min-height: 16px; color: var(--teal); }
.form-msg.err { color: #D64545; }
.conn-config { margin-top: 8px; }
.conn-config > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--coral); padding: 6px 0; list-style: none; }
.conn-config > summary::-webkit-details-marker { display: none; }
.conn-config > summary::before { content: '⚙ '; }
.h-note code, .conn-status code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; color: var(--ink); }
.h-note a { color: var(--coral); }
