:root {
  --bg: #0b1020;
  --bg2: #10182c;
  --panel: #111a2e;
  --panel2: #0d1527;
  --line: #24304a;
  --text: #ecf2ff;
  --muted: #94a4c7;
  --blue: #5b8cff;
  --blue2: #82a3ff;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --shadow: 0 18px 50px rgba(0, 0, 0, .34);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #22345c 0%, #14203b 36%, var(--bg) 68%);
  color: var(--text);
}
button, input, select { font: inherit; }
.app-shell { max-width: 1480px; margin: 0 auto; padding: 18px; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px;
}
h1 { margin: 0; font-size: 2rem; }
.topbar p { margin: 6px 0 0; color: var(--muted); max-width: 760px; line-height: 1.4; }
.topbar-actions { display: flex; gap: 10px; }
.header-actions { display: flex; gap: 8px; }
.push-right { margin-left: auto; }
.primary-btn, .ghost-btn, .text-btn {
  border-radius: 12px; padding: 11px 14px; cursor: pointer;
}
.primary-btn {
  border: 0; color: white; background: linear-gradient(135deg, var(--blue), var(--blue2)); font-weight: 800;
}
.ghost-btn {
  color: var(--text); background: rgba(255,255,255,.03); border: 1px solid var(--line); font-weight: 700;
}
.ghost-btn.danger { border-color: #7a3440; color: #fecdd3; }
.ghost-btn.small { padding: 8px 10px; font-size: .9rem; }
.text-btn { background: transparent; border: 0; color: var(--muted); }
.dashboard-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px;
}
.card {
  background: linear-gradient(180deg, #18243d, #101a2d);
  border: 1px solid #31456d; border-radius: 22px; box-shadow: var(--shadow); padding: 16px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px;
}
.card-header.slim { align-items: center; margin-bottom: 10px; }
.card-header.slim h3 { margin: 0; }
.card-header h2, .card h2 { margin: 0; font-size: 1.1rem; }
.card-header span, .card span, .card p { color: var(--muted); }
.week-card { grid-column: 1 / 2; }
.due-today-priority { grid-column: 1 / 2; }
.side-column { grid-column: 2 / 3; grid-row: 1 / span 3; }
.list-card { min-height: 280px; }
.wide { grid-column: 1 / span 2; }
.week-strip {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px;
}
.day-pill {
  padding: 10px; border-radius: 16px; background: #203153; border: 1px solid #42609a; min-height: 108px;
  cursor: pointer; transition: transform .12s ease, border-color .12s ease;
}
.day-pill:hover { transform: translateY(-1px); border-color: #37508a; }
.day-pill.active { border-color: var(--blue); outline: 1px solid rgba(91,140,255,.32); }
.day-pill h3 { margin: 0 0 8px; font-size: .95rem; color: #f6f9ff; }
.event-chip {
  display: block; font-size: .72rem; font-weight: 700; margin-top: 5px; padding: 6px 7px; border-radius: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f8fbff;
}
.color-a { background: #183462; }
.color-b { background: #4c1d95; }
.color-c { background: #14532d; }
.color-d { background: #6b3f12; }
.color-e { background: #44263d; }
.task-list { display: grid; gap: 10px; }
.task-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border-radius: 16px; background: #15233d; border: 1px solid #33486f;
}
.task-card-inner { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; }
.task-actions { display:flex; gap:8px; flex-wrap:wrap; }
.icon-btn { background:#203153; border:1px solid #42609a; color:#f8fbff; border-radius:10px; padding:6px 8px; cursor:pointer; font-size:.78rem; }
.icon-btn.danger { border-color:#8b3c4a; color:#fecdd3; }
.task-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.task-check {
  width: 22px; height: 22px; border-radius: 999px; border: 2px solid #51658f; display: inline-block; flex: 0 0 auto;
}
.task-card.done { opacity: .58; }
.task-card.done .task-check { background: var(--green); border-color: var(--green); }
.task-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800;
  background: #182540; color: #dce6ff; border: 1px solid #2b3c62;
}
.badge.follow { background: #3f3214; color: #fde68a; border-color: #674d14; }
.badge.done { background: #16351f; color: #bbf7d0; border-color: #216734; }
.task-card.follow { border-left: 4px solid var(--yellow); }
.task-card.urgent { border-left: 4px solid var(--red); }
.bucket-list, .flow-pills { display: grid; gap: 10px; }
.bucket-list div {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line);
}
.bucket-list div:first-child { border-top: 0; padding-top: 0; }
.side-subhead { margin-top: 18px !important; }
.flow-pills { margin-top: 10px; }
.pill {
  display: inline-flex; width: fit-content; padding: 8px 11px; border-radius: 999px; font-size: .8rem; font-weight: 800;
}
.pill-due { background: #2d1c1d; color: #fecaca; }
.pill-done { background: #173320; color: #bbf7d0; }
.pill-follow { background: #3f3214; color: #fde68a; }
.bottom-grid, .project-grid {
  display: grid; gap: 16px;
}
.bottom-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bottom-grid h3 { margin: 0 0 10px; font-size: 1rem; }
.task-list.compact .task-card { padding: 10px 12px; }
.project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-tile {
  padding: 16px; border-radius: 18px; border: 1px solid #466296;
  background: linear-gradient(135deg, #243a68, #15233d);
}
.project-tile h3 { margin: 0 0 8px; }
.project-tile p { margin: 0; color: var(--muted); line-height: 1.35; }
.project-tile button { margin-top: 12px; }
.modal {
  border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, var(--panel), var(--panel2));
  color: var(--text); width: min(92vw, 420px); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(0, 0, 0, .58); }
.modal-body { display: grid; gap: 12px; padding: 20px; }
.modal-body h3 { margin: 0; }
.modal-body p { margin: 0; color: var(--muted); }
.modal-body label { display: grid; gap: 6px; font-weight: 700; }
.modal-body input, .modal-body select {
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #0d1424; color: var(--text);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-actions.stacked { display: grid; }
.day-events { display: grid; gap: 10px; margin-top: 8px; }
.day-event {
  padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.day-event-row { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.day-event-main { min-width:0; }
.day-event-main strong { display:block; margin-bottom:4px; }
.voice-note {
  margin-top: 8px; font-size: .9rem; color: var(--muted);
}
.hidden { display: none !important; }
.project-detail { display: grid; gap: 16px; }
.project-detail-topbar { display: flex; align-items: center; gap: 14px; }
.project-detail-topbar h2 { margin: 0; }
.project-detail-topbar p { margin: 4px 0 0; color: var(--muted); }
.project-hero { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.project-kicker { color: #a8c0ff; font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.project-hero h3 { margin: 6px 0 8px; font-size: 1.5rem; }
.project-hero p { max-width: 700px; }
.project-hero-meta { display: grid; gap: 10px; min-width: 240px; }
.project-hero-meta div { background: #15233d; border: 1px solid #33486f; border-radius: 16px; padding: 12px; }
.project-hero-meta span { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 5px; }
.project-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab-btn { border: 1px solid #33486f; background: #15233d; color: var(--text); border-radius: 12px; padding: 10px 13px; font-weight: 800; cursor: pointer; }
.tab-btn.active { background: linear-gradient(135deg, var(--blue), var(--blue2)); border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.project-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.milestone-list, .summary-list { display: grid; gap: 10px; }
.milestone, .summary-item { padding: 12px; border-radius: 14px; background: #15233d; border: 1px solid #33486f; }
.project-notes { min-height: 220px; width: 100%; background: #15233d; color: var(--text); border: 1px solid #33486f; border-radius: 14px; padding: 14px; resize: vertical; }
.file-placeholder { padding: 18px; border-radius: 14px; border: 1px dashed #4e6ea8; color: #cfe0ff; background: #15233d; }
@media (max-width: 1200px) {
  .dashboard-grid, .bottom-grid, .project-grid, .project-detail-grid { grid-template-columns: 1fr; }
  .side-column, .wide, .week-card { grid-column: auto; grid-row: auto; }
  .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .topbar { flex-direction: column; }
  .topbar-actions { width: 100%; }
  .topbar-actions button { flex: 1; }
  .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
