b912ff22bc
- 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>
436 lines
18 KiB
CSS
436 lines
18 KiB
CSS
/* dashboard.css — Norwegian-legal twin of CaveauAI for tools.dobetternorge.no/dashboard/
|
|
*
|
|
* Pairs with tools.css design tokens (--dbn-paper, --dbn-blue, --dbn-red, --dbn-line).
|
|
* Keeps brand: paper + navy + burgundy. Adds gold accent for graph edges.
|
|
*/
|
|
|
|
:root {
|
|
--dash-gold: #b88a2c;
|
|
--dash-radius: 12px;
|
|
--dash-radius-sm: 8px;
|
|
--dash-shadow: 0 1px 0 rgba(22, 19, 15, 0.04), 0 12px 32px -22px rgba(0, 32, 91, 0.18);
|
|
--dash-row-hover: rgba(0, 32, 91, 0.05);
|
|
}
|
|
|
|
body[data-dashboard-page] {
|
|
background: var(--dbn-paper, #f6f2ea);
|
|
color: var(--dbn-ink, #16130f);
|
|
font-family: "IBM Plex Sans", "Inter", system-ui, sans-serif;
|
|
margin: 0;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.dash-shell { max-width: 1320px; margin: 0 auto; padding: 1.25rem clamp(1rem, 4vw, 2.25rem) 4rem; }
|
|
|
|
/* ── Topbar ───────────────────────────────────────────────────────────── */
|
|
.dash-topbar {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
padding: 0.75rem 0 1.25rem;
|
|
border-bottom: 1px solid var(--dbn-line, rgba(22, 19, 15, 0.16));
|
|
}
|
|
.dash-brand { display: flex; gap: 0.75rem; align-items: center; text-decoration: none; color: inherit; }
|
|
.dash-brand__mark {
|
|
width: 38px; height: 38px; border-radius: 10px;
|
|
background: var(--dbn-blue, #00205b); color: #fff;
|
|
display: grid; place-items: center; font-size: 1.1rem;
|
|
}
|
|
.dash-brand__text strong { font-family: "Crimson Pro", "Georgia", serif; font-size: 1.15rem; display: block; }
|
|
.dash-brand__text small { color: rgba(22, 19, 15, 0.55); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }
|
|
.dash-topbar__link { color: var(--dbn-blue, #00205b); text-decoration: none; font-size: 0.9rem; }
|
|
.dash-topbar__link:hover { text-decoration: underline; }
|
|
|
|
/* ── Layout (sidebar + main) ──────────────────────────────────────────── */
|
|
.dash-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.75rem; padding-top: 1.5rem; }
|
|
@media (max-width: 880px) { .dash-layout { grid-template-columns: 1fr; } }
|
|
|
|
.dash-sidebar { display: flex; flex-direction: column; gap: 0.25rem; }
|
|
.dash-sidebar__item {
|
|
display: block; padding: 0.7rem 0.85rem; border-radius: var(--dash-radius-sm);
|
|
text-decoration: none; color: var(--dbn-ink); transition: background 120ms;
|
|
border: 1px solid transparent;
|
|
}
|
|
.dash-sidebar__item:hover { background: var(--dash-row-hover); }
|
|
.dash-sidebar__item.is-active {
|
|
background: rgba(186, 12, 47, 0.08);
|
|
border-color: rgba(186, 12, 47, 0.18);
|
|
}
|
|
.dash-sidebar__item strong { display: block; font-size: 0.95rem; font-weight: 600; }
|
|
.dash-sidebar__item small { display: block; color: rgba(22, 19, 15, 0.55); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
|
|
|
|
/* ── Main column ──────────────────────────────────────────────────────── */
|
|
.dash-main { min-width: 0; }
|
|
.dash-main__head { margin-bottom: 1.5rem; }
|
|
.dash-main__head h1 {
|
|
font-family: "Crimson Pro", "Georgia", serif;
|
|
font-size: clamp(1.6rem, 2.4vw, 2.1rem);
|
|
margin: 0 0 0.35rem;
|
|
color: var(--dbn-blue, #00205b);
|
|
}
|
|
.dash-main__lead { color: rgba(22, 19, 15, 0.7); margin: 0; max-width: 64ch; }
|
|
|
|
/* ── KPI tiles ────────────────────────────────────────────────────────── */
|
|
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
|
|
.dash-kpi {
|
|
background: #fff; padding: 1rem 1.1rem; border-radius: var(--dash-radius);
|
|
border: 1px solid var(--dbn-line);
|
|
box-shadow: var(--dash-shadow);
|
|
}
|
|
.dash-kpi__label { font-size: 0.72rem; color: rgba(22, 19, 15, 0.55); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.4rem; }
|
|
.dash-kpi__value { font-family: "Crimson Pro", "Georgia", serif; font-size: 1.85rem; font-weight: 600; color: var(--dbn-blue); margin: 0; line-height: 1; }
|
|
.dash-kpi__hint { font-size: 0.78rem; color: rgba(22, 19, 15, 0.55); margin: 0.3rem 0 0; }
|
|
|
|
/* ── Card ────────────────────────────────────────────────────────────── */
|
|
.dash-card {
|
|
background: #fff; border-radius: var(--dash-radius); border: 1px solid var(--dbn-line);
|
|
box-shadow: var(--dash-shadow); padding: 1.25rem 1.4rem; margin-bottom: 1.5rem;
|
|
}
|
|
.dash-card__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; gap: 1rem; }
|
|
.dash-card__head h2 { font-family: "Crimson Pro", serif; font-size: 1.2rem; margin: 0; color: var(--dbn-blue); }
|
|
.dash-card__actions { display: flex; gap: 0.5rem; }
|
|
|
|
/* ── Buttons ─────────────────────────────────────────────────────────── */
|
|
.dash-btn {
|
|
display: inline-flex; align-items: center; gap: 0.4rem;
|
|
padding: 0.55rem 0.95rem; border-radius: var(--dash-radius-sm);
|
|
border: 1px solid var(--dbn-line); background: #fff; color: var(--dbn-ink);
|
|
font: inherit; cursor: pointer; text-decoration: none;
|
|
transition: border-color 120ms, background 120ms;
|
|
}
|
|
.dash-btn:hover { border-color: var(--dbn-blue); }
|
|
.dash-btn--primary { background: var(--dbn-blue); color: #fff; border-color: var(--dbn-blue); }
|
|
.dash-btn--primary:hover { background: #001543; }
|
|
.dash-btn--danger { background: #fff; color: var(--dbn-red, #ba0c2f); border-color: rgba(186, 12, 47, 0.4); }
|
|
.dash-btn--danger:hover { background: rgba(186, 12, 47, 0.07); }
|
|
|
|
/* ── Documents table ─────────────────────────────────────────────────── */
|
|
.dash-doctable { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
|
|
.dash-doctable th, .dash-doctable td { padding: 0.7rem 0.85rem; text-align: left; border-bottom: 1px solid var(--dbn-line); }
|
|
.dash-doctable th { font-weight: 600; color: rgba(22, 19, 15, 0.6); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
|
|
.dash-doctable tbody tr { cursor: pointer; transition: background 100ms; }
|
|
.dash-doctable tbody tr:hover { background: var(--dash-row-hover); }
|
|
.dash-doctable__title { font-weight: 600; color: var(--dbn-blue); }
|
|
.dash-doctable__meta { color: rgba(22, 19, 15, 0.55); font-size: 0.78rem; }
|
|
|
|
/* ── Status pills ────────────────────────────────────────────────────── */
|
|
.dash-status { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
|
|
.dash-status--ready { background: rgba(15, 118, 110, 0.12); color: #0f766e; }
|
|
.dash-status--pending { background: rgba(184, 138, 44, 0.16); color: #8b6d18; }
|
|
.dash-status--processing { background: rgba(0, 32, 91, 0.10); color: var(--dbn-blue); }
|
|
.dash-status--error { background: rgba(186, 12, 47, 0.12); color: var(--dbn-red); }
|
|
|
|
/* ── Filters bar ─────────────────────────────────────────────────────── */
|
|
.dash-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
|
|
.dash-filters input, .dash-filters select {
|
|
padding: 0.5rem 0.7rem; border: 1px solid var(--dbn-line); border-radius: var(--dash-radius-sm);
|
|
font: inherit; background: #fff;
|
|
}
|
|
.dash-filters input { min-width: 280px; }
|
|
|
|
/* ── Empty / loading states ──────────────────────────────────────────── */
|
|
.dash-empty { text-align: center; padding: 3rem 1rem; color: rgba(22, 19, 15, 0.55); }
|
|
.dash-empty__icon { font-size: 2.5rem; opacity: 0.4; display: block; margin-bottom: 0.5rem; }
|
|
.dash-loading { padding: 2rem 1rem; text-align: center; color: rgba(22, 19, 15, 0.5); font-style: italic; }
|
|
.dash-error { padding: 1rem; border-radius: var(--dash-radius-sm); background: rgba(186, 12, 47, 0.07); color: var(--dbn-red); border: 1px solid rgba(186, 12, 47, 0.2); }
|
|
|
|
/* ── Document view ───────────────────────────────────────────────────── */
|
|
.dash-doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1rem; }
|
|
.dash-doc-head h2 { font-family: "Crimson Pro", serif; font-size: 1.5rem; margin: 0; color: var(--dbn-blue); }
|
|
.dash-doc-meta { color: rgba(22, 19, 15, 0.55); font-size: 0.85rem; margin: 0.3rem 0 0; }
|
|
.dash-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--dbn-line); margin-bottom: 1rem; }
|
|
.dash-tab {
|
|
padding: 0.6rem 1rem; background: none; border: none; cursor: pointer;
|
|
color: rgba(22, 19, 15, 0.6); border-bottom: 2px solid transparent; margin-bottom: -1px;
|
|
font: inherit;
|
|
}
|
|
.dash-tab:hover { color: var(--dbn-blue); }
|
|
.dash-tab.is-active { color: var(--dbn-blue); border-bottom-color: var(--dbn-red); }
|
|
.dash-tab-panel { display: none; }
|
|
.dash-tab-panel.is-active { display: block; }
|
|
|
|
.dash-preview {
|
|
background: #fcfaf5; padding: 1.25rem 1.5rem; border-radius: var(--dash-radius-sm);
|
|
font-family: "Crimson Pro", serif; line-height: 1.65; white-space: pre-wrap; word-wrap: break-word;
|
|
max-height: 60vh; overflow-y: auto;
|
|
}
|
|
.dash-chunk {
|
|
background: #fff; padding: 0.85rem 1rem; border-radius: var(--dash-radius-sm);
|
|
border: 1px solid var(--dbn-line); margin-bottom: 0.75rem; font-size: 0.9rem;
|
|
}
|
|
.dash-chunk__section { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(22, 19, 15, 0.5); margin: 0 0 0.4rem; }
|
|
|
|
/* ── Related (graph edges) ───────────────────────────────────────────── */
|
|
.dash-related { display: flex; flex-direction: column; gap: 0.5rem; }
|
|
.dash-related__edge {
|
|
display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.85rem;
|
|
border-radius: var(--dash-radius-sm); border: 1px solid var(--dbn-line);
|
|
border-left: 3px solid var(--dash-gold);
|
|
}
|
|
.dash-related__rel { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dash-gold); font-weight: 600; min-width: 90px; }
|
|
.dash-related__title { flex: 1; color: var(--dbn-blue); font-weight: 500; }
|
|
|
|
/* ── 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; }
|