Dashboard account section, profile API, and CSS account panels
- SSO session auth gating on all protected pages - dashboard.php: account section (profile form + workspace panel), onboarding prompt modal, overview bar extracted to CSS classes, dashboard.css linked in page head - api/profile.php: save/dismiss endpoint for optional profile fields - assets/css/dashboard.css: account grid, dash-account-panel, dash-profile-form, profile-prompt-backdrop modal, overview bar classes, dash-section-kicker, dash-tier-badge base styles - includes/bootstrap.php: dbnToolsMainUserProfile, dbnToolsProfileNeedsPrompt, dbnToolsRequirePageAuth - scripts/sql/004_user_profile_fields.sql: nullable phone, address, and profile_prompt_dismissed_at columns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -171,3 +171,265 @@ body[data-dashboard-page] {
|
||||
/* ── Pagination ──────────────────────────────────────────────────────── */
|
||||
.dash-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; color: rgba(22, 19, 15, 0.55); font-size: 0.85rem; }
|
||||
.dash-pager__actions { display: flex; gap: 0.5rem; }
|
||||
|
||||
/* ── Section kicker ───────────────────────────────────────────────── */
|
||||
.dash-section-kicker {
|
||||
font-size: 0.72rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.07em;
|
||||
color: rgba(22, 19, 15, 0.5);
|
||||
margin: 0 0 0.2rem;
|
||||
}
|
||||
|
||||
/* ── Tier badge (bg/color set inline by PHP, base shape here) ─────── */
|
||||
.dash-tier-badge {
|
||||
display: inline-block;
|
||||
padding: 0.18rem 0.6rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ── Overview bar ─────────────────────────────────────────────────── */
|
||||
.dash-overview-bar {
|
||||
background: #fff;
|
||||
border: 1px solid var(--dbn-line);
|
||||
border-radius: var(--dash-radius);
|
||||
padding: 1.1rem 1.5rem;
|
||||
margin: 0 0 1.25rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.dash-overview-bar__left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
}
|
||||
.dash-overview-bar__credits {
|
||||
font-size: 1.08rem;
|
||||
font-weight: 700;
|
||||
color: var(--dbn-blue, #00205b);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.dash-overview-bar__meta {
|
||||
color: #9ca3af;
|
||||
font-size: 0.92rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.dash-overview-bar__meta strong { color: #374151; }
|
||||
.dash-overview-bar__right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
flex-shrink: 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.dash-overview-bar__action {
|
||||
font-size: 0.92rem;
|
||||
text-decoration: none;
|
||||
padding: 7px 14px;
|
||||
border-radius: 7px;
|
||||
white-space: nowrap;
|
||||
font-weight: 600;
|
||||
}
|
||||
.dash-overview-bar__action--manage {
|
||||
color: #6b7280;
|
||||
border: 1px solid var(--dbn-line);
|
||||
font-weight: 400;
|
||||
}
|
||||
.dash-overview-bar__action--upgrade {
|
||||
background: var(--dbn-blue, #00205b);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
.dash-overview-bar__action--topup {
|
||||
background: #eff6ff;
|
||||
color: #1d4ed8;
|
||||
border: 1px solid #bfdbfe;
|
||||
}
|
||||
|
||||
/* ── Account section grid ─────────────────────────────────────────── */
|
||||
.dashboard-account-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1.25rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
@media (max-width: 760px) { .dashboard-account-grid { grid-template-columns: 1fr; } }
|
||||
|
||||
.dash-account-panel {
|
||||
background: #fff;
|
||||
border: 1px solid var(--dbn-line);
|
||||
border-radius: var(--dash-radius);
|
||||
padding: 1.25rem 1.5rem;
|
||||
box-shadow: var(--dash-shadow);
|
||||
}
|
||||
|
||||
.dash-account-panel__head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.dash-account-panel__head h2 {
|
||||
font-family: "Crimson Pro", "Georgia", serif;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
margin: 0;
|
||||
color: var(--dbn-blue, #00205b);
|
||||
}
|
||||
|
||||
.dash-account-chip {
|
||||
display: inline-block;
|
||||
padding: 0.2rem 0.6rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 600;
|
||||
background: #f3f4f6;
|
||||
color: rgba(22, 19, 15, 0.6);
|
||||
white-space: nowrap;
|
||||
margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
.dash-account-list { display: flex; flex-direction: column; }
|
||||
.dash-account-list > div {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
padding: 0.55rem 0;
|
||||
border-bottom: 1px solid var(--dbn-line);
|
||||
font-size: 0.9rem;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.dash-account-list > div:last-child { border-bottom: none; }
|
||||
.dash-account-list span { color: rgba(22, 19, 15, 0.55); }
|
||||
.dash-account-list strong { font-weight: 600; color: var(--dbn-ink, #16130f); text-align: right; word-break: break-all; }
|
||||
|
||||
.dash-account-note {
|
||||
font-size: 0.78rem;
|
||||
color: rgba(22, 19, 15, 0.45);
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* ── Profile form ─────────────────────────────────────────────────── */
|
||||
.dash-profile-form {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
.dash-profile-form .span-2 { grid-column: 1 / -1; }
|
||||
.dash-profile-form label {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.3rem;
|
||||
font-size: 0.8rem;
|
||||
color: rgba(22, 19, 15, 0.6);
|
||||
font-weight: 500;
|
||||
}
|
||||
.dash-profile-form input {
|
||||
padding: 0.45rem 0.65rem;
|
||||
border: 1px solid var(--dbn-line);
|
||||
border-radius: var(--dash-radius-sm);
|
||||
font: inherit;
|
||||
font-size: 0.875rem;
|
||||
color: var(--dbn-ink, #16130f);
|
||||
background: var(--dbn-paper, #f6f2ea);
|
||||
transition: border-color .15s, background .15s;
|
||||
}
|
||||
.dash-profile-form input:focus {
|
||||
outline: none;
|
||||
border-color: var(--dbn-blue, #00205b);
|
||||
background: #fff;
|
||||
}
|
||||
.dash-profile-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
.dash-profile-save {
|
||||
padding: 0.45rem 1.1rem;
|
||||
background: var(--dbn-blue, #00205b);
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: var(--dash-radius-sm);
|
||||
font: inherit;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: background .15s;
|
||||
}
|
||||
.dash-profile-save:hover { background: #001543; }
|
||||
.dash-profile-status { font-size: 0.8rem; color: rgba(22, 19, 15, 0.55); }
|
||||
|
||||
/* ── Onboarding prompt modal ──────────────────────────────────────── */
|
||||
.profile-prompt-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 900;
|
||||
}
|
||||
.profile-prompt-backdrop[hidden] { display: none; }
|
||||
.profile-prompt-card {
|
||||
background: #fff;
|
||||
border-radius: 14px;
|
||||
padding: 2rem 2.25rem;
|
||||
max-width: 540px;
|
||||
width: 92%;
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
.profile-prompt-card h2 {
|
||||
font-family: "Crimson Pro", "Georgia", serif;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
margin: 0.25rem 0 0.5rem;
|
||||
color: var(--dbn-blue, #00205b);
|
||||
}
|
||||
.profile-prompt-card > p {
|
||||
font-size: 0.875rem;
|
||||
color: rgba(22, 19, 15, 0.6);
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
.profile-prompt-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.75rem;
|
||||
grid-column: 1 / -1;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
.profile-prompt-actions button[type="button"] {
|
||||
padding: 0.45rem 1rem;
|
||||
background: #f3f4f6;
|
||||
color: var(--dbn-ink, #16130f);
|
||||
border: 1px solid var(--dbn-line);
|
||||
border-radius: var(--dash-radius-sm);
|
||||
font: inherit;
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.profile-prompt-actions button[type="submit"] {
|
||||
padding: 0.45rem 1.1rem;
|
||||
background: var(--dbn-blue, #00205b);
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: var(--dash-radius-sm);
|
||||
font: inherit;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
}
|
||||
.profile-prompt-actions button:hover { opacity: 0.88; }
|
||||
|
||||
Reference in New Issue
Block a user