/* Mission Control — Fritz+Larry Dashboard */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #fafafa;
    --surface: #ffffff;
    --surface-hover: #f0f0f2;
    --border: #d2d2d7;
    --border-light: #e5e5e5;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #aeaeb2;
    --accent: #007aff;
    --accent-light: #007aff15;
    --green: #34c759;
    --green-light: #34c75915;
    --orange: #ff9500;
    --orange-light: #ff950015;
    --red: #ff3b30;
    --red-light: #ff3b3015;
    --purple: #af52de;
    --purple-light: #af52de15;
    --cyan: #32d4de;
    --cyan-light: #32d4de15;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg-secondary);
    color: var(--text);
    line-height: 1.4;
    overflow: hidden;
    height: 100vh;
}

.app {
    display: flex;
    height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-top { flex: 1; overflow-y: auto; padding: 1.25rem 0; }

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem 1.5rem;
}

.logo-icon { font-size: 1.5rem; }

.logo-text { display: flex; flex-direction: column; }
.logo-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.logo-sub { font-size: 0.7rem; color: var(--text-muted); }

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.15s;
}

.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }

.sidebar-bottom {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
}

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.btn-refresh {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.btn-refresh:hover { background: var(--surface-hover); color: var(--text); }

/* ─── MAIN CONTENT ─── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.mobile-header {
    display: none;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    justify-content: space-between;
}

.mobile-header-left { display: flex; align-items: center; gap: 0.5rem; }
.mobile-logo { font-size: 1.25rem; }
.mobile-title { font-size: 1rem; font-weight: 600; }

.mobile-nav {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    padding: 0.5rem 0.25rem;
    gap: 2px;
    justify-content: space-around;
}

.mnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.4rem 0.25rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    min-width: 50px;
    transition: all 0.15s;
}
.mnav-item span:first-child { font-size: 1.2rem; }
.mnav-item.active { color: var(--accent); background: var(--accent-light); }

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ─── SECTION STRUCTURE ─── */
.section { display: none; }
.section.active { display: block; }

.section-header {
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ─── CARDS ─── */
.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.card-action {
    font-size: 0.8rem;
    color: var(--accent);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
}

.card-action:hover { opacity: 0.7; }

/* ─── GRID LAYOUTS ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.stat-card.accent { border-left: 3px solid var(--accent); }
.stat-card.green { border-left: 3px solid var(--green); }
.stat-card.orange { border-left: 3px solid var(--orange); }
.stat-card.purple { border-left: 3px solid var(--purple); }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* ─── HOME SECTION ─── */
.home-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.home-greeting {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 45px;
    padding-top: 2px;
}

.activity-content { flex: 1; min-width: 0; }

.activity-agent {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.activity-agent.coder { background: var(--accent-light); color: var(--accent); }
.activity-agent.creator { background: var(--purple-light); color: var(--purple); }
.activity-agent.research { background: var(--green-light); color: var(--green); }
.activity-agent.larry { background: var(--cyan-light); color: var(--cyan); }
.activity-agent.task { background: var(--orange-light); color: var(--orange); }

.activity-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-status {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    display: inline-block;
}
.activity-status.ok { background: var(--green-light); color: var(--green); }
.activity-status.error { background: var(--red-light); color: var(--red); }

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-light);
}
.upcoming-item:last-child { border-bottom: none; }

.upcoming-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 60px;
}

.upcoming-name {
    font-size: 0.875rem;
    color: var(--text);
}

/* App mini cards */
.app-mini {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.app-mini-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--accent-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.app-mini-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.app-mini-stage {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stage-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stage-idea { background: var(--border-light); color: var(--text-secondary); }
.stage-building { background: var(--orange-light); color: var(--orange); }
.stage-testing { background: var(--purple-light); color: var(--purple); }
.stage-live { background: var(--green-light); color: var(--green); }

/* Quick action */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.quick-btn:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }

/* ─── APPS SECTION ─── */
.app-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-icon-lg {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--accent-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.app-info { flex: 1; min-width: 0; }

.app-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.app-stage-select {
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
}

.app-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.app-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── CONTENT SECTION ─── */
.content-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

.content-platform {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.content-platform.tiktok { background: #ff005015; color: #ff0050; }
.content-platform.ig { background: #e1306c15; color: #e1306c; }
.content-platform.yt { background: #ff000015; color: #ff0000; }

.content-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; }

.content-stats {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.cstat { font-size: 0.8rem; }
.cstat-val { font-weight: 700; color: var(--text); }
.cstat-label { color: var(--text-muted); }

.content-notes {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

/* ─── TEAM SECTION ─── */
.agent-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.agent-avatar {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}

.agent-name { font-size: 1rem; font-weight: 700; }
.agent-role { font-size: 0.8rem; color: var(--text-secondary); }

.agent-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.agent-status-badge.online { background: var(--green-light); color: var(--green); }
.agent-status-badge.idle { background: var(--border-light); color: var(--text-muted); }

.agent-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
}
.agent-status-badge.online .agent-status-dot { background: var(--green); animation: pulse 2s infinite; }
.agent-status-badge.idle .agent-status-dot { background: var(--text-muted); }

/* ─── CALENDAR ─── */
.cal-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.cal-nav-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.cal-nav-btn:hover { background: var(--surface-hover); border-color: var(--accent); }

.cal-month {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 160px;
    text-align: center;
}

.cal-today-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--accent);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    margin-left: auto;
}
.cal-today-btn:hover { background: var(--accent-light); }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 1.5rem;
}

.cal-day-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.5rem 0;
    text-transform: uppercase;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem;
    border-radius: 10px;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.15s;
    min-height: 64px;
}
.cal-day:hover { background: var(--surface-hover); }
.cal-day.other-month { opacity: 0.3; }
.cal-day.today { background: var(--accent-light); border: 2px solid var(--accent); }

.cal-day-num {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}
.cal-day.today .cal-day-num { color: var(--accent); font-weight: 700; }

.cal-day-evs { display: flex; flex-direction: column; gap: 2px; width: 100%; }

.cal-ev {
    font-size: 0.58rem;
    padding: 1px 3px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
.cal-ev.sched { background: var(--accent-light); color: var(--accent); }
.cal-ev.task { background: var(--green-light); color: var(--green); }
.cal-ev.task.err { background: var(--red-light); color: var(--red); }

.cal-day-detail {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.cal-detail-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.cal-detail-ev {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
}
.cal-detail-ev:last-child { border-bottom: none; }

.cal-detail-time { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); min-width: 42px; }
.cal-detail-title { font-size: 0.875rem; }
.cal-detail-sub { font-size: 0.75rem; color: var(--text-secondary); }

.cal-no-ev { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.875rem; }

/* ─── MEMORY ─── */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1.25rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.memory-content {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.session-search { margin-bottom: 1rem; }

.session-search-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 0.75rem;
}
.session-search-input:focus { outline: none; border-color: var(--accent); }

.session-result {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}
.session-result:last-child { border-bottom: none; }

.session-result-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.session-result-snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.session-result-label {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
    margin-bottom: 0.35rem;
}

/* ─── CALENDAR WEEK VIEW ─── */
.cal-view-toggle {
    display: flex;
    gap: 4px;
    margin-left: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 3px;
}

.cal-view-btn {
    padding: 0.3rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.cal-view-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.cal-week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 1rem;
}

.cal-week-header-cell {
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cal-week-header-cell.today-col {
    color: var(--accent);
}

.cal-week-day-num {
    font-size: 0.9rem;
    font-weight: 600;
}
.cal-week-header-cell.today-col .cal-week-day-num {
    color: var(--accent);
}

.cal-week-time-col {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding-top: 4px;
}

.cal-week-cell {
    background: var(--bg-tertiary);
    border-radius: 6px;
    min-height: 44px;
    padding: 3px;
    position: relative;
}
.cal-week-cell:hover { background: var(--surface-hover); }

.cal-week-ev {
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-week-ev.sched { background: var(--accent-light); color: var(--accent); }
.cal-week-ev.task { background: var(--green-light); color: var(--green); }
.cal-week-ev.task.err { background: var(--red-light); color: var(--red); }

/* ─── TEAM MEETING HISTORY ─── */
.meeting-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

.meeting-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.meeting-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.meeting-type-badge.morning { background: var(--orange-light); color: var(--orange); }
.meeting-type-badge.evening { background: var(--purple-light); color: var(--purple); }

.meeting-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meeting-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.meeting-participants {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.meeting-participant {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: var(--bg-tertiary);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ─── TODO KANBAN ─── */
.todo-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.todo-column { min-width: 0; }

.todo-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.todo-column-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.todo-column-count {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.todo-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow);
}

.todo-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.todo-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.todo-priority {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}
.priority-high { background: var(--red-light); color: var(--red); }
.priority-medium { background: var(--orange-light); color: var(--orange); }
.priority-low { background: var(--green-light); color: var(--green); }

.todo-agent-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
}

.todo-due-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.todo-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.todo-action-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.todo-action-btn:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }
.todo-action-btn.delete:hover { border-color: var(--red); color: var(--red); }

.add-todo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.6rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 0.25rem;
}
.add-todo-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.todo-empty-col {
    text-align: center;
    padding: 1.5rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-sm);
}

/* ─── FORMS ─── */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.btn-primary {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}
.btn-secondary:hover { background: var(--surface-hover); }

/* ─── MODAL ─── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show { display: flex; }

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
}
.modal-close:hover { background: var(--surface-hover); }

/* ─── EMPTY / LOADING ─── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state-text { font-size: 0.9rem; }
.empty-state-hint { font-size: 0.8rem; margin-top: 0.5rem; color: var(--text-muted); }

.loading { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.9rem; }

/* Todo Kanban */
.todo-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.todo-col {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 0.75rem;
    min-height: 200px;
}

.todo-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.todo-col-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.todo-col-count {
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
}

.todo-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.5rem;
}

.todo-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.todo-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

.todo-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.todo-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.todo-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.todo-btn:hover { background: var(--surface-hover); color: var(--text); }
.todo-btn.danger { color: var(--red); border-color: var(--red-light); }
.todo-btn.danger:hover { background: var(--red-light); }

/* Memory Tabs */
.memory-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.5rem;
}

.mem-tab {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}
.mem-tab.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }

/* Session Search */
.session-search {
    margin-bottom: 1rem;
}

.session-search input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}
.session-search input:focus { outline: none; border-color: var(--accent); }

.session-result {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.session-result:hover { border-color: var(--accent); }
.session-result:hover { background: var(--surface-hover); }

.session-result-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.session-result-snippet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── MOBILE ─── */
@media (max-width: 768px) {
    :root { --radius: 12px; --radius-sm: 8px; }
    
    body { overflow: auto; }
    
    .app { flex-direction: column; height: auto; min-height: 100vh; }
    
    .sidebar { display: none; }
    
    .mobile-header { display: flex; }
    
    .mobile-nav { display: flex; }
    
    .content-area { padding: 1rem; }
    
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    
    .stat-value { font-size: 1.5rem; }
    
    .two-col { grid-template-columns: 1fr; }
    
    .three-col { grid-template-columns: 1fr; }
    
    .col-span-2, .col-span-3 { grid-column: span 1; }
    
    .home-greeting { font-size: 1.35rem; }
    
    .section-title { font-size: 1.25rem; }
    
    .quick-actions { gap: 0.4rem; }
    
    .quick-btn { padding: 0.4rem 0.7rem; font-size: 0.75rem; }
    
    .cal-day { min-height: 50px; }
    
    
/* Week Calendar View */
.week-day-col {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.35rem;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.week-day-col:hover { border-color: var(--accent); }

.week-day-col.week-today {
    background: var(--accent-light);
    border-color: var(--accent);
}

.week-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.4rem;
    gap: 2px;
}

.week-day-name {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.week-day-num {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.week-day-num.week-today-num {
    color: var(--accent);
}

.week-day-evs {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.week-ev {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 3px 4px;
    font-size: 0.6rem;
    cursor: pointer;
}

.week-ev.week-ev-sched {
    border-left: 2px solid var(--accent);
    background: var(--accent-light);
}

.week-ev.week-ev-task {
    border-left: 2px solid var(--green);
    background: var(--green-light);
}

.week-ev-time {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.55rem;
}

.week-ev-title {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.week-ev-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.6rem;
    padding: 0.25rem;
}

/* Meeting Cards */
.meeting-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.5rem;
}

.meeting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.meeting-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.meeting-type-badge.morning { background: #ffcc0015; color: #cc9900; }
.meeting-type-badge.evening { background: #007aff15; color: var(--accent); }
.meeting-type-badge.ad-hoc { background: #af52de15; color: var(--purple); }

.meeting-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meeting-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.meeting-participants {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.meeting-participant {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Session Search */
.session-result-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.session-result-item:hover { border-color: var(--accent); }

.session-result-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.session-result-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* App Pipeline card enhancements */
.app-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}
.cal-ev { font-size: 0.52rem; }
    
    .form-row { grid-template-columns: 1fr; }
    
    .todo-columns { grid-template-columns: 1fr; }
    
    .memory-tabs { overflow-x: auto; flex-wrap: nowrap; }
    
    .mem-tab { white-space: nowrap; flex-shrink: 0; }
}

/* Session Cards */
.session-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}

.session-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.session-card:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.session-card-agent {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.session-card-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.session-card-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.session-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.session-card-view {
    color: var(--accent);
    font-weight: 500;
}

/* Session Messages in Modal */
.session-messages {
    background: var(--bg);
    border-radius: 8px;
    padding: 0.75rem;
}

.session-msg {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    max-width: 85%;
}

.session-msg:last-child { margin-bottom: 0; }

.session-msg-user {
    background: var(--surface-hover);
    margin-right: auto;
}

.session-msg-assistant {
    background: var(--accent-light, rgba(99,102,241,0.1));
    margin-left: auto;
}

.session-msg-role {
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

.session-msg-content {
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
