/* ============================================================
   Dashboard — premium futuristic dark theme
   ============================================================ */

:root {
  --bg-base: #07080c;
  --bg-canvas: #0b0d14;
  --surface-1: #11141d;
  --surface-2: #161a25;
  --surface-3: #1d2230;
  --border-soft: rgba(255, 255, 255, 0.06);
  --border-mid: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #e7eaf0;
  --text-secondary: #9aa3b2;
  --text-muted: #6c7383;

  --accent: #5eead4;          /* mint/cyan — primary accent */
  --accent-hot: #22d3ee;       /* hover */
  --accent-glow: rgba(94, 234, 212, 0.35);
  --accent-2: #a78bfa;         /* purple complement */

  --status-success: #34d399;
  --status-warning: #fbbf24;
  --status-danger: #f87171;
  --status-info: #60a5fa;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* ---- Base ---------------------------------------------------- */

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle dot grid backdrop */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: 0 0;
  pointer-events: none;
}

/* Soft accent glow blobs */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 800px 500px at 15% -10%, rgba(94, 234, 212, 0.08), transparent 60%),
    radial-gradient(ellipse 700px 400px at 95% 105%, rgba(167, 139, 250, 0.07), transparent 60%);
}

/* ---- Typography --------------------------------------------- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-weight: 600;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hot); }

code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

.text-muted, .small.text-muted { color: var(--text-muted) !important; }

/* ---- Brand mark --------------------------------------------- */

.site-nav {
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.85), rgba(10, 12, 18, 0.6));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  text-decoration: none;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 8px var(--accent-glow),
    0 0 18px var(--accent-glow),
    inset 0 0 4px rgba(255, 255, 255, 0.3);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.85); }
}

.brand-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.32em;
  color: var(--text-primary);
  background: linear-gradient(90deg, var(--text-primary) 0%, var(--accent) 50%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-chip {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}

/* ---- Buttons ------------------------------------------------ */

.btn {
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.18s ease;
}

.btn-primary,
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hot) 100%);
  border: none;
  color: #08151a;
  font-weight: 600;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover,
.btn-accent:hover {
  background: linear-gradient(135deg, var(--accent-hot) 0%, var(--accent) 100%);
  color: #08151a;
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border-color: var(--border-mid);
  color: var(--text-secondary);
  background: transparent;
}
.btn-outline-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(94, 234, 212, 0.05);
}

.btn-outline-danger {
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--status-danger);
}
.btn-outline-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: var(--status-danger);
  color: var(--status-danger);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  padding: 0.3rem 0.55rem;
}
.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(94, 234, 212, 0.05);
}

.btn-link.text-danger {
  color: var(--text-muted) !important;
  text-decoration: none;
}
.btn-link.text-danger:hover { color: var(--status-danger) !important; }

.btn-outline-success {
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--status-success);
}
.btn-outline-success:hover {
  background: rgba(52, 211, 153, 0.12);
  border-color: var(--status-success);
  color: var(--status-success);
}

/* ---- Cards -------------------------------------------------- */

.card {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 1px 3px rgba(0, 0, 0, 0.4);
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
  padding: 0.9rem 1.1rem;
}

.card-body { padding: 1.25rem; }

/* Project card — premium hover */
.project-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  border-top: 1px solid var(--border-soft) !important;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-accent, var(--accent));
  opacity: 0.6;
  transition: opacity 0.2s ease, height 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-mid) !important;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px var(--card-accent, var(--accent-glow));
}
.project-card:hover::before {
  opacity: 1;
  height: 3px;
}

.card-title a { color: var(--text-primary); }
.card-title a:hover { color: var(--accent); }

/* Project hero — large card on detail page */
.project-hero {
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--card-accent, var(--accent)) !important;
}
.project-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 200px;
  background: linear-gradient(90deg, var(--card-accent, var(--accent)), transparent);
  opacity: 0.04;
  pointer-events: none;
}

/* ---- Lists -------------------------------------------------- */

.list-group {
  background: transparent;
  border-radius: 0;
}

.list-group-item {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--text-primary);
  padding: 0.85rem 1.1rem;
}

.list-group-flush > .list-group-item:last-child { border-bottom: 0; }

.list-group-item code {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  color: var(--accent);
}

/* ---- Badges ------------------------------------------------- */

.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.34em 0.7em;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid transparent;
}

/* Re-skin Bootstrap status colors with subtle tinted backgrounds */
.text-bg-primary    { background: rgba(96, 165, 250, 0.14) !important; color: var(--status-info) !important; border-color: rgba(96, 165, 250, 0.3); }
.text-bg-success    { background: rgba(52, 211, 153, 0.14) !important; color: var(--status-success) !important; border-color: rgba(52, 211, 153, 0.3); }
.text-bg-info       { background: rgba(94, 234, 212, 0.14) !important; color: var(--accent) !important; border-color: rgba(94, 234, 212, 0.3); }
.text-bg-warning    { background: rgba(251, 191, 36, 0.14) !important; color: var(--status-warning) !important; border-color: rgba(251, 191, 36, 0.3); }
.text-bg-danger     { background: rgba(248, 113, 113, 0.14) !important; color: var(--status-danger) !important; border-color: rgba(248, 113, 113, 0.3); }
.text-bg-secondary  { background: rgba(154, 163, 178, 0.12) !important; color: var(--text-secondary) !important; border-color: rgba(154, 163, 178, 0.25); }
.text-bg-dark       { background: rgba(255, 255, 255, 0.05) !important; color: var(--text-secondary) !important; border-color: var(--border-mid); }
.text-bg-light      { background: rgba(255, 255, 255, 0.05) !important; color: var(--text-secondary) !important; border-color: var(--border-soft); }

/* ---- Forms -------------------------------------------------- */

.form-control,
.form-select {
  background: var(--surface-1);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus,
.form-select:focus {
  background: var(--surface-1);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.15);
}
.form-control::placeholder { color: var(--text-muted); }

.form-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.form-control-color {
  height: 38px;
  cursor: pointer;
}

/* ---- Breadcrumb --------------------------------------------- */

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
}
.breadcrumb-item, .breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: var(--text-secondary); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ---- Alerts ------------------------------------------------- */

.alert {
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.alert-success { border-left-color: var(--status-success); }
.alert-info    { border-left-color: var(--status-info); }
.alert-warning { border-left-color: var(--status-warning); }
.alert-danger  { border-left-color: var(--status-danger); }

/* ---- Footer ------------------------------------------------- */

.site-footer {
  color: var(--text-muted);
  border-top: 1px solid var(--border-soft);
  margin-top: 3rem;
}
.footer-mark {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.32em;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---- Misc fine-tuning -------------------------------------- */

hr { border-color: var(--border-soft); }

::selection {
  background: var(--accent-glow);
  color: #08151a;
}

/* Webkit scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 10px;
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Strikethrough done items */
.text-decoration-line-through { color: var(--text-muted) !important; }

/* ---- Status dot (pulsing live indicator) ------------------- */

.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
}
.status-dot.live { background: var(--status-success); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); animation: dot-pulse 2s infinite; }
.status-dot.warn { background: var(--status-warning); }
.status-dot.idle { background: var(--text-muted); }
.status-dot.done { background: var(--text-muted); opacity: 0.5; }

@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---- Progress bar on project cards ------------------------- */

.progress-row {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--card-accent, var(--accent)), var(--accent-2));
  border-radius: 2px;
  transition: width 0.4s ease;
}
.progress-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 38px;
  text-align: right;
}

/* ---- Empty states ------------------------------------------ */

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 2.4rem;
  color: var(--surface-3);
  display: block;
  margin-bottom: 0.7rem;
}
.empty-state .empty-title {
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.empty-state .empty-hint { font-size: 0.85rem; }

/* ---- Page-load fade-in stagger ----------------------------- */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fade-up 0.45s ease both;
}
.stagger > * { animation: fade-up 0.45s ease both; opacity: 0; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.10s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(n+8) { animation-delay: 0.30s; }

/* ---- Cmd+K trigger button --------------------------------- */

.cmdk-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
}
.cmdk-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(94, 234, 212, 0.05);
}
.cmdk-kbd {
  margin-left: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--border-soft);
}

/* ---- Cmd+K overlay + palette ------------------------------ */

.cmdk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1080;
  display: none;
  padding-top: 14vh;
  justify-content: center;
  align-items: flex-start;
}
.cmdk-overlay.open {
  display: flex;
  animation: fade-up 0.18s ease both;
}

.cmdk-panel {
  width: min(640px, 92vw);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--border-soft),
    0 0 80px rgba(94, 234, 212, 0.06);
  overflow: hidden;
}

.cmdk-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
}
.cmdk-search-icon { color: var(--text-muted); font-size: 1.05rem; }
#cmdk-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
}
#cmdk-input::placeholder { color: var(--text-muted); }
.cmdk-esc {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
}

.cmdk-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.4rem;
}
.cmdk-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: left;
  font-size: 0.92rem;
  cursor: pointer;
}
.cmdk-item.active {
  background: rgba(94, 234, 212, 0.08);
  color: var(--text-primary);
}
.cmdk-item .cmdk-icon { color: var(--text-muted); font-size: 0.95rem; }
.cmdk-item.active .cmdk-icon { color: var(--accent); }
.cmdk-item .cmdk-title { flex: 1; }
.cmdk-item .cmdk-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.cmdk-item .cmdk-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cmdk-item mark {
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-weight: 600;
}

.cmdk-foot {
  border-top: 1px solid var(--border-soft);
  padding: 0.5rem 0.95rem;
  display: flex;
  gap: 1.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cmdk-foot kbd {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
  margin-right: 0.25rem;
}

/* ---- Navbar pill links ------------------------------------- */

.nav-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.15s ease;
}
.nav-link-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(94, 234, 212, 0.05);
}

/* ---- Toast notifications ----------------------------------- */

#toast-host {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
  max-width: 420px;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border-mid);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px var(--border-soft);
  min-width: 280px;
  opacity: 0;
  transform: translateX(120%);
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast-item.show { opacity: 1; transform: translateX(0); }
.toast-item.hide { opacity: 0; transform: translateX(20%); }

.toast-icon { font-size: 1.05rem; line-height: 1.4; flex-shrink: 0; }
.toast-msg  { flex: 1; font-size: 0.92rem; line-height: 1.4; }
.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0 0 0.5rem;
  cursor: pointer;
}
.toast-close:hover { color: var(--text-primary); }

.toast-success { border-left-color: var(--status-success); }
.toast-success .toast-icon { color: var(--status-success); }
.toast-info    { border-left-color: var(--status-info); }
.toast-info    .toast-icon { color: var(--status-info); }
.toast-warning { border-left-color: var(--status-warning); }
.toast-warning .toast-icon { color: var(--status-warning); }
.toast-danger  { border-left-color: var(--status-danger); }
.toast-danger  .toast-icon { color: var(--status-danger); }

/* ---- Activity timeline ------------------------------------- */

.timeline {
  position: relative;
  padding-left: 0;
}

.timeline-day {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.timeline-day:last-child { border-bottom: none; }

.timeline-day-label {
  padding-top: 0.4rem;
  position: sticky;
  top: 1rem;
  align-self: start;
  text-align: right;
}
.timeline-day-label .day-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  line-height: 1;
}
.timeline-day-label .day-month {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--accent);
  display: block;
  margin-top: 0.2rem;
}
.timeline-day-label .day-rel {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.timeline-day-items {
  position: relative;
  padding-left: 1.2rem;
}
.timeline-day-items::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(180deg, var(--border-mid), var(--border-soft));
}

.timeline-event {
  position: relative;
  margin-bottom: 0.7rem;
}
.timeline-event:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -1.2rem;
  top: 0.85rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg-base);
  box-shadow: 0 0 0 1px var(--border-mid);
}

.timeline-card {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  transition: border-color 0.15s ease;
}
.timeline-card:hover { border-color: var(--border-mid); }

.timeline-title { font-weight: 500; }
.timeline-body  { color: var(--text-secondary); }
.timeline-project {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.timeline-project:hover { color: var(--accent); }

@media (max-width: 575px) {
  .timeline-day { grid-template-columns: 60px 1fr; gap: 1rem; }
  .timeline-day-label .day-num { font-size: 1.2rem; }
  .timeline-day-label .day-rel { display: none; }
}

/* ---- Markdown rendered content ----------------------------- */

.md-body { color: var(--text-secondary); }
.md-body p { margin-bottom: 0.5rem; }
.md-body p:last-child { margin-bottom: 0; }
.md-body ul, .md-body ol { padding-left: 1.3rem; margin-bottom: 0.5rem; }
.md-body code {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
}
.md-body pre {
  background: var(--bg-base);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  font-size: 0.82rem;
}
.md-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-primary);
}
.md-body a { color: var(--accent); }
.md-body strong { color: var(--text-primary); }
.md-body table {
  border-collapse: collapse;
  margin-bottom: 0.5rem;
}
.md-body th, .md-body td {
  border: 1px solid var(--border-soft);
  padding: 0.3rem 0.55rem;
}
.md-body th { background: rgba(255, 255, 255, 0.03); font-weight: 500; }

/* ---- Stats grid -------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.05rem;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 30%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.5;
}
.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.2rem;
  line-height: 1.1;
}
.stat-value-rel { font-size: 1.15rem; }
.stat-hint { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.15rem; }

/* ---- Filter chips ------------------------------------------ */

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.83rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.15s ease;
}
.chip:hover {
  border-color: var(--border-mid);
  color: var(--text-primary);
}
.chip.active {
  background: rgba(94, 234, 212, 0.10);
  border-color: var(--accent);
  color: var(--accent);
}
.chip-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  color: inherit;
}
.chip.active .chip-count { background: rgba(94, 234, 212, 0.15); }

/* ---- Pin badge + health pulse + github sparkline ----------- */

.project-card { position: relative; }
.project-card.is-pinned::after {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.pin-form {
  position: absolute;
  top: 6px;
  right: 8px;
  margin: 0;
  z-index: 2;
}
.pin-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
}
.project-card:hover .pin-btn { opacity: 0.8; }
.pin-btn:hover { color: var(--accent); background: rgba(94, 234, 212, 0.08); opacity: 1; }
.is-pinned .pin-btn { color: var(--accent); opacity: 1; }
.is-pinned::after { display: none; }

.health-pulse {
  position: absolute;
  top: 12px;
  right: 38px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  z-index: 2;
}
.health-pulse.checking {
  background: var(--text-muted);
  animation: pulse-soft 1s infinite;
}
.health-pulse.up {
  background: var(--status-success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: dot-pulse 2.4s infinite;
}
.health-pulse.down {
  background: var(--status-danger);
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.5);
  animation: dot-pulse 1.4s infinite;
}
@keyframes pulse-soft {
  50% { opacity: 0.4; }
}

.github-row { font-size: 0.78rem; color: var(--text-muted); }
.gh-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.gh-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
}
.gh-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}
.gh-suffix { color: var(--text-muted); font-size: 0.7rem; }

.spark {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 18px;
}
.spark-bar {
  width: 4px;
  background: var(--text-muted);
  border-radius: 1px;
  opacity: 0.3;
}
.spark-bar.has {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.85;
}

/* ---- Overdue / due-soon highlighting ----------------------- */

.list-group-item.is-overdue {
  border-left: 3px solid var(--status-danger);
  background: rgba(248, 113, 113, 0.04);
}
.list-group-item.is-duesoon {
  border-left: 3px solid var(--status-warning);
  background: rgba(251, 191, 36, 0.03);
}

/* ---- Audit icon ------------------------------------------- */

.audit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 1px solid;
}

/* ---- Calendar grid ---------------------------------------- */

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cal-head {
  background: var(--surface-2);
  text-align: center;
  padding: 0.55rem 0;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cal-cell {
  background: var(--surface-1);
  min-height: 110px;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cal-cell.is-past { opacity: 0.55; }
.cal-cell.is-today {
  background: rgba(94, 234, 212, 0.04);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cal-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.cal-cell.is-today .cal-date { color: var(--accent); font-weight: 600; }
.cal-month {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cal-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--card-accent, var(--accent));
  font-size: 0.74rem;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.cal-item-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-item-text { overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 768px) {
  .cal-cell { min-height: 60px; padding: 0.3rem; }
  .cal-item-text { display: none; }
}

/* ---- Keyboard shortcuts modal ----------------------------- */

.kbd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1080;
  display: none;
  justify-content: center;
  align-items: center;
}
.kbd-overlay.open {
  display: flex;
  animation: fade-up 0.18s ease both;
}
.kbd-panel {
  width: min(520px, 92vw);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.kbd-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
}
.kbd-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.kbd-close:hover { color: var(--text-primary); }
.kbd-body { padding: 1rem 1.1rem; }
.kbd-section { margin-bottom: 1rem; }
.kbd-section:last-child { margin-bottom: 0; }
.kbd-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.kbd-row {
  display: flex;
  justify-content: space-between;
  padding: 0.32rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.kbd-row kbd {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-right: 0.25rem;
}
