/* Kunai/ZOE Snapshot Dashboard — dark, Web3-ish aesthetic
   matching the KunaiKash palette (#e100ff magenta/purple accent). */

:root {
  --bg:         #0b0a10;
  --bg-card:    #141421;
  --bg-card-2:  #1a1927;
  --bg-inset:   #0f0e18;
  --line:       #2a2840;
  --line-soft:  #1f1d30;
  --fg:         #eaeaf5;
  --fg-muted:   #8e8ba8;
  --fg-dim:     #5d5a78;
  --accent:     #e100ff;
  --accent-2:   #9a07ad;
  --accent-soft:rgba(225, 0, 255, 0.14);
  --green:      #21d07a;
  --green-soft: rgba(33, 208, 122, 0.14);
  --amber:      #f4b740;
  --amber-soft: rgba(244, 183, 64, 0.14);
  --red:        #ff4f6a;
  --red-soft:   rgba(255, 79, 106, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-feature-settings: 'cv11';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

/* background grid (subtle) */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1200px 600px at 20% -10%, rgba(225,0,255,0.08), transparent 60%),
    radial-gradient(900px 500px at 120% 20%, rgba(154,7,173,0.08), transparent 55%),
    linear-gradient(transparent 95%, rgba(225,0,255,0.04) 95%),
    linear-gradient(90deg, transparent 95%, rgba(225,0,255,0.04) 95%);
  background-size: auto, auto, 32px 32px, 32px 32px;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px;
  position: relative;
  z-index: 1;
}

/* ---- header ---- */
header > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff6be6, var(--accent) 45%, var(--accent-2) 90%);
  box-shadow: 0 0 18px 4px rgba(225,0,255,0.45);
}
.brand h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}
.today {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 13px;
}
.today .label { color: var(--fg-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.today .value { color: var(--fg); font-weight: 500; margin-top: 2px; }

/* ---- cards ---- */
main.wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 16px;
  padding-bottom: 64px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px -20px rgba(0,0,0,0.7);
}

/* ---- token card ---- */
.token-card .token-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(225,0,255,0.06), rgba(225,0,255,0) 80%);
}
.token-title {
  display: flex; align-items: baseline; gap: 16px;
}
.token-title h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #ffb1fa, var(--accent) 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.month-badge {
  color: var(--fg-muted);
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.token-meta {
  display: flex; align-items: center; gap: 20px;
}
.stat {
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1;
}
.stat-value {
  font-size: 24px; font-weight: 700;
  color: var(--fg);
}
.stat-label {
  font-size: 11px; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 6px;
}
.status-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}
.status-pill.done     { color: var(--green); background: var(--green-soft); border-color: rgba(33,208,122,0.3); }
.status-pill.progress { color: var(--amber); background: var(--amber-soft); border-color: rgba(244,183,64,0.3); }
.status-pill.pending  { color: var(--fg-muted); background: var(--line-soft); border-color: var(--line); }

.sheet-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  background: var(--accent-soft);
  color: #ffa6f9;
  border: 1px solid rgba(225,0,255,0.3);
  transition: background 0.15s, transform 0.15s;
}
.sheet-link:hover { background: rgba(225,0,255,0.24); transform: translateY(-1px); }
.sheet-link .arrow { font-size: 11px; }

/* ---- body grid ---- */
.token-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.panel {
  padding: 20px 24px;
}
.token-body .panel + .panel {
  border-left: 1px solid var(--line);
}
.panel h3 {
  margin: 0 0 14px 0;
  font-size: 12px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.panel-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 20px 24px 0;
}
.panel-header h3 { margin-bottom: 0; }

.muted { color: var(--fg-muted); font-size: 13px; }
.muted:hover { color: var(--fg); }

/* ---- date list ---- */
.date-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.date-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-inset);
  font-size: 14px;
}
.date-item.done {
  border-color: rgba(33,208,122,0.3);
  background: linear-gradient(90deg, var(--green-soft), transparent 50%);
}
.date-item.today {
  border-color: rgba(225,0,255,0.5);
  background: linear-gradient(90deg, var(--accent-soft), transparent 50%);
  animation: pulse 2.2s ease-in-out infinite;
}
.date-item.missed {
  border-color: rgba(255,79,106,0.35);
  background: linear-gradient(90deg, var(--red-soft), transparent 50%);
}
.date-item.future { opacity: 0.75; }
.date-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--fg-dim);
}
.date-item.done .date-dot    { background: var(--green); box-shadow: 0 0 8px var(--green); }
.date-item.today .date-dot   { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.date-item.missed .date-dot  { background: var(--red); box-shadow: 0 0 8px var(--red); }
.date-iso { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.date-detail { color: var(--fg-muted); font-size: 12px; }
.date-item.missed .date-detail { color: var(--red); font-weight: 600; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225,0,255,0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(225,0,255,0); }
}

/* ---- calendar ---- */
.calendar { user-select: none; }
.cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 10px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  padding: 0 2px;
}
.cal-head span { text-align: center; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg-inset);
  border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--fg-muted);
  position: relative;
  transition: transform 0.12s;
}
.cal-cell .day-num { line-height: 1; }
.cal-cell.outside { opacity: 0.25; }
.cal-cell.scheduled {
  border-color: rgba(225,0,255,0.45);
  color: var(--fg);
  background: linear-gradient(135deg, rgba(225,0,255,0.16), transparent 70%);
}
.cal-cell.completed {
  background: linear-gradient(135deg, rgba(33,208,122,0.22), transparent 70%);
  border-color: rgba(33,208,122,0.45);
  color: var(--fg);
}
.cal-cell.completed.scheduled {
  background: linear-gradient(135deg, rgba(33,208,122,0.24), rgba(225,0,255,0.14));
}
.cal-cell.today {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  color: var(--fg);
  font-weight: 700;
}
/* If today is ALSO completed, completed wins (green) — today no longer
   dominates the visual. Bold day number still hints it's today. */
.cal-cell.today.completed {
  outline: none;
}
.cal-cell .marker {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
  position: absolute; bottom: 6px;
  box-shadow: 0 0 6px var(--accent);
}
.cal-cell.completed .marker { background: var(--green); box-shadow: 0 0 6px var(--green); }

.cal-legend {
  margin-top: 12px;
  display: flex; gap: 14px;
  font-size: 11px; color: var(--fg-dim);
}
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.lg-dot.scheduled { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.lg-dot.completed { background: var(--green); box-shadow: 0 0 6px var(--green); }
.lg-dot.today     { background: transparent; border: 1px solid var(--accent); }

/* ---- history table ---- */
.history { border-top: 1px solid var(--line); }
.history table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.history th, .history td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.history th {
  color: var(--fg-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.history tr:last-child td { border-bottom: none; }
.history .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--fg-muted); }
.history a { color: #ffa6f9; text-decoration: none; }
.history a:hover { text-decoration: underline; }
.mini-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.mini-pill.done    { color: var(--green); background: var(--green-soft); }
.mini-pill.partial { color: var(--amber); background: var(--amber-soft); }

/* ---- log ---- */
.log {
  margin: 12px 24px 20px;
  padding: 14px 16px;
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--fg-muted);
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.foot {
  color: var(--fg-dim);
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
}
.foot .sep { margin: 0 10px; opacity: 0.5; }
.foot code {
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ---- responsive ---- */
@media (max-width: 820px) {
  .wrap { padding: 20px 18px; }
  header > .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  .today { align-items: flex-start; }
  .token-header { flex-direction: column; align-items: flex-start; }
  .token-body { grid-template-columns: 1fr; }
  .token-body .panel + .panel { border-left: none; border-top: 1px solid var(--line); }
  .token-meta { flex-wrap: wrap; gap: 12px; }
}
