/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'Inter', sans-serif; background: #f3f4f6; color: #1f2937; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Colours ──────────────────────────────────────────────────────────────── */
:root {
  --purple:      #7c3aed;
  --purple-dark: #6d28d9;
  --purple-light:#ede9fe;
  --green:       #059669;
  --green-light: #d1fae5;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --yellow-light:#fef9c3;
  --amber-light: #fef3c7;
  --blue-light:  #dbeafe;
  --grey-50:     #f9fafb;
  --grey-100:    #f3f4f6;
  --grey-200:    #e5e7eb;
  --grey-400:    #9ca3af;
  --grey-600:    #4b5563;
  --grey-800:    #1f2937;
  --white:       #ffffff;
  --radius:      10px;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.1);
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.app-nav { background: var(--purple); padding: 0 1.5rem; position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center;
             justify-content: space-between; height: 56px; }
.nav-logo { color: var(--white); font-size: 1.2rem; font-weight: 700; letter-spacing: -.5px; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-email { color: rgba(255,255,255,.8); font-size: .85rem; }
.nav-link  { color: rgba(255,255,255,.85); font-size: .9rem; }
.nav-link:hover { color: var(--white); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.25rem;
       border-radius: var(--radius); font-weight: 600; cursor: pointer; border: none;
       transition: opacity .15s, transform .1s; font-size: .95rem; }
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--purple); color: var(--white); }
.btn-outline  { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,.6); }
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-outline-dark { background: transparent; color: var(--grey-600); border: 1.5px solid var(--grey-200); }
.btn-outline-dark:hover { background: var(--grey-100); }
.btn-green  { background: var(--green-light); color: var(--green); border: 1.5px solid #a7f3d0; }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.page-wrap { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 2rem; }
.card + .card { margin-top: 1.25rem; }

/* ── Wizard shell ─────────────────────────────────────────────────────────── */
.wizard-header { background: linear-gradient(135deg, var(--purple), var(--purple-dark));
                 color: var(--white); padding: 1.5rem; text-align: center; }
.wizard-header h1 { font-size: 1.6rem; font-weight: 700; }
.wizard-header p  { opacity: .85; font-size: .95rem; margin-top: .25rem; }
.wizard-nav-bar { display: flex; justify-content: space-between; align-items: center;
                  padding: .75rem 1.5rem; background: var(--white);
                  border-bottom: 1px solid var(--grey-200); font-size: .9rem; }
.wizard-nav-bar a { color: var(--purple); }

/* Progress bar */
.progress-wrap { background: var(--white); padding: .75rem 1.5rem 0; }
.progress-label { font-size: .85rem; color: var(--grey-600); margin-bottom: .35rem; }
.progress-bar { height: 4px; background: var(--grey-200); border-radius: 2px; }
.progress-fill { height: 100%; background: var(--purple); border-radius: 2px;
                 transition: width .3s ease; }

/* Wizard content */
.wizard-body { max-width: 700px; margin: 2rem auto; padding: 0 1.5rem; }
.step-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-md);
             padding: 2rem; }
.step-title { font-size: 1.3rem; font-weight: 700; margin-bottom: .35rem; }
.step-desc  { color: var(--grey-600); font-size: .92rem; margin-bottom: 1.25rem; }

.wizard-footer { display: flex; gap: .75rem; margin-top: 2rem; flex-wrap: wrap; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .4rem; color: var(--grey-800); }
.form-input { width: 100%; padding: .65rem .9rem; border: 1.5px solid var(--grey-200);
              border-radius: var(--radius); background: var(--white); color: var(--grey-800);
              transition: border-color .15s; }
.form-input:focus { outline: none; border-color: var(--purple); }
.form-input.error { border-color: var(--red); }

.month-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.5rem; margin-bottom: 1rem; }
.month-field label { font-size: .85rem; color: var(--grey-600); margin-bottom: .25rem; display: block; }
.month-field input { width: 100%; padding: .55rem .8rem; border: 1.5px solid var(--grey-200);
                     border-radius: 8px; }
.month-field input:focus { outline: none; border-color: var(--purple); }

/* Total banner */
.total-banner { background: var(--purple); color: var(--white); border-radius: var(--radius);
                padding: 1rem 1.5rem; display: flex; justify-content: space-between;
                align-items: center; font-weight: 600; font-size: 1.05rem; margin-top: 1rem; }
.total-banner .total-amount { font-size: 1.4rem; font-weight: 700; }

/* ── Alert boxes ──────────────────────────────────────────────────────────── */
.alert { padding: .85rem 1rem; border-radius: 8px; font-size: .9rem; margin-bottom: 1rem; }
.alert-green  { background: var(--green-light);  color: var(--green); border-left: 3px solid var(--green); }
.alert-blue   { background: var(--blue-light);   color: #1d4ed8; border-left: 3px solid #3b82f6; }
.alert-amber  { background: var(--amber-light);  color: #92400e; border-left: 3px solid #f59e0b; }
.alert-red    { background: var(--red-light);    color: var(--red); border-left: 3px solid var(--red); }
.alert-grey   { background: var(--grey-100);     color: var(--grey-600); border-left: 3px solid var(--grey-400); font-size:.83rem; }
.alert-lock { display: flex; align-items: flex-start; gap: .5rem; }

/* ── Season chart ─────────────────────────────────────────────────────────── */
.chart-wrap { margin: 1.25rem 0; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.bar-chart .bar { flex: 1; border-radius: 4px 4px 0 0; min-height: 4px; transition: height .3s; }
.bar.high     { background: #3b82f6; }
.bar.shoulder { background: #f59e0b; }
.bar.low      { background: #ef4444; }
.chart-labels { display: flex; gap: 4px; margin-top: .35rem; }
.chart-labels span { flex: 1; text-align: center; font-size: .7rem; color: var(--grey-400); }

/* Season selector */
.season-options { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1.25rem 0; }
.season-option { border: 2px solid var(--grey-200); border-radius: var(--radius);
                 padding: .9rem; text-align: center; cursor: pointer; transition: all .15s; }
.season-option:hover { border-color: var(--purple-light); }
.season-option.selected { border-color: var(--purple); background: var(--purple-light); }
.season-option .season-name { font-weight: 700; font-size: 1rem; }
.season-option .season-sub  { font-size: .8rem; color: var(--grey-600); }
.season-option.selected .season-sub { color: var(--purple); }

/* Season stats */
.season-stats { display: grid; gap: .75rem; margin: 1rem 0; }
.season-stats.cols-3 { grid-template-columns: repeat(3, 1fr); }
.season-stats.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat-box { border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-box.high     { background: var(--blue-light); }
.stat-box.shoulder { background: var(--amber-light); }
.stat-box.low      { background: var(--red-light); }
.stat-box .stat-num  { font-size: 2rem; font-weight: 700; }
.stat-box .stat-label { font-size: .82rem; color: var(--grey-600); margin-top: .15rem; }
.stat-box .stat-weeks { font-size: .78rem; color: var(--grey-400); }

/* ── Expenses table ───────────────────────────────────────────────────────── */
.expense-rows { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.expense-row  { display: flex; align-items: center; gap: .75rem; }
.expense-row label { flex: 1; font-size: .92rem; color: var(--grey-800); }
.expense-row input { width: 160px; padding: .5rem .75rem; border: 1.5px solid var(--grey-200);
                     border-radius: 8px; }
.expense-row input:focus { outline: none; border-color: var(--purple); }

.expenses-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.expenses-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
                     color: var(--grey-400); text-align: left; padding: .5rem .75rem;
                     border-bottom: 1px solid var(--grey-200); }
.expenses-table th:last-child { text-align: right; }
.expenses-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--grey-100);
                     font-size: .92rem; }
.expenses-table tr:last-child td { border-bottom: none; font-weight: 700; }
.expenses-table .td-actions { text-align: right; display: flex; gap: .75rem; justify-content: flex-end; }
.link-edit   { color: var(--purple); cursor: pointer; font-size: .85rem; }
.link-delete { color: var(--red);    cursor: pointer; font-size: .85rem; }
.btn-add-custom { background: var(--grey-100); color: var(--grey-600); border: 1.5px dashed var(--grey-300);
                  border-radius: 8px; padding: .5rem 1rem; cursor: pointer; font-size: .88rem;
                  font-weight: 500; margin-top: .5rem; }
.btn-add-custom:hover { background: var(--grey-200); }

/* ── Weighting ────────────────────────────────────────────────────────────── */
.weight-cards { display: grid; gap: .75rem; margin: 1rem 0; }
.weight-cards.cols-3 { grid-template-columns: repeat(3,1fr); }
.weight-cards.cols-2 { grid-template-columns: repeat(2,1fr); }
.weight-card { border-radius: var(--radius); padding: 1rem; }
.weight-card.high     { background: var(--blue-light); }
.weight-card.shoulder { background: var(--amber-light); }
.weight-card.low      { background: var(--red-light); }
.weight-card label    { font-size: .82rem; color: var(--grey-600); display: block; margin-bottom: .4rem; }
.weight-card input    { width: 100%; padding: .65rem; font-size: 1.3rem; font-weight: 700;
                        text-align: center; border: 1.5px solid rgba(0,0,0,.1);
                        border-radius: 8px; background: var(--white); }
.weight-card input:focus { outline: none; border-color: var(--purple); }
.weight-card .dynamic { font-size: .75rem; color: var(--grey-400); text-align: center; margin-top: .3rem; }

.weight-check { background: var(--grey-800); color: var(--white); border-radius: var(--radius);
                padding: 1rem 1.5rem; display: flex; justify-content: space-between;
                align-items: center; font-weight: 600; margin: .75rem 0; }
.weight-check .wc-total { font-size: 1.5rem; font-weight: 700; }

/* ── Results / Schedule ───────────────────────────────────────────────────── */
.schedule-cards { display: flex; flex-direction: column; gap: .75rem; margin: 1rem 0; }
.schedule-card { border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.schedule-card.high     { background: var(--blue-light); }
.schedule-card.shoulder { background: var(--amber-light); }
.schedule-card.low      { background: var(--red-light); }
.schedule-card .sc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.schedule-card .sc-season { font-size: .75rem; font-weight: 700; text-transform: uppercase;
                             letter-spacing: .08em; color: var(--grey-600); }
.schedule-card .sc-dates  { font-size: .82rem; color: var(--grey-600); margin-top: .15rem; }
.schedule-card .sc-amount { text-align: right; }
.schedule-card .sc-amount .amount { font-size: 1.75rem; font-weight: 700; }
.schedule-card .sc-amount .per-wk { font-size: .78rem; color: var(--grey-500); }
.schedule-card .sc-note { font-size: .82rem; color: var(--grey-600); margin-top: .75rem;
                           padding-top: .75rem; border-top: 1px solid rgba(0,0,0,.08); }

/* Summary table */
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table td { padding: .65rem .5rem; font-size: .95rem; border-bottom: 1px solid var(--grey-100); }
.summary-table td:last-child { text-align: right; font-weight: 600; }
.summary-table tr:last-child td { border-bottom: none; }

/* How to set this up */
.howto ol { padding-left: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.howto li { font-size: .92rem; color: var(--grey-800); }
.howto li strong { color: var(--grey-800); }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.dash-header { display: flex; justify-content: space-between; align-items: flex-start;
               margin-bottom: 1.5rem; }
.dash-header h1 { font-size: 1.6rem; font-weight: 700; }
.dash-header p  { color: var(--grey-600); font-size: .9rem; margin-top: .15rem; }

.plan-card { border: 2px solid var(--grey-200); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.plan-card.active { border-color: var(--green); }
.plan-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.plan-card-name { font-size: 1.1rem; font-weight: 700; }
.plan-card-date { font-size: .82rem; color: var(--grey-400); margin-top: .2rem; }
.plan-card-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem;
         font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin: .4rem 0; }
.badge-green  { background: var(--green-light);  color: var(--green); }
.badge-grey   { background: var(--grey-100);     color: var(--grey-400); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.plan-card-stats { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .85rem;
                   color: var(--grey-600); margin-top: .5rem; }
.plan-card-stats span { white-space: nowrap; }
.plan-card-stats .s-high     { color: #1d4ed8; font-weight: 600; }
.plan-card-stats .s-shoulder { color: #92400e; font-weight: 600; }
.plan-card-stats .s-low      { color: var(--red); font-weight: 600; }

.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .4rem; }
.empty-state p  { color: var(--grey-600); font-size: .9rem; margin-bottom: 1.5rem; }

.section-label { font-size: .82rem; color: var(--grey-400); font-weight: 600;
                 text-transform: uppercase; letter-spacing: .06em; margin: 1.5rem 0 .5rem; }
.section-label span { font-weight: 400; color: var(--grey-400); margin-left: .4rem; font-size: .78rem; }

/* Archived accordion */
.archived-plan { border: 1px solid var(--grey-200); border-radius: var(--radius);
                 overflow: hidden; margin-bottom: .5rem; }
.archived-summary { display: flex; align-items: center; gap: .75rem; padding: .9rem 1.25rem;
                    cursor: pointer; background: var(--white); }
.archived-summary:hover { background: var(--grey-50); }
.archived-summary .arc-name { font-weight: 600; font-size: .92rem; }
.archived-summary .arc-date { font-size: .8rem; color: var(--grey-400); }
.archived-detail { padding: 1rem 1.25rem; border-top: 1px solid var(--grey-100);
                   background: var(--grey-50); font-size: .88rem; display: none; }
.archived-detail.open { display: block; }

/* ── Auth pages ───────────────────────────────────────────────────────────── */
.auth-wrap { min-height: calc(100vh - 56px); display: flex; align-items: center;
             justify-content: center; padding: 2rem 1rem; }
.auth-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-md);
             padding: 2.5rem; width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: .25rem; }
.auth-card p  { color: var(--grey-600); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-footer  { text-align: center; font-size: .85rem; color: var(--grey-600); margin-top: 1rem; }
.auth-footer a { color: var(--purple); font-weight: 500; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.divider { border: none; border-top: 1px solid var(--grey-200); margin: 1.5rem 0; }

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .app-nav, .app-footer, .wizard-footer, .no-print { display: none !important; }
  body { background: white; }
  .schedule-card { border: 1px solid #ccc !important; background: white !important; }
  .confidential { border: 1px solid #ccc; border-radius: 8px; padding: 1rem; margin-top: 1.5rem; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .month-grid { grid-template-columns: 1fr; }
  .season-options { grid-template-columns: 1fr; }
  .season-stats.cols-3, .weight-cards.cols-3 { grid-template-columns: 1fr; }
  .plan-card-top { flex-direction: column; gap: .75rem; }
  .nav-email { display: none; }
}
