/* ── ByeCorporate Design System ─────────────────────────────────── */
/* Brand tokens — matched to War Chest Calculator aesthetic */
:root {
  /* Fluid type scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing — 4px grid */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem;

  /* Colors — exact match to calculator */
  --bg: #faf8f5;
  --bg-card: #f5f2ed;
  --bg-card-hover: #f0ede7;
  --bg-input: #faf8f5;
  --navy: #1a1a2e;
  --navy-light: #2d2d4a;
  --navy-muted: #4a4a6a;
  --amber: #d97706;
  --amber-hover: #b45309;
  --amber-active: #92400e;
  --amber-light: #fef3c7;
  --amber-subtle: #fffbeb;
  --text-primary: #1a1a2e;
  --text-secondary: #6b6b7b;
  --text-muted: #a0a0ac;
  --text-on-navy: #ffffff;
  --text-on-navy-muted: rgba(255,255,255,0.6);
  --border: oklch(0.3 0.01 270 / 0.12);
  --border-strong: oklch(0.3 0.01 270 / 0.18);
  --border-focus: #d97706;
  --success: #16a34a;
  --success-light: #dcfce7;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
  --sidebar-width: 280px;
  --header-height: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-body: 'Inter', system-ui, sans-serif;
  --font-logo: 'Instrument Serif', Georgia, serif;

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html, body { height: 100%; overflow: hidden; margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hover); }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ── Typography ─────────────────────────────────────────────────── */
.text-xs { font-size: 0.75rem; line-height: 1.5; }
.text-sm { font-size: 0.8125rem; line-height: 1.5; }
.text-base { font-size: 0.9375rem; line-height: 1.6; }
.text-lg { font-size: 1.125rem; line-height: 1.5; }
.text-xl { font-size: 1.375rem; line-height: 1.3; }
.text-2xl { font-size: 1.75rem; line-height: 1.2; }
.text-3xl { font-size: 2.25rem; line-height: 1.15; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Layout Shell ───────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  height: 100dvh;
  width: 100%;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  grid-row: 1 / -1;
  background: var(--navy);
  color: var(--text-on-navy);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 100;
  transition: transform 0.35s var(--ease);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo h1 {
  font-family: var(--font-logo);
  font-size: 1.625rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.01em;
}
.sidebar-logo span {
  color: var(--amber);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.phase-group {
  margin-bottom: 8px;
}
.phase-label {
  padding: 12px 24px 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}

.week-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 24px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border-left: 3px solid transparent;
  user-select: none;
}
.week-link:hover:not(.locked) {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.week-link.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left-color: var(--amber);
}
.week-link.locked {
  color: rgba(255,255,255,0.3);
  cursor: not-allowed;
}
.week-link .lock-icon {
  font-size: 0.7rem;
  opacity: 0.5;
}

/* Progress dot */
.week-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.week-dot-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--amber);
  transition: height 0.4s var(--ease);
  border-radius: 0 0 50% 50%;
}
.week-dot.complete {
  border-color: var(--amber);
  background: var(--amber);
}
.week-dot.complete::after {
  content: '\2713';
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer a {
  display: block;
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.sidebar-footer a:hover {
  color: rgba(255,255,255,0.8);
}

/* ── Mobile hamburger ───────────────────────────────────────────── */
.hamburger {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

/* ── Main Content ───────────────────────────────────────────────── */
.main-content {
  grid-column: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  padding: 0;
}

.main-inner {
  max-width: var(--content-default);
  margin: 0 auto;
  padding: clamp(var(--space-8), 5vw, var(--space-16)) clamp(var(--space-4), 3vw, var(--space-10)) var(--space-20);
}

/* ── Auth Views ─────────────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: var(--bg);
  padding: 20px;
  overflow-y: auto;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-10);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-logo {
  text-align: center;
  margin-bottom: 8px;
}
.auth-logo h1 {
  font-family: var(--font-logo);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--navy);
}
.auth-logo h1 span { color: var(--amber); }
.auth-subtitle {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: var(--space-8);
}

.form-group {
  margin-bottom: var(--space-4);
}
.form-group label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}
.form-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px oklch(from var(--amber) l c h / 0.15);
}
.form-input::placeholder {
  color: var(--text-muted);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-6);
  background: var(--amber);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
}
.btn-primary:hover { background: var(--amber-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-toggle {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.auth-toggle a { font-weight: 600; }

.auth-error {
  background: var(--error-bg);
  color: var(--error);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  display: none;
}
.auth-error.show { display: block; }

/* ── Dashboard View ─────────────────────────────────────────────── */
.dashboard-header {
  margin-bottom: var(--space-10);
}
.dashboard-header h2 {
  font-family: var(--font-logo);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: var(--space-1);
}
.dashboard-header p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  font-weight: 400;
}

/* Progress ring */
.progress-ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-12);
}
.progress-ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 12px;
}
.progress-ring-wrap svg {
  transform: rotate(-90deg);
  width: 180px;
  height: 180px;
}
.progress-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}
.progress-ring-fill {
  fill: none;
  stroke: var(--amber);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease);
}
.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.progress-ring-percent {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
}
.progress-ring-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Phase cards */
.phase-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}
.phase-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  cursor: default;
}
.phase-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.phase-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 4px;
}
.phase-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}
.phase-card-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.phase-card-bar-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 3px;
  transition: width 0.8s var(--ease);
}
.phase-card-percent {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Continue button */
.continue-section {
  text-align: center;
}
.btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--amber);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-continue:hover { background: var(--amber-hover); }
.btn-continue:active { transform: scale(0.98); }

/* ── Week View ──────────────────────────────────────────────────── */
.week-header {
  margin-bottom: var(--space-8);
}
.week-badge {
  display: inline-block;
  background: oklch(from var(--amber) l c h / 0.12);
  color: var(--amber);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}
.week-title {
  font-family: var(--font-logo);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--navy);
  margin-bottom: var(--space-3);
  line-height: 1.2;
}
.week-intro {
  font-size: var(--text-base);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.65;
}

/* Task sections — matches calculator card pattern */
.task-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}
.task-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}
.task-description {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.task-description a,
.check-label a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.task-description a:hover,
.check-label a:hover {
  color: var(--amber-hover);
}

/* Checkboxes */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid oklch(0.3 0.01 270 / 0.08);
}
.check-item:last-child { border-bottom: none; }

.custom-checkbox {
  position: relative;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}
.custom-checkbox input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}
.custom-checkbox .checkmark {
  position: absolute;
  inset: 0;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg);
  transition: all 0.2s var(--ease);
}
.custom-checkbox .checkmark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s var(--ease);
}
.custom-checkbox input:checked ~ .checkmark {
  background: var(--amber);
  border-color: var(--amber);
}
.custom-checkbox input:checked ~ .checkmark::after {
  transform: rotate(45deg) scale(1);
}
.custom-checkbox input:focus-visible ~ .checkmark {
  box-shadow: 0 0 0 3px rgba(217,119,6,0.2);
}
.check-label {
  font-size: var(--text-xs);
  color: var(--text-primary);
  line-height: 1.5;
  padding-top: 1px;
}
.check-item.completed .check-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Fields */
.field-group {
  margin-bottom: var(--space-4);
}
.field-group:last-child { margin-bottom: 0; }
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}
.field-input-wrap {
  position: relative;
}
.field-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9375rem;
  color: var(--text-muted);
  pointer-events: none;
}
.field-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px oklch(from var(--amber) l c h / 0.15);
}
.field-input.has-prefix {
  padding-left: 32px;
}
textarea.field-input {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

/* Tables — matches calculator styling */
.data-table-wrap {
  margin: var(--space-4) 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
}
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.data-table th:first-child { border-radius: var(--radius-md) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius-md) 0 0; }
.data-table td {
  padding: 2px;
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .cell-input {
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--text-primary);
  outline: none;
}
.data-table .cell-input:focus {
  background: var(--amber-subtle);
}
.data-table .cell-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}
.data-table .cell-static {
  padding: 8px 12px;
  font-size: var(--text-xs);
  color: var(--text-primary);
}
.data-table .cell-static a {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.data-table .cell-static a:hover {
  color: var(--amber-hover);
}

/* Pro Tip / Callout — matches calculator callout */
.callout {
  display: flex;
  gap: var(--space-2);
  background: oklch(from var(--amber) l c h / 0.08);
  border: 1px solid oklch(from var(--amber) l c h / 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin: var(--space-4) 0;
}
.callout-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: var(--space-1);
}
.callout-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Reflection Questions (Week 12) */
.reflection-section {
  margin: 24px 0;
}
.reflection-section h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}
.reflection-list {
  list-style: none;
  counter-reset: reflection;
}
.reflection-list li {
  counter-increment: reflection;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
}
.reflection-list li::before {
  content: counter(reflection);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--amber-light);
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Deliverables section */
.deliverables-section {
  background: var(--bg-card);
  border: 2px solid var(--amber);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}
.deliverables-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.deliverables-title::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background: var(--amber);
  border-radius: 4px;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none'%3E%3Cpath d='M3 9l4 4 8-8' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none'%3E%3Cpath d='M3 9l4 4 8-8' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Notes */
.notes-section {
  margin-top: var(--space-6);
}
.notes-section h3 {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}
.notes-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  resize: vertical;
  line-height: 1.6;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.notes-textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px oklch(from var(--amber) l c h / 0.15);
}

/* Complete Week button */
.complete-week-section {
  text-align: center;
  margin-top: var(--space-8);
}
.btn-complete-week {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  background: var(--amber);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s, opacity 0.2s;
}
.btn-complete-week:hover:not(:disabled) { background: var(--amber-hover); }
.btn-complete-week:active:not(:disabled) { transform: scale(0.98); }
.btn-complete-week:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Saved indicator ────────────────────────────────────────────── */
.saved-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 500;
  pointer-events: none;
}
.saved-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--navy);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 600;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── View transitions ───────────────────────────────────────────── */
.view-enter {
  animation: viewFadeIn 0.3s var(--ease) forwards;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Week nav buttons ───────────────────────────────────────────── */
.week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid oklch(0.3 0.01 270 / 0.08);
}
.btn-week-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-week-nav:hover {
  color: var(--amber);
  border-color: var(--amber);
  background: var(--bg);
}
.btn-week-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: var(--space-8) 0 var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.app-footer a {
  color: var(--text-muted);
}
.app-footer a:hover { color: var(--amber); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .phase-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    z-index: 100;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }
  .hamburger {
    display: flex;
  }
  .main-content {
    grid-column: 1;
  }
  .main-inner {
    padding: 72px 20px 80px;
  }
  .progress-ring-wrap {
    width: 140px;
    height: 140px;
  }
  .progress-ring-wrap svg {
    width: 140px;
    height: 140px;
  }
  .progress-ring-percent {
    font-size: 2rem;
  }
  .week-title {
    font-size: 1.375rem;
  }
  .dashboard-header h2 {
    font-size: 1.375rem;
  }
  .task-section {
    padding: 20px;
  }
  .deliverables-section {
    padding: 20px;
  }
  .auth-card {
    padding: 36px 24px;
  }
}

@media (max-width: 480px) {
  .main-inner {
    padding: 68px 16px 80px;
  }
  .data-table-wrap {
    margin-left: -8px;
    margin-right: -8px;
  }
}

/* ── Focus & Accessibility ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ── Loading spinner ────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
