/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f5f6fa; color: #1a1d2e; }

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Flash messages ────────────────────────────────────────────────────────── */
.flash { padding: 12px 20px; margin: 16px 0; border-radius: 8px; font-size: 13px; font-weight: 600; }
.flash.success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.flash.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f0f4ff; }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px; width: 400px; max-width: 95vw; box-shadow: 0 4px 32px rgba(0,0,0,.12); }
.login-card .logo { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #4f8ef7; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 28px; }
.login-card .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }
.login-card label { font-size: 12px; font-weight: 600; color: #5a6080; text-transform: uppercase; letter-spacing: .05em; }
.login-card input { padding: 10px 12px; border: 1.5px solid #e2e6f0; border-radius: 8px; font-size: 14px; font-family: inherit; }
.login-card input:focus { outline: none; border-color: #4f8ef7; }
.login-card .btn-login { width: 100%; padding: 13px; background: #4f8ef7; color: #fff; border: none; border-radius: 9px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 6px; }
.login-card .btn-login:hover { background: #3a7ae0; }
.login-card .error-msg { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

/* ── Top nav (staff/attorney/admin pages) ──────────────────────────────────── */
.top-nav { background: #1a1d2e; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; }
.top-nav .brand { color: #4f8ef7; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.top-nav .nav-right { display: flex; align-items: center; gap: 16px; }
.top-nav .nav-user { color: #8b90a0; font-size: 12px; }
.top-nav .nav-logout { color: #8b90a0; font-size: 12px; text-decoration: none; }
.top-nav .nav-logout:hover { color: #fff; }

/* ── Client pages ──────────────────────────────────────────────────────────── */
.client-page { background: #f0f4ff; min-height: 100vh; }
.client-header { background: #1a1d2e; color: #fff; padding: 28px 0 24px; text-align: center; }
.client-header .logo { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #4f8ef7; margin-bottom: 6px; font-weight: 600; }
.client-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.client-header p { color: #8b90a0; font-size: 13px; }

.progress-wrap { background: #fff; border-bottom: 1px solid #e2e6f0; padding: 14px 24px; }
.progress-steps { display: flex; justify-content: center; max-width: 680px; margin: 0 auto; }
.step { flex: 1; text-align: center; position: relative; font-size: 11px; color: #a0a8c0; }
.step::before { content: ''; position: absolute; top: 12px; left: 50%; right: -50%; height: 2px; background: #e2e6f0; z-index: 0; }
.step:last-child::before { display: none; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #e2e6f0; background: #fff; margin: 0 auto 6px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; color: #a0a8c0; }
.step.done .step-dot { background: #4f8ef7; border-color: #4f8ef7; color: #fff; }
.step.active .step-dot { background: #fff; border-color: #4f8ef7; color: #4f8ef7; }
.step.active { color: #4f8ef7; font-weight: 600; }
.step.done { color: #4f8ef7; }

.client-body { max-width: 680px; margin: 0 auto; padding: 28px 16px 60px; }
.form-card { background: #fff; border-radius: 14px; padding: 28px 32px 32px; box-shadow: 0 2px 16px rgba(0,0,0,.07); margin-bottom: 20px; }
.section-title { font-size: 15px; font-weight: 700; color: #1a1d2e; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #f0f4ff; display: flex; align-items: center; gap: 8px; }

.field-row { display: grid; gap: 16px; margin-bottom: 18px; }
.field-row.cols-2 { grid-template-columns: 1fr 1fr; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: #5a6080; text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1.5px solid #e2e6f0; border-radius: 8px; font-size: 14px; color: #1a1d2e; background: #fafbff; transition: border-color .15s; font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #4f8ef7; background: #fff; }
.field textarea { resize: vertical; min-height: 80px; }

.radio-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.radio-opt { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1.5px solid #e2e6f0; border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .15s; background: #fafbff; }
.radio-opt:hover { border-color: #4f8ef7; background: #f0f4ff; }
.radio-opt.selected { border-color: #4f8ef7; background: #eef3ff; color: #4f8ef7; font-weight: 600; }
.radio-opt input[type=radio] { display: none; }

.conditional-block { background: #f8f9ff; border-left: 3px solid #4f8ef7; border-radius: 0 10px 10px 0; padding: 20px; margin-top: 16px; }
.conditional-block .section-title { font-size: 13px; border-bottom-color: #e2e6f0; color: #4f8ef7; }

.add-row-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; background: #eef3ff; color: #4f8ef7; border: 1.5px dashed #c0d8ff; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.add-row-btn:hover { background: #4f8ef7; color: #fff; border-color: #4f8ef7; }

.remove-row-btn { padding: 4px 10px; background: #fee2e2; color: #dc2626; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; align-self: flex-end; margin-bottom: 2px; }
.remove-row-btn:hover { background: #dc2626; color: #fff; }

.btn-next { width: 100%; padding: 14px; background: #4f8ef7; color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 8px; transition: background .15s; }
.btn-next:hover { background: #3a7ae0; }
.btn-prev { width: 100%; padding: 12px; background: #f0f4ff; color: #4f8ef7; border: 1.5px solid #c0d8ff; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.btn-prev:hover { background: #e0eaff; }

/* ── Calendar (Step 5 — schedule) ──────────────────────────────────────────── */
.cal-card { background: linear-gradient(135deg, #1a1d2e 0%, #2a3050 100%); border-radius: 14px; padding: 28px 32px; margin-bottom: 20px; color: #fff; }
.cal-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.cal-card p { color: #a0a8c0; font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.cal-embed { background: #fff; border-radius: 10px; overflow: hidden; }
.cal-header { background: #f8f9ff; padding: 12px 16px; border-bottom: 1px solid #e2e6f0; display: flex; align-items: center; justify-content: space-between; }
.cal-header span { font-size: 13px; font-weight: 700; color: #1a1d2e; }
.cal-header .cal-nav { display: flex; gap: 8px; }
.cal-header button { background: #eef3ff; border: none; border-radius: 6px; padding: 4px 10px; cursor: pointer; color: #4f8ef7; font-weight: 700; font-size: 13px; }
.cal-grid { padding: 16px; }
.cal-days-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.cal-days-header span { text-align: center; font-size: 11px; font-weight: 700; color: #8b90a0; text-transform: uppercase; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 13px; cursor: pointer; color: #1a1d2e; transition: all .12s; }
.cal-day:hover:not(.unavailable) { background: #eef3ff; color: #4f8ef7; }
.cal-day.unavailable { color: #c0c8e0; cursor: default; }
.cal-day.selected { background: #4f8ef7; color: #fff; font-weight: 700; }
.cal-day.today { border: 2px solid #4f8ef7; color: #4f8ef7; font-weight: 700; }
.cal-slots { padding: 0 16px 16px; }
.cal-slots-label { font-size: 12px; font-weight: 700; color: #5a6080; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { padding: 9px; border: 1.5px solid #e2e6f0; border-radius: 8px; text-align: center; font-size: 13px; cursor: pointer; color: #1a1d2e; transition: all .12s; background: #fafbff; }
.slot:hover:not(.full) { border-color: #4f8ef7; background: #eef3ff; color: #4f8ef7; }
.slot.selected { background: #4f8ef7; border-color: #4f8ef7; color: #fff; font-weight: 600; }
.slot.full { color: #c0c8e0; background: #f5f6fa; cursor: default; text-decoration: line-through; }
.cal-skip { margin-top: 10px; text-align: center; font-size: 12px; color: #9098b8; cursor: pointer; text-decoration: underline; }

/* ── Confirmation ───────────────────────────────────────────────────────────── */
.confirm-card { background: #fff; border-radius: 14px; padding: 40px 32px; text-align: center; box-shadow: 0 2px 16px rgba(0,0,0,.07); }
.confirm-icon { font-size: 52px; margin-bottom: 16px; }
.confirm-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: #1a1d2e; }
.confirm-card p { color: #5a6080; font-size: 14px; line-height: 1.6; }
.confirm-appt { background: #f0fdf4; border: 1.5px solid #6ee7b7; border-radius: 10px; padding: 14px 18px; margin: 16px 0; display: flex; align-items: center; gap: 12px; }
.confirm-appt .appt-icon { font-size: 22px; }
.confirm-appt .appt-text { text-align: left; font-size: 13px; color: #065f46; font-weight: 600; }

/* ── Admin dashboard ────────────────────────────────────────────────────────── */
.admin-page { background: #f0f2fa; min-height: 100vh; }
.admin-header { background: #1a1d2e; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; }
.admin-header .left h1 { color: #fff; font-size: 18px; font-weight: 700; }
.admin-header .left p { color: #8b90a0; font-size: 12px; margin-top: 2px; }
.btn-new { padding: 9px 18px; background: #4f8ef7; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-new:hover { background: #3a7ae0; }

.admin-body { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 8px rgba(0,0,0,.06); }
.stat-card .label { font-size: 11px; color: #8b90a0; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 800; color: #1a1d2e; }
.stat-card .value.blue  { color: #4f8ef7; }
.stat-card .value.amber { color: #f59e0b; }
.stat-card .value.green { color: #10b981; }

.table-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 8px rgba(0,0,0,.06); overflow: hidden; }
.table-card-header { padding: 16px 20px; border-bottom: 1px solid #f0f2fa; font-size: 14px; font-weight: 700; color: #1a1d2e; display: flex; align-items: center; justify-content: space-between; }
.table-card-header input[type=text] { padding: 7px 12px; border: 1px solid #e2e6f0; border-radius: 7px; font-size: 13px; width: 220px; font-family: inherit; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 11px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8b90a0; background: #f8f9ff; border-bottom: 1px solid #f0f2fa; }
td { padding: 13px 20px; border-bottom: 1px solid #f8f9ff; font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge.verified { background: #d1fae5; color: #065f46; }
.badge.pending   { background: #fef3c7; color: #92400e; }
.badge.draft     { background: #e0e7ff; color: #3730a3; }
.badge.client    { background: #f3f4f6; color: #374151; }

.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { padding: 5px 11px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; white-space: nowrap; }
.btn-view   { background: #eef3ff; color: #4f8ef7; }
.btn-view:hover  { background: #4f8ef7; color: #fff; }
.btn-send        { background: #f0fdf4; color: #10b981; }
.btn-send:hover  { background: #10b981; color: #fff; }
.btn-copy-link   { background: #f5f3ff; color: #7c3aed; }
.btn-copy-link:hover { background: #7c3aed; color: #fff; }
.btn-reset-status      { background: #f0f4ff; color: #4f8ef7; }
.btn-reset-status:hover { background: #4f8ef7; color: #fff; }
.btn-archive           { background: #fff7ed; color: #c2410c; }
.btn-archive:hover     { background: #c2410c; color: #fff; }
.btn-unarchive         { background: #fff7ed; color: #c2410c; }
.btn-unarchive:hover   { background: #c2410c; color: #fff; }

.atty-select-wrap { position: relative; display: inline-block; }
.atty-select-wrap select { padding: 5px 28px 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1.5px solid #fed7aa; background: #fff7ed; color: #d97706; appearance: none; font-family: inherit; }
.atty-select-wrap::after { content: '▾'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #d97706; font-size: 11px; pointer-events: none; }

/* ── New client link modal ──────────────────────────────────────────────────── */
.link-modal-overlay { position: fixed; inset: 0; background: rgba(10,14,26,.6); backdrop-filter: blur(4px); z-index: 500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.link-modal-overlay.open { opacity: 1; pointer-events: all; }
.link-modal-box { background: #fff; border-radius: 14px; padding: 32px; width: 520px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.link-modal-box h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.link-modal-box p { color: #5a6080; font-size: 13px; margin-bottom: 16px; }
.link-output { background: #f0f4ff; border: 1.5px solid #c0d8ff; border-radius: 8px; padding: 12px 14px; font-size: 13px; font-family: monospace; word-break: break-all; color: #1a1d2e; margin-bottom: 16px; }
.btn-copy { padding: 9px 18px; background: #4f8ef7; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; margin-right: 8px; }
.btn-modal-close { padding: 9px 18px; background: #f0f2fa; color: #5a6080; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.monday-result-row:last-child { border-bottom: none !important; }
.monday-result-row:hover { background: #f5f7ff; }

/* ── Staff / Attorney review ────────────────────────────────────────────────── */
.review-page { background: #f0f2fa; min-height: 100vh; }
.review-header { background: #1a1d2e; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.review-header .client-info h2 { color: #fff; font-size: 17px; font-weight: 700; }
.review-header .client-info p { color: #8b90a0; font-size: 12px; margin-top: 2px; }
.review-header .header-actions { display: flex; gap: 10px; align-items: center; }
.btn-export { padding: 8px 16px; background: #2a2f45; color: #e0e4f0; border: 1px solid #3a4060; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-send-atty { padding: 8px 16px; background: #4f8ef7; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }

.review-body { max-width: 1200px; margin: 0 auto; padding: 24px 24px 120px; }
.review-section { background: #fff; border-radius: 12px; box-shadow: 0 1px 8px rgba(0,0,0,.06); margin-bottom: 20px; overflow: hidden; }
.review-section-header { padding: 14px 20px; background: #f8f9ff; border-bottom: 1px solid #eef0f8; font-size: 13px; font-weight: 700; color: #1a1d2e; }
.review-cols { display: grid; grid-template-columns: 1fr 320px; }
.review-fields { padding: 20px; border-right: 1px solid #f0f2fa; }
.review-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.review-field { display: flex; flex-direction: column; gap: 4px; }
.review-field label { font-size: 11px; font-weight: 600; color: #8b90a0; text-transform: uppercase; letter-spacing: .05em; }
.review-field input, .review-field select, .review-field textarea { padding: 9px 11px; border: 1.5px solid #e2e6f0; border-radius: 7px; font-size: 13px; color: #1a1d2e; background: #fafbff; font-family: inherit; }
.review-field input:focus, .review-field textarea:focus { outline: none; border-color: #4f8ef7; }
.review-field textarea { resize: vertical; min-height: 60px; }
.client-answered { background: #f0f7ff !important; border-color: #c0d8ff !important; }

/* Staff notes panel (yellow) */
.notes-panel { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.notes-panel.staff-panel { background: #fffdf0; }
.notes-panel.atty-panel  { background: #f0f7ff; }
.notes-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.notes-label.staff { color: #d97706; }
.notes-label.atty  { color: #3730a3; }
.notes-label.mine  { color: #059669; }
.notes-panel textarea { flex: 1; border-radius: 8px; padding: 10px; font-size: 13px; font-family: inherit; color: #1a1d2e; resize: none; min-height: 90px; }
.notes-panel.staff-panel textarea { border: 1.5px solid #fde68a; background: #fffef7; }
.notes-panel.staff-panel textarea:focus { outline: none; border-color: #d97706; }
.notes-hint { font-size: 11px; color: #b8a060; }
.staff-note-readonly { background: #e0e7ff; border-radius: 8px; padding: 10px; font-size: 13px; color: #3730a3; border: 1px solid #c7d2fe; line-height: 1.5; }
.atty-note-area { border: 1.5px solid #6ee7b7!important; background: #f0fdf4!important; }

/* Fixed sign-off bar */
.signoff-bar { background: #fff; border-top: 2px solid #e2e6f0; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: fixed; bottom: 0; left: 0; right: 0; box-shadow: 0 -4px 20px rgba(0,0,0,.10); z-index: 100; }
.signoff-bar p { font-size: 13px; color: #5a6080; }
.signoff-bar strong { color: #1a1d2e; }
.btn-signoff { padding: 11px 28px; background: #10b981; color: #fff; border: none; border-radius: 9px; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn-signoff:hover { background: #059669; }
.signed-badge { display: flex; align-items: center; gap: 8px; background: #d1fae5; color: #065f46; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; }

/* ── Sign-off modal ──────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,14,26,.6); backdrop-filter: blur(4px); z-index: 500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: #fff; border-radius: 16px; padding: 32px; width: 480px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-box h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.modal-box > p { color: #5a6080; font-size: 13px; margin-bottom: 20px; }
.sig-box { border: 2px dashed #c0c8e0; border-radius: 10px; height: 90px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; background: #fafbff; cursor: pointer; transition: border-color .15s; }
.sig-box:hover { border-color: #4f8ef7; }
.sig-box.signed { border-style: solid; border-color: #10b981; background: #f0fdf4; }
.sig-text { font-family: 'Georgia', serif; font-size: 26px; color: #1a1d2e; font-style: italic; display: none; }
.sig-hint { color: #a0a8c0; font-size: 13px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-confirm-sign { width: 100%; padding: 13px; background: #10b981; color: #fff; border: none; border-radius: 9px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-confirm-sign:disabled { opacity: .4; cursor: default; }
.btn-download { width: 100%; padding: 12px; background: #eef3ff; color: #4f8ef7; border: 1.5px solid #c0d8ff; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-download:hover { background: #4f8ef7; color: #fff; border-color: #4f8ef7; }
.btn-modal-cancel { width: 100%; padding: 10px; background: none; border: none; color: #9098b8; font-size: 13px; cursor: pointer; }
.done-state { text-align: center; }
.done-state .done-icon { font-size: 44px; margin-bottom: 12px; }
.done-state h4 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.done-state p { color: #5a6080; font-size: 13px; margin-bottom: 18px; }

/* ── Progress bar (fills based on step) ─────────────────────────────────────── */
.progress-bar-track { height: 4px; background: #e2e6f0; }
.progress-bar-fill  { height: 4px; background: #4f8ef7; transition: width .4s ease; width: 0%; }

/* ── Responsive — tablet ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .review-body { padding: 16px 12px 140px; }
}

/* ── Responsive — mobile ────────────────────────────────────────────────────── */
@media (max-width: 640px) {

  /* Nav */
  .top-nav { padding: 12px 16px; }
  .top-nav .brand { font-size: 11px; }

  /* Admin header */
  .admin-header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .admin-header .left h1 { font-size: 16px; }
  .btn-new { width: 100%; text-align: center; }

  /* Stats */
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 14px; }
  .stat-card .value { font-size: 22px; }
  .admin-body { padding: 16px 12px; }

  /* Table — hide less critical columns on mobile */
  .table-card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .table-card-header input[type=text] { width: 100%; }
  th:nth-child(2), td:nth-child(2) { display: none; }   /* hide Submitted col */
  th:nth-child(4), td:nth-child(4) { display: none; }   /* hide Attorney col */
  td, th { padding: 10px 12px; }

  /* Client form */
  .client-header { padding: 20px 16px 18px; }
  .client-header h1 { font-size: 18px; }
  .client-body { padding: 16px 12px 48px; }
  .form-card { padding: 18px 16px 20px; }
  .field-row.cols-2, .field-row.cols-3 { grid-template-columns: 1fr; }
  .radio-group { gap: 8px; }
  .radio-opt { padding: 8px 12px; font-size: 13px; }
  .btn-next, .btn-prev { font-size: 14px; padding: 13px; }

  /* Progress steps — compress labels */
  .progress-wrap { padding: 10px 12px; }
  .step { font-size: 10px; }
  .step-dot { width: 22px; height: 22px; font-size: 10px; }

  /* Review pages */
  .review-cols { grid-template-columns: 1fr; }
  .review-field-row { grid-template-columns: 1fr; }
  .review-header { padding: 12px 16px; }
  .review-header .client-info h2 { font-size: 14px; }
  .review-body { padding: 12px 10px 140px; }
  .review-section-header { font-size: 12px; }
  .btn-export { font-size: 12px; padding: 7px 12px; }

  /* Sign-off bar */
  .signoff-bar { flex-direction: column; align-items: stretch; padding: 14px 16px; gap: 10px; }
  .signoff-bar p { font-size: 12px; }
  .btn-signoff { text-align: center; }

  /* Modals */
  .modal-box, .link-modal-box { padding: 24px 18px; width: 95vw; }
  .modal-box h3 { font-size: 16px; }
  .sig-text { font-size: 22px; }

  /* Action buttons in table */
  .action-btns { flex-direction: column; gap: 4px; }
  .btn-sm { width: 100%; text-align: center; }
}
