Add user database migration, core reusable components, and layout structure

This commit is contained in:
2026-05-16 18:54:23 -04:00
parent c7df396a83
commit e132c7a580
33 changed files with 2348 additions and 398 deletions
+242 -127
View File
@@ -1,156 +1,271 @@
/* ── Light mode (default) ─────────────────────────────────────────────────── */
/* ── Design Tokens — Light Mode ──────────────────────────────────────────────── */
:root {
--navy: #0d2137;
--accent: #0a7ea4;
--accent-lt: #14b8d4;
--surface: #ffffff;
--surface-2: #f8fafc;
--bg: #f0f6fa;
--border: #e2ebf0;
--text: #1a2e3b;
--muted: #64748b;
--danger: #c0392b;
--success: #1d9d6c;
--warning: #e07b39;
--radius: 8px;
--shadow: 0 2px 8px rgba(0,0,0,.08);
/* Brand */
--navy: #0D2137;
--teal: #0A7EA4;
--teal-lt: #14B8D4;
--teal-dk: #075E7A;
/* Status badge colours — light */
--badge-draft-bg: #e2e8f0; --badge-draft-text: #475569;
--badge-assigned-bg: #dbeafe; --badge-assigned-text: #1d4ed8;
--badge-scheduled-bg: #fef3c7; --badge-scheduled-text: #92400e;
--badge-in_progress-bg: #d1fae5; --badge-in_progress-text: #065f46;
--badge-pending_review-bg: #ede9fe; --badge-pending_review-text: #5b21b6;
--badge-closed-bg: #f3f4f6; --badge-closed-text: #6b7280;
/* Surfaces */
--bg: #F0F6FA;
--surface: #FFFFFF;
--surface-2: #E8F0F5;
--border: #D1DDE6;
--border-lt: #E8F0F5;
/* Text */
--text: #1A2E3B;
--text-muted: #64748B;
--text-inv: #FFFFFF;
/* Semantic */
--success: #1D9D6C;
--warning: #E07B39;
--danger: #C0392B;
--info: #0A7EA4;
/* Shadows */
--shadow-sm: 0 1px 3px rgba(0,0,0,.08);
--shadow-md: 0 4px 12px rgba(0,0,0,.10);
--shadow-lg: 0 8px 24px rgba(0,0,0,.12);
/* Radius */
--radius-sm: 4px;
--radius: 8px;
--radius-lg: 12px;
--radius-xl: 16px;
/* Sidebar */
--sidebar-bg: #0D2137;
--sidebar-hover: #153248;
--sidebar-active: #0A7EA4;
--sidebar-w: 260px;
--sidebar-collapsed: 64px;
/* Status colours */
--status-draft: #94A3B8;
--status-assigned: #0A7EA4;
--status-scheduled: #8B5CF6;
--status-in_progress: #E07B39;
--status-pending_review: #D97706;
--status-closed: #1D9D6C;
/* Status badge backgrounds (light tint) */
--status-draft-bg: #F1F5F9;
--status-assigned-bg: #E0F2FE;
--status-scheduled-bg: #EDE9FE;
--status-in_progress-bg: #FFF7ED;
--status-pending_review-bg: #FFFBEB;
--status-closed-bg: #DCFCE7;
/* Priority colours */
--priority-low: #64748B;
--priority-normal: #0A7EA4;
--priority-high: #E07B39;
--priority-urgent: #C0392B;
font-family: Calibri, 'Segoe UI', system-ui, sans-serif;
font-size: 16px;
color: var(--text);
background: var(--bg);
color-scheme: light;
}
/* ── Dark mode ────────────────────────────────────────────────────────────── */
/* ── Dark Mode ───────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
:root {
--navy: #0a1929;
--accent: #29b6d8;
--accent-lt: #4dd0e8;
--surface: #0f2336;
--surface-2: #0c1d2e;
--bg: #081828;
--border: #1e3a52;
--text: #e2eaf2;
--muted: #8baabf;
--danger: #f87171;
--success: #34d399;
--warning: #fbbf24;
--shadow: 0 2px 12px rgba(0,0,0,.4);
:root { --_dark: 1; }
}
:root[data-theme="dark"] { --_dark: 1; }
/* Status badge colours — dark (muted tints so they don't blaze) */
--badge-draft-bg: #1e2d3d; --badge-draft-text: #94a3b8;
--badge-assigned-bg: #1e3a5f; --badge-assigned-text: #93c5fd;
--badge-scheduled-bg: #3d2e00; --badge-scheduled-text: #fde68a;
--badge-in_progress-bg: #064e30; --badge-in_progress-text: #6ee7b7;
--badge-pending_review-bg: #2e1f5e; --badge-pending_review-text: #c4b5fd;
--badge-closed-bg: #1c2a38; --badge-closed-text: #6b7280;
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--navy: #0A1929;
--teal: #29B6D8;
--teal-lt: #4DD0E8;
--teal-dk: #1A8FAD;
--bg: #081828;
--surface: #0F2336;
--surface-2: #0C1D2E;
--border: #1E3A52;
--border-lt: #1A3048;
--text: #E2EAF2;
--text-muted: #8BAABF;
--text-inv: #FFFFFF;
--success: #34D399;
--warning: #FBBF24;
--danger: #F87171;
--info: #29B6D8;
--shadow-sm: 0 1px 3px rgba(0,0,0,.3);
--shadow-md: 0 4px 12px rgba(0,0,0,.4);
--shadow-lg: 0 8px 24px rgba(0,0,0,.5);
--sidebar-bg: #061220;
--sidebar-hover: #0D1F32;
--sidebar-active: #1A5C78;
--status-draft-bg: #1E2D3D;
--status-assigned-bg: #1E3A5F;
--status-scheduled-bg: #2E1F5E;
--status-in_progress-bg: #3D2E00;
--status-pending_review-bg: #3D2800;
--status-closed-bg: #064E30;
color-scheme: dark;
}
}
:root[data-theme="dark"] {
--navy: #0A1929;
--teal: #29B6D8;
--teal-lt: #4DD0E8;
--bg: #081828;
--surface: #0F2336;
--surface-2: #0C1D2E;
--border: #1E3A52;
--border-lt: #1A3048;
--text: #E2EAF2;
--text-muted: #8BAABF;
--shadow-sm: 0 1px 3px rgba(0,0,0,.3);
--shadow-md: 0 4px 12px rgba(0,0,0,.4);
color-scheme: dark;
}
/* ── Reset ────────────────────────────────────────────────────────────────── */
body { min-height: 100vh; }
/* ── Base ────────────────────────────────────────────────────────────────────── */
body {
background: var(--bg);
color: var(--text);
min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
/* ── Buttons ──────────────────────────────────────────────────────────────── */
button {
cursor: pointer;
border: none;
border-radius: var(--radius);
padding: .5rem 1rem;
background: var(--accent);
color: #fff;
font-weight: 600;
transition: opacity .15s;
/* ── App Layout (Light DOM — no shadow root) ─────────────────────────────────── */
app-root {
display: grid;
grid-template-columns: var(--sidebar-w) 1fr;
grid-template-rows: 1fr;
min-height: 100vh;
}
button:hover { opacity: .85; }
button.secondary {
background: transparent;
border: 1px solid var(--border);
color: var(--text);
app-root.collapsed {
grid-template-columns: var(--sidebar-collapsed) 1fr;
}
/* ── Form controls ────────────────────────────────────────────────────────── */
input, select, textarea {
border: 1px solid var(--border);
border-radius: var(--radius);
padding: .5rem .75rem;
width: 100%;
.app-shell {
display: grid;
grid-template-rows: 56px 1fr;
min-height: 100vh;
overflow: hidden;
}
#main-content {
overflow-y: auto;
padding: 1.5rem;
background: var(--bg);
}
app-mobile-nav { display: none; }
@media (max-width: 768px) {
app-root {
grid-template-columns: 1fr;
grid-template-rows: 56px 1fr 56px;
}
.app-shell { grid-template-rows: 1fr; }
app-sidebar { display: none; }
app-mobile-nav { display: flex; }
app-topbar { display: none; }
#main-content { padding: 1rem; }
}
/* ── Sidebar (Light DOM) ──────────────────────────────────────────────────────── */
app-sidebar {
background: var(--sidebar-bg);
display: flex;
flex-direction: column;
height: 100vh;
position: sticky;
top: 0;
overflow: hidden;
transition: width .2s ease;
}
/* ── Topbar (Light DOM) ───────────────────────────────────────────────────────── */
app-topbar {
background: var(--surface);
color: var(--text);
transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
outline: none;
border-color: var(--accent);
}
/* Native date/time pickers pick up OS colour scheme via color-scheme property */
input[type="datetime-local"] { color-scheme: inherit; }
/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.25rem;
box-shadow: var(--shadow);
}
/* ── Status badges ────────────────────────────────────────────────────────── */
.badge {
display: inline-block;
padding: .2rem .6rem;
border-radius: 999px;
font-size: .75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: .04em;
}
.badge-draft { background: var(--badge-draft-bg); color: var(--badge-draft-text); }
.badge-assigned { background: var(--badge-assigned-bg); color: var(--badge-assigned-text); }
.badge-scheduled { background: var(--badge-scheduled-bg); color: var(--badge-scheduled-text); }
.badge-in_progress { background: var(--badge-in_progress-bg); color: var(--badge-in_progress-text); }
.badge-pending_review { background: var(--badge-pending_review-bg); color: var(--badge-pending_review-text); }
.badge-closed { background: var(--badge-closed-bg); color: var(--badge-closed-text); }
/* ── Layout ───────────────────────────────────────────────────────────────── */
#app { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
/* ── Nav ──────────────────────────────────────────────────────────────────── */
nav {
background: var(--navy);
color: #fff;
padding: .75rem 1.5rem;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 1.5rem;
border-bottom: 1px solid rgba(255,255,255,.06);
padding: 0 1.25rem;
height: 56px;
gap: 1rem;
z-index: 10;
}
nav .brand { font-weight: 700; font-size: 1.1rem; color: #fff; }
nav a { color: rgba(255,255,255,.8); font-size: .9rem; }
nav a:hover { color: #fff; text-decoration: none; }
nav .spacer { flex: 1; }
nav .user-info { font-size: .85rem; color: rgba(255,255,255,.6); }
/* ── Page header ──────────────────────────────────────────────────────────── */
/* ── Mobile Nav (Light DOM) ───────────────────────────────────────────────────── */
app-mobile-nav {
background: var(--surface);
border-top: 1px solid var(--border);
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 56px;
align-items: center;
justify-content: space-around;
z-index: 100;
padding-bottom: env(safe-area-inset-bottom);
}
/* ── Page Header ──────────────────────────────────────────────────────────────── */
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1.5rem 0 1rem;
margin-bottom: 1.25rem;
}
.page-header h1 { font-size: 1.4rem; }
.page-header h1 {
font-size: 1.25rem;
font-weight: 700;
color: var(--text);
}
/* ── Cards ────────────────────────────────────────────────────────────────────── */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow-sm);
}
/* ── Buttons ──────────────────────────────────────────────────────────────────── */
button, .btn {
display: inline-flex;
align-items: center;
gap: .4rem;
padding: .5rem 1rem;
border: none;
border-radius: var(--radius);
font-weight: 600;
font-size: .875rem;
cursor: pointer;
transition: opacity .15s, background .15s;
background: var(--teal);
color: #fff;
}
button:hover, .btn:hover { opacity: .88; }
button.ghost, .btn-ghost {
background: transparent;
border: 1px solid var(--border);
color: var(--text);
}
button.danger, .btn-danger {
background: var(--danger);
color: #fff;
}
button:disabled { opacity: .5; cursor: not-allowed; }
/* ── Utility ──────────────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .813rem; }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }