/* =============================================
   COMMAND CENTER v1.0
   Personal Life + Business Operating System
   Built by Jason Williams + Jerry
   ============================================= */

:root {
    /* Notion Second Brain colour palette */
    --accent: #2383e2;        /* Notion blue */
    --accent-light: #529cca;
    --accent-bg: rgba(35, 131, 226, 0.08);
    --green: #0f7b6c;
    --green-bg: rgba(15, 123, 108, 0.1);
    --amber: #d9730d;
    --amber-bg: rgba(217, 115, 13, 0.1);
    --red: #e03e3e;
    --red-bg: rgba(224, 62, 62, 0.1);
    --gold: #c29343;
    --blue-section: #d3e5ef;   /* Notion blue_bg header */

    /* Layout - Notion warm tones */
    --sidebar-bg: #f7f6f3;
    --sidebar-text: rgba(55, 53, 47, 0.65);
    --sidebar-active: #37352f;
    --page-bg: #ffffff;
    --card-bg: #ffffff;
    --border: #e9e9e7;
    --text: #37352f;
    --text-secondary: #787774;
    --text-muted: #9b9a97;
    --shadow: 0 1px 3px rgba(55,53,47,0.06);
    --shadow-md: 0 4px 12px rgba(55,53,47,0.06);
    --radius: 8px;
    --sidebar-w: 240px;
}

/* === LOGIN SCREEN === */
#login-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #2f3437;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
#login-screen.hidden { display: none; }

.login-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 48px 40px;
    width: 360px;
    text-align: center;
}
.login-logo {
    width: 64px; height: 64px;
    background: var(--accent);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    color: white;
    margin: 0 auto 20px;
}
.login-title {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.login-subtitle {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    font-style: italic;
    margin-bottom: 32px;
}
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-form input {
    padding: 12px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
#login-form input:focus { border-color: var(--accent); }
#login-form input::placeholder { color: rgba(255,255,255,0.3); }
#login-btn {
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}
#login-btn:hover { background: var(--accent-light); }
#login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
#login-error {
    color: var(--red);
    font-size: 12px;
    min-height: 18px;
}

/* === RESET === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--page-bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
}

/* === SIDEBAR (Notion-style light) === */
#sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.25s ease;
    border-right: 1px solid var(--border);
}

.sidebar-header {
    padding: 16px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 28px; height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.logo-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

/* Nav Links */
.nav-links {
    list-style: none;
    padding: 4px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s;
}
.nav-link:hover { color: var(--text); background: rgba(55,53,47,0.04); }
.nav-link.active { color: var(--text); background: rgba(55,53,47,0.08); font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

/* Sidebar Sections */
.sidebar-section {
    padding: 8px 8px 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 10px 4px;
    text-transform: uppercase;
}

.domain-list, .area-list { list-style: none; }

.domain-link, .area-link {
    display: block;
    padding: 5px 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.15s;
}
.domain-link:hover, .area-link:hover { color: var(--text); background: rgba(55,53,47,0.04); }
.domain-link.active { color: var(--accent); font-weight: 600; }
.area-link .area-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}
.version { font-size: 10px; color: var(--text-muted); }

/* === MAIN CONTENT === */
#content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
}

/* Top Bar */
#topbar {
    background: var(--card-bg);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
#menu-toggle {
    display: none;
    background: none; border: none;
    font-size: 22px; cursor: pointer;
    color: var(--text);
}
#page-title { font-size: 16px; font-weight: 700; }
#current-date { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* Quick Add */
#quick-add {
    padding: 12px 28px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
}
#quick-add-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
#quick-add-input:focus { border-color: var(--accent); }
#quick-add-input::placeholder { color: var(--text-muted); }
#quick-add-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
#quick-add-btn:hover { background: var(--accent-light); }

/* Sections */
.section { display: none; padding: 24px 28px; }
.section.active { display: block; }

/* === CARDS (Notion-style) === */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}
.card-header {
    padding: 10px 16px;
    background: var(--blue-section);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.card-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(255,255,255,0.6);
    padding: 2px 10px;
    border-radius: 20px;
}
.card-body { padding: 14px 16px; }
.card.wide { grid-column: 1 / -1; }

/* === GREETING === */
.greeting {
    padding: 24px 0 20px;
}
.greeting h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.greeting p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* === TODAY GRID === */
.today-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}
.today-left, .today-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === TASK ITEMS === */
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: default;
}
.task-item:last-child { border-bottom: none; }

.task-check {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
    color: transparent;
}
.task-check:hover { border-color: var(--accent); }
.task-check.done {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.task-content { flex: 1; min-width: 0; }
.task-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    display: block;
}
.task-text.done {
    text-decoration: line-through;
    color: var(--text-muted);
}
.task-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.task-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.tag-personal { background: var(--accent-bg); color: var(--accent); }
.tag-ductdudes { background: rgba(15, 123, 108, 0.1); color: var(--green); }
.tag-urgent { background: var(--red-bg); color: var(--red); }
.tag-waiting { background: var(--amber-bg); color: var(--amber); }

.task-delete {
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover { color: var(--red); }

/* === HABIT ITEMS === */
.habit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.habit-item:last-child { border-bottom: none; }

.habit-check {
    width: 28px; height: 28px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: transparent;
    transition: all 0.2s;
}
.habit-check:hover { border-color: var(--green); background: var(--green-bg); }
.habit-check.done {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.habit-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}
.habit-streak {
    font-size: 11px;
    font-weight: 700;
    color: var(--amber);
}

/* === STREAK DISPLAY === */
.streak-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.streak-item:last-child { border-bottom: none; }
.streak-name { font-size: 13px; color: var(--text-secondary); }
.streak-count {
    font-size: 18px;
    font-weight: 800;
    color: var(--gold);
}
.streak-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 4px;
    font-weight: 500;
}

/* === STATS / METRICS === */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-value { font-size: 16px; font-weight: 700; color: var(--gold); }

/* === PROJECT CARDS === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.project-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
}
.status-active { background: var(--green-bg); color: var(--green); }
.status-urgent { background: var(--red-bg); color: var(--red); }
.status-pending { background: var(--amber-bg); color: var(--amber); }
.status-waiting { background: rgba(155,154,151,0.15); color: var(--text-muted); }
.status-wip { background: var(--accent-bg); color: var(--accent); }
.status-completed { background: var(--green-bg); color: var(--green); }
.status-archived { background: rgba(155,154,151,0.15); color: var(--text-muted); }

.project-meta {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
}
.project-tasks-list { padding-top: 4px; }

/* === COVEY MATRIX === */
.covey-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: calc(100vh - 200px);
}
.quadrant .card-header { padding: 10px 16px; }
.q1 .card-header { border-left: 4px solid var(--red); }
.q2 .card-header { border-left: 4px solid var(--green); }
.q3 .card-header { border-left: 4px solid var(--amber); }
.q4 .card-header { border-left: 4px solid var(--text-muted); }

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--card-bg);
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
    box-shadow: var(--shadow);
}
.view-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.view-btn.active { background: var(--accent); color: white; }
.view-btn:hover:not(.active) { background: var(--page-bg); }

/* Task Filter Tabs */
.task-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.filter-tab {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.filter-tab.active .filter-count {
    background: rgba(255,255,255,0.25);
    color: white;
}
.filter-count {
    font-size: 10px;
    font-weight: 700;
    background: var(--page-bg);
    padding: 1px 7px;
    border-radius: 10px;
}

/* Task View Toggle */
.task-view { display: none; }
.task-view.active { display: block; }

/* Habits Layout */
.habits-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Week Grid */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.week-day {
    text-align: center;
    padding: 8px;
}
.week-day-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.week-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    margin: 0 auto 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}
.week-dot.completed { background: var(--green); color: white; }
.week-dot.missed { background: var(--red-bg); color: var(--red); }
.week-dot.future { background: var(--page-bg); color: var(--text-muted); }
.week-dot.today { border: 2px solid var(--accent); background: var(--accent-bg); color: var(--accent); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* === HABITS VIEWS === */
.habits-view { display: none; }
.habits-view.active { display: block; }

.habits-day-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.day-nav-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px; height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.day-nav-btn:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

/* Week Matrix */
.week-matrix { width: 100%; border-collapse: collapse; }
.week-matrix th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 4px;
    text-align: center;
}
.week-matrix th:first-child { text-align: left; padding-left: 0; }
.week-matrix td { padding: 6px 4px; text-align: center; }
.week-matrix td:first-child {
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    padding-left: 0;
    white-space: nowrap;
}
.week-matrix tr { border-bottom: 1px solid var(--border); }
.week-matrix tr:last-child { border-bottom: none; }

.week-cell {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 2px solid var(--border);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: all 0.15s;
}
.week-cell:hover { border-color: var(--green); background: var(--green-bg); }
.week-cell.done { background: var(--green); border-color: var(--green); color: white; }
.week-cell.future { opacity: 0.3; cursor: default; }
.week-cell.today-cell { border-color: var(--accent); }

/* Month Calendar */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.month-header-cell {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 0;
}
.month-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}
.month-day:hover { background: var(--accent-bg); }
.month-day.today-cell { border: 2px solid var(--accent); color: var(--accent); font-weight: 700; }
.month-day.other-month { opacity: 0.25; }
.month-day.future { opacity: 0.4; cursor: default; }
.month-day .month-day-num { margin-bottom: 2px; }
.month-day .month-day-bar {
    width: 20px; height: 3px;
    border-radius: 2px;
    background: var(--border);
}
.month-day .month-day-bar.full { background: var(--green); }
.month-day .month-day-bar.partial { background: var(--amber); }
.month-day .month-day-bar.none { background: var(--red); }
.month-day.selected { background: var(--accent-bg); outline: 2px solid var(--accent); }

/* === CALENDAR === */
.cal-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.cal-add-btn {
    padding: 8px 18px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.cal-add-btn:hover { background: var(--accent-light); }

.cal-view { display: none; }
.cal-view.active { display: block; }

/* Calendar Event Items */
.cal-event-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--page-bg);
    cursor: pointer;
    transition: all 0.15s;
}
.cal-event-item:hover { background: var(--accent-bg); }
.cal-event-item:last-child { margin-bottom: 0; }

.cal-event-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 70px;
    white-space: nowrap;
}
.cal-event-content { flex: 1; min-width: 0; }
.cal-event-title {
    font-size: 13px;
    font-weight: 600;
    display: block;
}
.cal-event-location {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}
.cal-event-desc {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Calendar Task Items */
.cal-task-item { cursor: default; }
.cal-task-item .task-check { cursor: pointer; }

/* Calendar Week Grid */
.cal-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}
.cal-week-header {
    text-align: center;
    padding: 8px 4px 12px;
    border-bottom: 1px solid var(--border);
}
.cal-week-header.today-col { background: var(--accent-bg); border-radius: 8px 8px 0 0; }
.cal-week-dayname {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: block;
}
.cal-week-daynum {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}
.cal-week-daynum.today-num {
    color: var(--accent);
    background: var(--accent-bg);
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cal-week-col {
    min-height: 120px;
    padding: 8px 4px;
    border-right: 1px solid var(--border);
}
.cal-week-col:last-child { border-right: none; }

.cal-week-event {
    padding: 4px 6px;
    margin-bottom: 4px;
    border-radius: 4px;
    background: var(--accent-bg);
    cursor: pointer;
    transition: background 0.15s;
}
.cal-week-event:hover { background: rgba(99, 102, 241, 0.15); }
.cal-week-event-time {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    display: block;
}
.cal-week-event-title {
    font-size: 11px;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Calendar Month Grid */
.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-month-dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
    align-items: center;
}
.cal-event-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-month-more {
    font-size: 8px;
    color: var(--text-muted);
    font-weight: 700;
}

/* Today Events Mini Cards */
.cal-event-item-mini {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: var(--page-bg);
    display: flex;
    align-items: center;
    gap: 10px;
}
.cal-event-item-mini:last-child { margin-bottom: 0; }
.cal-mini-time {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 55px;
}
.cal-mini-title {
    font-size: 13px;
    font-weight: 500;
}

/* === WEATHER WIDGET === */
.weather-current {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.weather-temp {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.weather-condition {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}
.weather-icon {
    font-size: 32px;
    line-height: 1;
}
.weather-details {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.weather-forecast {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.weather-day {
    flex: 1;
    text-align: center;
}
.weather-day-name {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: block;
}
.weather-day-icon {
    font-size: 18px;
    display: block;
    margin: 4px 0;
}
.weather-day-temps {
    font-size: 11px;
    color: var(--text-secondary);
}
.weather-day-high { font-weight: 700; }
.weather-day-low { color: var(--text-muted); }

/* === EVENT MODAL === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-card {
    background: var(--card-bg);
    border-radius: 16px;
    width: 440px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}
#event-modal-close {
    background: none; border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
}
#event-modal-close:hover { color: var(--text); }

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--card-bg);
    color: var(--text);
}
.modal-input:focus { border-color: var(--accent); }
.modal-textarea {
    resize: vertical;
    min-height: 60px;
}
.modal-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.modal-time-sep {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.modal-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}
.modal-checkbox input[type="checkbox"] { cursor: pointer; }
.modal-color {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}
.modal-section { margin-top: 4px; }
.modal-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Reminder Chips */
.reminder-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.reminder-chip {
    padding: 5px 12px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.reminder-chip:hover { border-color: var(--accent); color: var(--accent); }
.reminder-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.reminder-custom-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.reminder-num-input { width: 60px; }
.reminder-unit-select { width: 100px; }
.reminder-add-btn {
    padding: 8px 14px;
    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    white-space: nowrap;
}
.reminder-add-btn:hover { background: var(--accent-bg); color: var(--accent); }

.custom-reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-top: 6px;
    background: var(--page-bg);
    border-radius: 6px;
    font-size: 12px;
}
.custom-reminder-remove {
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}
.custom-reminder-remove:hover { color: var(--red); }

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-btn-save {
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
}
.modal-btn-save:hover { background: var(--accent-light); }
.modal-btn-delete {
    padding: 10px 20px;
    background: var(--red-bg);
    color: var(--red);
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.modal-btn-delete:hover { background: rgba(239, 68, 68, 0.2); }

/* === EMAIL === */
.email-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.email-toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.email-toolbar-btn {
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.email-toolbar-btn:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.email-status {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Email List */
.email-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
}
.email-item:hover { background: var(--accent-bg); }
.email-item:last-child { border-bottom: none; }
.email-unread { font-weight: 600; }
.email-unread .email-from { font-weight: 700; }
.email-unread .email-subject { font-weight: 600; color: var(--text); }

.email-item-left { flex-shrink: 0; }
.email-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.email-item-content { flex: 1; min-width: 0; }
.email-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.email-from {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.email-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.email-subject {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.email-snippet {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Email Connect Prompt */
.email-connect-prompt {
    text-align: center;
    padding: 40px 20px;
}
.email-connect-prompt p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.email-connect-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
}
.email-connect-btn:hover { background: var(--accent-light); }

/* Email Detail */
.email-detail-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.email-detail-subject {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}
.email-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.email-detail-from {
    display: flex;
    align-items: center;
    gap: 10px;
}
.email-from-full {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.email-detail-body { margin-top: 16px; }
.email-body-frame {
    width: 100%;
    min-height: 300px;
    border: none;
    background: white;
    border-radius: 8px;
}
.email-body-text {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Email Actions */
.email-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 12px;
}
.email-action-btn {
    padding: 8px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.email-action-btn:hover { background: var(--accent-light); }
.email-action-archive {
    background: var(--page-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.email-action-archive:hover {
    background: var(--amber-bg);
    color: var(--amber);
    border-color: var(--amber);
}

/* Reply Form */
.email-reply-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

/* Sent Indicator */
.email-sent-indicator {
    padding: 8px 16px;
    background: var(--green-bg);
    color: var(--green);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
    text-align: center;
}

/* === JERRY CHAT === */
#jerry-fab {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 56px; height: 56px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(35,131,226,0.35);
    z-index: 200;
    transition: all 0.2s;
}
#jerry-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(35,131,226,0.45); }
#jerry-fab.hidden { display: none; }

#jerry-panel {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 380px;
    height: 520px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    z-index: 201;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
}
#jerry-panel.open { display: flex; }

.jerry-header {
    padding: 14px 16px;
    background: #2f3437;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.jerry-header-left { display: flex; align-items: center; gap: 10px; }
.jerry-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}
.jerry-title { font-size: 14px; font-weight: 700; }
#jerry-close {
    background: none; border: none;
    color: rgba(255,255,255,0.5);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
}
#jerry-close:hover { color: white; }

#jerry-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jerry-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}
.jerry-msg-bot {
    background: var(--page-bg);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.jerry-msg-user {
    background: var(--accent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.jerry-msg-typing {
    background: var(--page-bg);
    color: var(--text-muted);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    font-style: italic;
}

.jerry-input-row {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}
#jerry-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
#jerry-input:focus { border-color: var(--accent); }
#jerry-send {
    width: 40px; height: 40px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#jerry-send:hover { background: var(--accent-light); }

/* === NOTES === */
.notes-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.notes-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.notes-filter-tab, .resources-filter-tab {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.notes-filter-tab:hover, .resources-filter-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.notes-filter-tab.active, .resources-filter-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.notes-filter-tab.active .filter-count,
.resources-filter-tab.active .filter-count {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* Notes Grid - Card Layout */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.note-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.note-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.note-type-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}
.note-date {
    font-size: 11px;
    color: var(--text-muted);
}
.note-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}
.note-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}
.note-card-footer {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.note-meta-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-bg);
    color: var(--accent);
}

/* === RESOURCES === */
.resources-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.resource-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.resource-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.resource-card-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.resource-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}
.resource-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.resource-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}
.resource-url {
    font-size: 11px;
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.resource-card-footer {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Resource Tag Chips in Modal */
.resource-tag-chip {
    padding: 5px 12px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.resource-tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.resource-tag-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* === PILLAR LABELS in sidebar === */
.pillar-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 6px 10px 2px;
    text-transform: uppercase;
    list-style: none;
}

/* === EXPANDED PROJECT STATUSES === */
.status-not-started { background: rgba(155,154,151,0.15); color: var(--text-muted); }
.status-in-progress { background: var(--accent-bg); color: var(--accent); }
.status-on-hold { background: rgba(233, 168, 176, 0.2); color: #c4554d; }

/* Expanded project card */
.project-expanded { border-color: var(--accent); box-shadow: var(--shadow-md); }
.project-card-toggle:hover { background: rgba(35,131,226,0.12); }
.project-more-tasks {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    padding: 6px 0;
    cursor: pointer;
}
.project-folder-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.project-folder-link:hover { text-decoration: underline; }
.project-clickable:hover { background: var(--accent-bg); }

/* === PROJECT DETAIL VIEW === */
.project-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.project-detail-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.project-detail-props {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.project-prop {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-width: 200px;
    flex: 1;
    font-size: 13px;
}
.project-prop-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    min-width: 70px;
}

.project-objective-card {
    margin-bottom: 20px;
}

.project-ops-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.project-detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}
.project-tab, .project-note-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.project-tab:hover, .project-note-tab:hover {
    color: var(--text);
}
.project-tab.active, .project-note-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.project-add-btn {
    padding: 4px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.project-add-btn:hover {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent);
}

/* Resource mini cards in project detail */
.resource-mini-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.15s;
}
.resource-mini-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.resource-mini-card:last-child { margin-bottom: 0; }

/* Note mini rows in project detail */
.note-mini-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.note-mini-row:last-child { border-bottom: none; }
.note-mini-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}
.note-mini-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); box-shadow: 2px 0 8px rgba(0,0,0,0.1); }
    #sidebar.open { transform: translateX(0); }
    #content { margin-left: 0; }
    #menu-toggle { display: block; }
    .today-grid { grid-template-columns: 1fr; }
    .covey-grid { grid-template-columns: 1fr; }
    .section { padding: 16px; }
    #topbar { padding: 12px 16px; }
    #quick-add { padding: 10px 16px; }

    .project-ops-grid { grid-template-columns: 1fr; }
    .cal-week-grid { gap: 0; font-size: 10px; }
    .cal-week-col { min-height: 80px; padding: 4px 2px; }
    .cal-week-daynum { font-size: 13px; }
    .cal-top-row { flex-wrap: wrap; gap: 10px; }

    .modal-card { width: 100%; margin: 8px; }

    #jerry-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 80px);
        bottom: 8px; right: 8px;
    }
    #jerry-fab { bottom: 16px; right: 16px; width: 48px; height: 48px; font-size: 18px; }
}
