:root {
  --bg: #0b0f14;
  --bg-elev: #111823;
  --panel: #131b26;
  --panel-2: #0f1620;
  --border: #1e2836;
  --border-strong: #2a394c;
  --text: #e7edf5;
  --muted: #93a2b7;
  --faint: #5f6f84;
  --emerald: #34d399;
  --emerald-dim: rgba(52, 211, 153, 0.16);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.16);
  --indigo: #818cf8;
  --indigo-dim: rgba(129, 140, 248, 0.16);
  --sky: #38bdf8;
  --sky-dim: rgba(56, 189, 248, 0.16);
  --red: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(52, 211, 153, 0.08), transparent 60%),
    radial-gradient(1100px 700px at 100% 0%, rgba(129, 140, 248, 0.08), transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Splash ---------- */
.splash {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}
.splash__mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: conic-gradient(from 180deg, var(--emerald), var(--indigo), var(--emerald));
  animation: spin 1.4s linear infinite;
  -webkit-mask: radial-gradient(circle 12px at center, transparent 98%, #000);
  mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Auth ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  padding: 24px;
}
.auth__card {
  width: min(420px, 92vw);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 34px 30px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth__badge {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: grid;
  place-content: center;
  color: var(--emerald);
  background: var(--emerald-dim);
  border: 1px solid rgba(52, 211, 153, 0.28);
}
.auth__card h1 {
  margin: 0 0 6px;
  font-size: 25px;
  letter-spacing: -0.02em;
}
.auth__sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.auth__form {
  display: grid;
  gap: 0;
  text-align: left;
}
.field {
  display: grid;
  gap: 7px;
}
.field__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}
.field input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-dim);
}
.auth__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}
.auth__link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  padding: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  justify-self: center;
}
.auth__link:hover {
  color: var(--text);
}
.auth__status {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.auth__status.is-error {
  color: var(--red);
}
.auth__status.is-ok {
  color: var(--emerald);
}
.auth__note {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-dim);
  color: #f4d58a;
  font-size: 13px;
}
.auth__footer {
  color: var(--faint);
  font-size: 12.5px;
}

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elev);
  transition: transform 0.05s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn--primary {
  background: linear-gradient(180deg, #3ee0a4, #22b988);
  color: #04150e;
  box-shadow: 0 6px 18px rgba(52, 211, 153, 0.25);
}
.btn--primary:hover:not(:disabled) {
  filter: brightness(1.05);
}
.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover:not(:disabled) {
  border-color: var(--emerald);
  color: var(--emerald);
}
.btn--soft {
  background: var(--emerald-dim);
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.24);
}
.btn--soft:hover:not(:disabled) {
  background: rgba(52, 211, 153, 0.24);
}
.btn--full {
  width: 100%;
}
.btn--sm {
  padding: 7px 11px;
  font-size: 13px;
}

/* ---------- Topbar ---------- */
.dash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 34px);
  background: rgba(11, 15, 20, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: conic-gradient(from 160deg, var(--emerald), var(--indigo), var(--sky), var(--emerald));
}
.brand__name {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand__tag {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.clock {
  text-align: right;
  line-height: 1.15;
}
.clock__time {
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 16px;
}
.clock__date {
  font-size: 11.5px;
  color: var(--faint);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--emerald-dim);
  color: var(--emerald);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(52, 211, 153, 0.22);
}
.pill.is-stale {
  background: var(--amber-dim);
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.22);
}
.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: ping 2s ease-out infinite;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
  }
}
.user {
  display: flex;
  align-items: center;
  gap: 9px;
}
.user__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #04150e;
  background: linear-gradient(180deg, #3ee0a4, #22b988);
}
.user__name {
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- Dashboard body ---------- */
.dash__main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px) clamp(16px, 4vw, 34px) 40px;
  flex: 1;
}
.dash__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash__head h1 {
  margin: 0;
  font-size: clamp(22px, 3.5vw, 30px);
  letter-spacing: -0.02em;
}
.dash__date {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.dash__head-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.daynav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.daynav__btn {
  min-width: 72px;
}
.daynav__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.daynav__label:hover {
  border-color: var(--emerald);
  background: rgba(52, 211, 153, 0.06);
}
.daynav__label .dash__date {
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
}
.daynav__badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--emerald-dim);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.22);
}
.daynav__picker {
  /* Off-screen but present so showPicker()/click works without covering Prev/Next. */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.empty-state {
  color: var(--faint) !important;
  font-size: 13px;
  font-weight: 500 !important;
  padding: 12px 4px !important;
  border: none !important;
  background: transparent !important;
  justify-content: center !important;
  text-align: center;
  list-style: none;
  display: block !important;
  grid-template-columns: none !important;
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.banner--error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 20px);
}

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 260px;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.card__title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card__title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.card__icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-content: center;
  font-size: 15px;
}
.icon--emerald {
  background: var(--emerald-dim);
  color: var(--emerald);
}
.icon--amber {
  background: var(--amber-dim);
  color: var(--amber);
}
.icon--indigo {
  background: var(--indigo-dim);
  color: var(--indigo);
}
.icon--sky {
  background: var(--sky-dim);
  color: var(--sky);
}
.card__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.card__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--faint);
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.metric__value {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.metric__unit {
  font-size: 13px;
  color: var(--muted);
}

.trend {
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.trend.is-up {
  color: var(--emerald);
  background: var(--emerald-dim);
  border-color: rgba(52, 211, 153, 0.22);
}
.trend.is-down {
  color: var(--red);
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.24);
}
.chip {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.chip--amber {
  color: var(--amber);
  background: var(--amber-dim);
  border-color: rgba(251, 191, 36, 0.22);
}
.chip--sky {
  color: var(--sky);
  background: var(--sky-dim);
  border-color: rgba(56, 189, 248, 0.22);
}

/* small flag / tag pills (DSG, VIP, PTO, all-day) */
.flag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-elev);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.flag--vip {
  color: #f5d76e;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.28);
}
.flag--dsg {
  color: var(--sky);
  background: var(--sky-dim);
  border-color: rgba(56, 189, 248, 0.28);
}
.flag--pto {
  color: var(--indigo);
  background: var(--indigo-dim);
  border-color: rgba(129, 140, 248, 0.28);
}

/* progress */
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #22b988, #3ee0a4);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* project bars */
.bars {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.bars li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  font-size: 13px;
}
.bars .bar__name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bars .bar__val {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
}
.bars .bar__track {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.bars .bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--indigo);
  opacity: 0.85;
}

/* pending list */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  flex: 1;
}
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.list .li__main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.list .li__title {
  font-size: 13.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list .li__sub {
  font-size: 11.5px;
  color: var(--faint);
}
.list .li__val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--amber);
  font-size: 13.5px;
  white-space: nowrap;
}

/* calendar */
.next {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--indigo-dim);
  border: 1px solid rgba(129, 140, 248, 0.24);
}
.next__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--indigo);
}
.next__text {
  font-size: 14.5px;
  font-weight: 600;
}
.agenda {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  flex: 1;
}
.agenda li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.agenda li:last-child {
  border-bottom: none;
}
.ev__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
}
.ev--upcoming .ev__dot {
  background: var(--indigo);
}
.ev--current .ev__dot {
  background: var(--emerald);
  animation: ping 1.8s ease-out infinite;
}
.ev--past {
  opacity: 0.5;
}
.ev__body {
  min-width: 0;
}
.ev__title {
  font-size: 13.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev__meta {
  font-size: 11.5px;
  color: var(--faint);
}
.ev__time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

/* inbox / activity feed */
.counts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.count {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.count__num {
  display: block;
  font-size: 20px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.count__label {
  font-size: 11px;
  color: var(--faint);
}
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}
.feed li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 11px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border);
}
.feed li:last-child {
  border-bottom: none;
}
.feed__icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-content: center;
  font-size: 13px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.feed__body {
  min-width: 0;
}
.feed__title {
  font-size: 13.5px;
  font-weight: 550;
  display: flex;
  align-items: center;
  gap: 7px;
}
.feed__title .unread {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sky);
  flex: none;
}
.feed__detail {
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed__time {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}

/* footer */
.dash__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.src-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--amber-dim);
  color: var(--amber);
}
.src-badge[data-source="live"] {
  background: var(--emerald-dim);
  color: var(--emerald);
}
.src-badge[data-source="partial"] {
  background: var(--amber-dim);
  color: var(--amber);
}
.src-badge[data-source="mock"] {
  background: var(--amber-dim);
  color: var(--amber);
}

/* skeleton */
.skeleton-text {
  color: transparent !important;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--border-strong) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
[aria-busy="false"] .skeleton-text {
  color: inherit !important;
  background: none;
  animation: none;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .clock {
    display: none;
  }
  .user__name {
    display: none;
  }
  .card {
    min-height: 0;
  }
  .dash__head {
    flex-direction: column;
    align-items: flex-start;
  }
  .daynav {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}