R1 foundation - Phase 1 live build

This commit is contained in:
2026-02-28 03:33:33 +00:00
commit f36ea194f3
45 changed files with 4009 additions and 0 deletions

56
static/app.js Normal file
View File

@@ -0,0 +1,56 @@
/* Life OS - UI Interactions */
document.addEventListener('DOMContentLoaded', () => {
// Theme toggle
const theme = localStorage.getItem('lifeos-theme') || 'dark';
document.documentElement.setAttribute('data-theme', theme);
// Domain tree collapse
document.querySelectorAll('.domain-header').forEach(header => {
header.addEventListener('click', () => {
const children = header.nextElementSibling;
if (children && children.classList.contains('domain-children')) {
children.classList.toggle('collapsed');
const key = 'sidebar-' + header.dataset.domainId;
localStorage.setItem(key, children.classList.contains('collapsed'));
}
});
});
// Restore collapsed state
document.querySelectorAll('.domain-children').forEach(el => {
const key = 'sidebar-' + el.dataset.domainId;
if (localStorage.getItem(key) === 'true') {
el.classList.add('collapsed');
}
});
// Auto-submit filters on change
document.querySelectorAll('.filter-select[data-auto-submit]').forEach(select => {
select.addEventListener('change', () => {
select.closest('form').submit();
});
});
// Confirm delete dialogs
document.querySelectorAll('form[data-confirm]').forEach(form => {
form.addEventListener('submit', (e) => {
if (!confirm(form.dataset.confirm)) {
e.preventDefault();
}
});
});
});
// Theme toggle function
function toggleTheme() {
const current = document.documentElement.getAttribute('data-theme');
const next = current === 'dark' ? 'light' : 'dark';
document.documentElement.setAttribute('data-theme', next);
localStorage.setItem('lifeos-theme', next);
}
// Collapsed style
document.head.insertAdjacentHTML('beforeend',
'<style>.domain-children.collapsed { display: none; }</style>'
);

845
static/style.css Normal file
View File

@@ -0,0 +1,845 @@
/* ==========================================================================
Life OS - Stylesheet
Dark-first design with light theme support.
Design tokens from architecture spec Section 9.2.
========================================================================== */
/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* ---- Theme Tokens ---- */
[data-theme="dark"] {
--bg: #0D0E13;
--surface: #14161F;
--surface2: #1A1D28;
--surface3: #222533;
--border: #252836;
--border-light: #2E3244;
--text: #DDE1F5;
--text-secondary: #9CA3C4;
--muted: #5A6080;
--accent: #4F6EF7;
--accent-hover: #6380FF;
--accent-soft: rgba(79,110,247,.12);
--green: #22C98A;
--green-soft: rgba(34,201,138,.12);
--amber: #F5A623;
--amber-soft: rgba(245,166,35,.12);
--red: #F05252;
--red-soft: rgba(240,82,82,.12);
--purple: #9B7FF5;
--purple-soft: rgba(155,127,245,.12);
--shadow: 0 2px 8px rgba(0,0,0,.3);
--shadow-lg: 0 8px 32px rgba(0,0,0,.4);
}
[data-theme="light"] {
--bg: #F0F2F8;
--surface: #FFFFFF;
--surface2: #F7F8FC;
--surface3: #EEF0F6;
--border: #E3E6F0;
--border-light: #ECEEF5;
--text: #171926;
--text-secondary: #555B78;
--muted: #8892B0;
--accent: #4F6EF7;
--accent-hover: #3A5BE0;
--accent-soft: rgba(79,110,247,.10);
--green: #10B981;
--green-soft: rgba(16,185,129,.10);
--amber: #F59E0B;
--amber-soft: rgba(245,158,11,.10);
--red: #DC2626;
--red-soft: rgba(220,38,38,.10);
--purple: #7C3AED;
--purple-soft: rgba(124,58,237,.10);
--shadow: 0 2px 8px rgba(0,0,0,.06);
--shadow-lg: 0 8px 32px rgba(0,0,0,.1);
}
/* ---- Typography ---- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');
:root {
--font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
--radius: 8px;
--radius-sm: 4px;
--radius-lg: 12px;
--sidebar-width: 260px;
--topbar-height: 52px;
--transition: 150ms ease;
}
html {
font-size: 14px;
-webkit-font-smoothing: antialiased;
}
body {
font-family: var(--font-body);
background: var(--bg);
color: var(--text);
line-height: 1.5;
min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
/* ---- Layout Shell ---- */
.app-layout {
display: flex;
min-height: 100vh;
}
/* ---- Sidebar ---- */
.sidebar {
width: var(--sidebar-width);
background: var(--surface);
border-right: 1px solid var(--border);
height: 100vh;
position: fixed;
top: 0;
left: 0;
overflow-y: auto;
overflow-x: hidden;
z-index: 100;
display: flex;
flex-direction: column;
}
.sidebar-header {
padding: 16px 16px 12px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 10px;
}
.sidebar-logo {
font-size: 1.15rem;
font-weight: 700;
color: var(--text);
letter-spacing: -0.02em;
}
.sidebar-logo span {
color: var(--accent);
}
.sidebar-nav {
flex: 1;
padding: 8px 0;
overflow-y: auto;
}
.nav-section {
padding: 0 8px;
margin-bottom: 4px;
}
.nav-section-label {
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--muted);
padding: 12px 8px 4px;
}
.nav-item {
display: flex;
align-items: center;
gap: 8px;
padding: 7px 10px;
border-radius: var(--radius-sm);
color: var(--text-secondary);
font-size: 0.92rem;
font-weight: 500;
cursor: pointer;
transition: all var(--transition);
}
.nav-item:hover {
background: var(--accent-soft);
color: var(--text);
}
.nav-item.active {
background: var(--accent-soft);
color: var(--accent);
}
.nav-item .badge {
margin-left: auto;
background: var(--accent);
color: #fff;
font-size: 0.7rem;
font-weight: 600;
padding: 1px 6px;
border-radius: 10px;
min-width: 18px;
text-align: center;
}
.nav-icon {
width: 18px;
height: 18px;
opacity: 0.7;
flex-shrink: 0;
}
.nav-item.active .nav-icon { opacity: 1; }
/* Domain tree */
.domain-group { margin-top: 4px; }
.domain-header {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
font-size: 0.85rem;
font-weight: 600;
color: var(--text);
cursor: pointer;
border-radius: var(--radius-sm);
}
.domain-header:hover { background: var(--surface2); }
.domain-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.domain-children {
padding-left: 12px;
}
.area-label {
font-size: 0.78rem;
font-weight: 600;
color: var(--muted);
padding: 6px 10px 2px;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.project-link {
display: block;
padding: 4px 10px 4px 18px;
font-size: 0.85rem;
color: var(--text-secondary);
border-radius: var(--radius-sm);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.project-link:hover {
background: var(--surface2);
color: var(--text);
}
/* ---- Main Content ---- */
.main-content {
margin-left: var(--sidebar-width);
flex: 1;
min-height: 100vh;
display: flex;
flex-direction: column;
}
.topbar {
height: var(--topbar-height);
background: var(--surface);
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
padding: 0 24px;
gap: 16px;
position: sticky;
top: 0;
z-index: 50;
}
.topbar-env {
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
background: var(--amber-soft);
color: var(--amber);
padding: 2px 8px;
border-radius: var(--radius-sm);
}
.topbar-spacer { flex: 1; }
.page-content {
flex: 1;
padding: 24px;
max-width: 1200px;
width: 100%;
}
/* ---- Page Header ---- */
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
gap: 16px;
}
.page-title {
font-size: 1.5rem;
font-weight: 700;
letter-spacing: -0.02em;
}
.page-count {
font-size: 0.85rem;
color: var(--muted);
margin-left: 8px;
font-weight: 400;
}
/* ---- Breadcrumb ---- */
.breadcrumb {
display: flex;
align-items: center;
gap: 6px;
font-size: 0.82rem;
color: var(--muted);
margin-bottom: 12px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border); }
/* ---- Buttons ---- */
.btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 16px;
border-radius: var(--radius);
font-family: var(--font-body);
font-size: 0.85rem;
font-weight: 600;
border: none;
cursor: pointer;
transition: all var(--transition);
text-decoration: none;
line-height: 1.4;
}
.btn-primary {
background: var(--accent);
color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary {
background: var(--surface2);
color: var(--text-secondary);
border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface3); color: var(--text); }
.btn-danger {
background: var(--red-soft);
color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost {
background: transparent;
color: var(--text-secondary);
padding: 6px 10px;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-xs { padding: 3px 8px; font-size: 0.75rem; }
/* ---- Cards ---- */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 20px;
box-shadow: var(--shadow);
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.card-title {
font-size: 1rem;
font-weight: 600;
}
/* ---- Tables / List Rows ---- */
.list-table {
width: 100%;
border-collapse: collapse;
}
.list-row {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border-bottom: 1px solid var(--border);
transition: background var(--transition);
}
.list-row:hover {
background: var(--surface2);
}
.list-row.completed .row-title {
text-decoration: line-through;
color: var(--muted);
}
.row-check {
flex-shrink: 0;
}
.row-check input[type="checkbox"] {
display: none;
}
.row-check label {
width: 20px;
height: 20px;
border: 2px solid var(--border-light);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all var(--transition);
}
.row-check label:hover {
border-color: var(--accent);
}
.row-check input[type="checkbox"]:checked + label {
background: var(--green);
border-color: var(--green);
}
.row-check input[type="checkbox"]:checked + label::after {
content: "\2713";
color: #fff;
font-size: 0.75rem;
font-weight: 700;
}
.priority-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.priority-1 { background: var(--red); }
.priority-2 { background: var(--amber); }
.priority-3 { background: var(--accent); }
.priority-4 { background: var(--muted); }
.row-title {
flex: 1;
font-weight: 500;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.row-title a { color: var(--text); }
.row-title a:hover { color: var(--accent); }
.row-meta {
font-size: 0.78rem;
color: var(--muted);
white-space: nowrap;
}
.row-tag {
font-size: 0.72rem;
background: var(--surface2);
color: var(--text-secondary);
padding: 2px 8px;
border-radius: 10px;
border: 1px solid var(--border);
}
.row-domain-tag {
font-size: 0.72rem;
padding: 2px 8px;
border-radius: 10px;
font-weight: 500;
}
.row-actions {
display: flex;
gap: 4px;
opacity: 0;
transition: opacity var(--transition);
}
.list-row:hover .row-actions { opacity: 1; }
.overdue { color: var(--red) !important; font-weight: 600; }
/* ---- Filters Bar ---- */
.filters-bar {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 16px;
align-items: center;
}
.filter-select {
font-family: var(--font-body);
font-size: 0.82rem;
padding: 6px 10px;
background: var(--surface);
color: var(--text);
border: 1px solid var(--border);
border-radius: var(--radius);
cursor: pointer;
}
.filter-select:focus {
outline: none;
border-color: var(--accent);
}
/* ---- Forms ---- */
.form-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
.form-group {
display: flex;
flex-direction: column;
gap: 4px;
}
.form-group.full-width {
grid-column: 1 / -1;
}
.form-label {
font-size: 0.8rem;
font-weight: 600;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.04em;
}
.form-input,
.form-select,
.form-textarea {
font-family: var(--font-body);
font-size: 0.92rem;
padding: 9px 12px;
background: var(--surface2);
color: var(--text);
border: 1px solid var(--border);
border-radius: var(--radius);
transition: border-color var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-textarea {
min-height: 120px;
resize: vertical;
}
.form-actions {
display: flex;
gap: 10px;
margin-top: 8px;
grid-column: 1 / -1;
}
/* ---- Quick Add ---- */
.quick-add {
display: flex;
gap: 8px;
margin-bottom: 16px;
}
.quick-add input {
flex: 1;
font-family: var(--font-body);
font-size: 0.92rem;
padding: 9px 12px;
background: var(--surface);
color: var(--text);
border: 1px solid var(--border);
border-radius: var(--radius);
}
.quick-add input:focus {
outline: none;
border-color: var(--accent);
}
.quick-add input::placeholder { color: var(--muted); }
/* ---- Progress Bar ---- */
.progress-bar {
height: 6px;
background: var(--surface2);
border-radius: 3px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: var(--green);
border-radius: 3px;
transition: width 300ms ease;
}
.progress-text {
font-size: 0.78rem;
color: var(--muted);
margin-top: 2px;
}
/* ---- Tabs ---- */
.tab-strip {
display: flex;
gap: 0;
border-bottom: 1px solid var(--border);
margin-bottom: 20px;
}
.tab-item {
padding: 10px 20px;
font-size: 0.88rem;
font-weight: 500;
color: var(--muted);
border-bottom: 2px solid transparent;
cursor: pointer;
transition: all var(--transition);
text-decoration: none;
}
.tab-item:hover { color: var(--text); }
.tab-item.active {
color: var(--accent);
border-bottom-color: var(--accent);
}
/* ---- Status Badges ---- */
.status-badge {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 0.75rem;
font-weight: 600;
padding: 3px 10px;
border-radius: 10px;
text-transform: capitalize;
}
.status-open { background: var(--accent-soft); color: var(--accent); }
.status-active { background: var(--green-soft); color: var(--green); }
.status-in_progress { background: var(--amber-soft); color: var(--amber); }
.status-blocked { background: var(--red-soft); color: var(--red); }
.status-done { background: var(--green-soft); color: var(--green); }
.status-completed { background: var(--green-soft); color: var(--green); }
.status-cancelled { background: var(--surface2); color: var(--muted); }
.status-on_hold { background: var(--purple-soft); color: var(--purple); }
.status-archived { background: var(--surface2); color: var(--muted); }
/* ---- Empty State ---- */
.empty-state {
text-align: center;
padding: 48px 24px;
color: var(--muted);
}
.empty-state-icon {
font-size: 2.5rem;
margin-bottom: 12px;
opacity: 0.4;
}
.empty-state-text {
font-size: 0.95rem;
margin-bottom: 16px;
}
/* ---- Detail Header ---- */
.detail-header {
margin-bottom: 24px;
}
.detail-title {
font-size: 1.75rem;
font-weight: 700;
letter-spacing: -0.02em;
margin-bottom: 8px;
}
.detail-meta {
display: flex;
flex-wrap: wrap;
gap: 12px;
align-items: center;
font-size: 0.85rem;
color: var(--text-secondary);
}
.detail-meta-item {
display: flex;
align-items: center;
gap: 4px;
}
.detail-body {
line-height: 1.75;
color: var(--text);
}
.detail-body p { margin-bottom: 1em; }
.detail-body h1, .detail-body h2, .detail-body h3 { margin: 1.2em 0 0.6em; font-weight: 600; }
.detail-body code { font-family: var(--font-mono); background: var(--surface2); padding: 1px 5px; border-radius: 3px; }
.detail-body pre { background: var(--surface2); padding: 16px; border-radius: var(--radius); overflow-x: auto; margin: 1em 0; }
.detail-body pre code { background: none; padding: 0; }
/* ---- Dashboard Widgets ---- */
.dashboard-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
.stat-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 20px;
}
.stat-value {
font-size: 2rem;
font-weight: 700;
letter-spacing: -0.02em;
}
.stat-label {
font-size: 0.82rem;
color: var(--muted);
margin-top: 2px;
}
/* ---- Capture Items ---- */
.capture-item {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 8px;
}
.capture-text {
flex: 1;
font-size: 0.92rem;
}
.capture-actions {
display: flex;
gap: 4px;
flex-shrink: 0;
}
/* ---- Focus Items ---- */
.focus-item {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 16px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 6px;
transition: all var(--transition);
}
.focus-item:hover { border-color: var(--accent); }
.focus-item.completed { opacity: 0.6; }
.focus-item.completed .focus-title { text-decoration: line-through; }
.focus-title { flex: 1; font-weight: 500; }
.focus-meta { font-size: 0.78rem; color: var(--muted); }
/* ---- Utility ---- */
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.75rem; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none; }
/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
/* ---- Responsive ---- */
@media (max-width: 768px) {
.sidebar { display: none; }
.main-content { margin-left: 0; }
.form-grid { grid-template-columns: 1fr; }
.dashboard-grid { grid-template-columns: 1fr; }
.page-content { padding: 16px; }
}