/* ══════════════════════════════════════════════════════════
   JESSE.B // COMMAND CENTER — MINIMAL DARK DASHBOARD
   ══════════════════════════════════════════════════════════ */

:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --widget-max-height: 320px;
    --yt: #ff0000;
    --ig: #e1306c;
    --fb: #1877f2;
    --tt: #00bcd4;
    --gold: #d4a420;
}

html:not([data-theme]), [data-theme="dark"] {
    --bg-main: #0f1117;
    --bg-surface: #161922;
    --bg-card: #1a1d27;
    --bg-card-hover: #1f2230;
    --bg-input: #13151d;
    --bg-overlay: rgba(10,12,20,0.8);
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #4b5563;
    --accent: #3b82f6;
    --accent-hover: #5b9bf7;
    --accent-subtle: rgba(59,130,246,0.10);
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --offline: #374151;
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.14);
    --shadow: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.3);
    --gh: #ffffff;
}

[data-theme="light"] {
    --bg-main: #f8f9fb;
    --bg-surface: #f0f1f4;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f6f8;
    --bg-input: #f0f1f4;
    --bg-overlay: rgba(248,249,251,0.85);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-subtle: rgba(59,130,246,0.06);
    --accent-blue: #3b82f6;
    --accent-purple: #7c3aed;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --offline: #d1d5db;
    --border: rgba(0,0,0,0.08);
    --border-hover: rgba(0,0,0,0.14);
    --shadow: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --gh: #24292f;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
h1, h2, h3, h4 { font-weight: inherit; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

/* ── Body ── */
body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
    position: relative;
}


/* ── Fading Separators ── */
.fade-line-h {
    height: 1px;
    width: 100%;
    background: var(--border);
    margin: 24px 0;
    flex-shrink: 0;
}
.fade-line-v {
    width: 1px; min-width: 1px;
    background: var(--border);
    z-index: 10; flex-shrink: 0;
    transition: width 0.2s ease, min-width 0.2s ease, opacity 0.2s ease;
}
body.sidebar-collapsed .fade-line-v { width: 0; min-width: 0; opacity: 0; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ══════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════ */
.login-shell {
    position: relative;
    z-index: 10;
    flex: 1;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    display: flex; align-items: center;
    gap: 14px; margin-bottom: 6px;
}

.login-brand-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: grid; place-items: center;
    background: var(--accent-subtle);
    border: 1px solid var(--border);
    color: var(--accent); font-size: 18px;
}

.login-card h1 { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); }
.login-eyebrow { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em; }
.login-card > p { color: var(--text-secondary); font-size: 0.85rem; margin: 12px 0 24px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }

.input-group { position: relative; }
.input-group i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.8rem; }
.input-group input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 12px 10px 36px;
    outline: none; font-size: 0.9rem; color: var(--text-primary);
    transition: border-color 0.2s;
}
.input-group input:focus { border-color: rgba(139,92,246,0.4); }

.error-msg {
    color: var(--danger); font-size: 0.8rem;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 6px; padding: 8px 10px;
}

.btn {
    border: none; border-radius: var(--radius-sm); padding: 10px 16px;
    cursor: pointer; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; font-size: 0.9rem; transition: all 0.2s;
}
.primary-btn { background: var(--accent); color: #fff; width: 100%; box-shadow: var(--shadow); }
.primary-btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.ghost-btn { border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary); }
.ghost-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }
.text-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; transition: color 0.2s; padding: 4px; }
.text-btn:hover { color: var(--text-primary); }

/* ══════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════ */
.sidebar {
    width: 280px; min-width: 280px;
    padding: 40px 24px;
    display: flex; flex-direction: column;
    z-index: 10; overflow-y: auto; flex-shrink: 0;
    transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease, opacity 0.2s ease, transform 0.25s ease;
}
body.sidebar-collapsed .sidebar {
    width: 0; min-width: 0;
    padding-left: 0; padding-right: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.profile-section { margin-bottom: 36px; }
.profile-section h1 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; }
.profile-section p { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }

.nav-section { margin-bottom: 28px; }
.nav-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; padding: 0 8px;
}
.nav-header h3 {
    font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-muted); font-weight: 600;
}

.add-btn {
    background: transparent; border: none;
    color: var(--text-muted); font-size: 1.1rem;
    cursor: pointer; transition: color 0.2s; line-height: 1;
    width: 20px; height: 20px;
    display: grid; place-items: center;
}
.add-btn:hover { color: var(--text-primary); }

/* Nav link rows */
.nav-item-wrapper {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 8px; border-radius: var(--radius-sm);
    transition: background 0.2s; margin-bottom: 2px;
}
.nav-item-wrapper:hover { background: var(--bg-card); }

.nav-link {
    color: var(--text-secondary); font-size: 0.88rem;
    flex-grow: 1; display: flex; align-items: center; gap: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item-wrapper:hover .nav-link { color: var(--text-primary); }

.del-btn {
    background: transparent; border: none;
    color: var(--danger); cursor: pointer;
    opacity: 0; font-size: 0.72rem; transition: opacity 0.2s; padding: 0;
    flex-shrink: 0;
}
.nav-item-wrapper:hover .del-btn { opacity: 0.6; }
.del-btn:hover { opacity: 1 !important; }

/* PHP-stored link items in sidebar */
.nav-item-wrapper .link-actions {
    display: flex; gap: 3px;
    opacity: 0; transition: opacity 0.15s;
}
.nav-item-wrapper:hover .link-actions { opacity: 1; }

.link-dot {
    width: 7px; height: 7px; border-radius: 50%;
    flex-shrink: 0;
}

.link-badge-coming {
    font-size: 0.58rem; color: var(--text-muted);
    padding: 1px 4px; border: 1px solid var(--offline);
    border-radius: 3px;
}

.sidebar-taildrop {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.sidebar-taildrop .section-title {
    font-size: 0.82rem;
    margin-bottom: 10px;
}

/* ══════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════ */
.main-content {
    flex: 1; padding: 40px 60px;
    overflow-y: auto; z-index: 10;
}

.header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 10px;
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-greeting-wrap { display: flex; flex-direction: column; gap: 2px; }
.header-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.header h2 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }

.header-right { display: flex; align-items: center; gap: 10px; }

.clock { font-size: 0.95rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ── Sys Indicators ── */
.sys-indicators { display: flex; gap: 6px; margin-right: 4px; }
.sys-ind {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.72rem; color: var(--text-muted);
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.sys-ind-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--offline); flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}
.sys-ind[data-status="online"]  .sys-ind-dot { background: var(--success); box-shadow: 0 0 5px rgba(16,185,129,0.5); }
.sys-ind[data-status="warning"] .sys-ind-dot { background: var(--warning); box-shadow: 0 0 5px rgba(245,158,11,0.5); }
.sys-ind[data-status="error"]   .sys-ind-dot { background: var(--danger);  box-shadow: 0 0 5px rgba(239,68,68,0.5); }

/* ── Header buttons ── */
.hud-btn {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary); border-radius: var(--radius-sm);
    width: 32px; height: 32px; cursor: pointer;
    display: grid; place-items: center;
    font-size: 0.8rem; transition: all 0.2s;
    text-decoration: none; flex-shrink: 0;
}
.hud-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); border-color: var(--border-hover); }

#themeToggle i {
    transition: transform 0.3s ease;
}
#themeToggle:hover i {
    transform: rotate(20deg);
}

.notif-count {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger); color: #fff;
    font-size: 0.55rem; width: 13px; height: 13px;
    border-radius: 50%; display: grid; place-items: center;
}
.notif-count:empty { display: none; }
.notif-count:not(.has-unread) { display: none; }

/* ── Zone Titles ── */
.zone-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 18px;
    padding: 0;
    border: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Section Title ── */
.section-title {
    font-size: 0.9rem; font-weight: 500; margin-bottom: 18px;
    color: var(--text-primary);
    display: flex; justify-content: space-between; align-items: center;
}

/* ══════════════════════════════════════
   DIVIDED GRID & COLUMNS
   ══════════════════════════════════════ */
.divided-grid { display: flex; width: 100%; }

.col {
    flex: 1; padding: 0 28px;
    border-right: 1px solid transparent;
    border-image: linear-gradient(
        180deg,
        transparent 0%,
        var(--border) 12%,
        var(--border) 88%,
        transparent 100%
    ) 1;
}
.col:first-child { padding-left: 0; }
.col:last-child  { padding-right: 0; border-right: none; }

/* Dashboard sections: max 3 columns per row, then wrap */
.section-personal .divided-grid,
.section-clients .divided-grid,
.section-infra .divided-grid,
.section-projects .divided-grid {
    flex-wrap: wrap;
    gap: 20px;
}
.section-personal .divided-grid > .col,
.section-clients .divided-grid > .col,
.section-infra .divided-grid > .col,
.section-projects .divided-grid > .col {
    flex: 0 0 calc((100% - 40px) / 3);
    max-width: calc((100% - 40px) / 3);
    padding: 0;
    border-right: none;
    border-image: none;
}

/* ══════════════════════════════════════
   SOCIAL GRID
   ══════════════════════════════════════ */
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.social-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 16px; border-radius: var(--radius-md);
    transition: border-color 0.15s, background 0.15s;
    box-shadow: var(--shadow);
}
.social-box:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
}
.social-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 8px;
}
.social-val { font-size: 1.3rem; font-weight: 600; color: var(--text-primary); }
.social-sub { font-size: 0.72rem; color: var(--success); margin-top: 3px; }
.brand-dot  { width: 7px; height: 7px; border-radius: 50%; }

/* ══════════════════════════════════════
   DROPZONE
   ══════════════════════════════════════ */
.dropzone {
    border: 1px dashed var(--border-hover); border-radius: var(--radius-md);
    padding: 24px 16px; text-align: center;
    background: var(--bg-surface); color: var(--text-secondary);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: all 0.2s; cursor: pointer; height: 120px;
}
.dropzone:hover {
    border-color: var(--accent-blue);
    background: rgba(59,130,246,0.05);
    color: var(--text-primary);
}
.select-node {
    background: var(--bg-input);
    border: 1px solid var(--border-hover);
    color: var(--text-primary); padding: 4px 28px 4px 8px; border-radius: 6px;
    font-size: 0.72rem; margin-top: 10px; outline: none;
}

#crmWorkspaceSelect,
#taildropTarget {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23c8cfde' d='M5 6 0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
}

#crmWorkspaceSelect {
    min-width: 128px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 4px 28px 4px 8px;
    font-size: 0.72rem;
}

#crmWorkspaceSelect:focus,
#taildropTarget:focus {
    border-color: rgba(59,130,246,0.45);
}

#crmWorkspaceSelect option,
#taildropTarget option {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* ══════════════════════════════════════
   DATA TABLE
   ══════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding-bottom: 10px;
    font-size: 0.72rem; color: var(--text-muted); font-weight: 500;
}
.data-table td {
    padding: 9px 0; font-size: 0.85rem; color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td:first-child { color: var(--text-primary); }
.data-table th:last-child,
.data-table td:last-child { text-align: right; }
.data-table td.good { color: var(--success); }
.data-table td.warn { color: var(--warning); }
.data-table td.bad  { color: var(--danger); }

/* ══════════════════════════════════════
   ITEM LIST
   ══════════════════════════════════════ */
.item-list { display: flex; flex-direction: column; gap: 9px; }
.item-list.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 14px;
}
.list-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.88rem; }
.list-name { color: var(--text-secondary); }

.traffic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.traffic-row.clickable:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow), 0 0 0 1px var(--border-hover);
}
.traffic-domain {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.92rem;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    text-decoration: none;
}
a.traffic-domain:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.traffic-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.traffic-metric {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.traffic-metric i {
    font-size: 0.65rem;
    color: var(--text-muted);
}
.traffic-metric-sep {
    color: var(--text-muted);
    font-size: 0.65rem;
}
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 2px 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.live-badge.live {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.10);
    border: 1px solid rgba(74, 222, 128, 0.20);
}
.live-badge.dead {
    color: #f87171;
    background: rgba(248, 113, 113, 0.10);
    border: 1px solid rgba(248, 113, 113, 0.20);
}
.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.live-badge.live .live-dot {
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
    animation: pulse-live 1.5s ease-in-out infinite;
}
.live-badge.dead .live-dot {
    background: #f87171;
    box-shadow: none;
    animation: none;
}
@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

/* ── Status Text / Dots ── */
.status-text { font-size: 0.78rem; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.status-text.green  { color: var(--success); }
.status-text.red    { color: var(--danger); }
.status-text.yellow { color: var(--warning); }
.status-text.offline { color: var(--text-muted); }

.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--success); box-shadow: 0 0 5px rgba(16,185,129,0.5); }
.dot.red   { background: var(--danger);  box-shadow: 0 0 5px rgba(239,68,68,0.5); }
.dot.offline { background: var(--offline); }

/* ── Status List (docker, n8n, wp) ── */
.status-list { display: flex; flex-direction: column; gap: 7px; }
.status-list li {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.82rem;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.status-list li:hover { background: var(--bg-surface); }
.status-list li span { color: var(--text-secondary); }
.status-list li strong { font-size: 0.75rem; font-weight: 500; }
.status-list li strong.good { color: var(--success); }
.status-list li strong.warn { color: var(--warning); }
.status-list li strong.bad  { color: var(--danger);  }

/* ── Docker compose groups ── */
.status-list li.docker-group { flex-direction: column; align-items: stretch; gap: 5px; }
.docker-group-header { display: flex; justify-content: space-between; align-items: center; }
.docker-group-header a { color: var(--text-primary); text-decoration: none; font-weight: 500; transition: color 0.15s; }
.docker-group-header a:hover { color: var(--accent, #818cf8); }
.docker-group-services { display: flex; flex-direction: column; gap: 3px; padding-left: 10px; border-left: 1px solid var(--border); }
.docker-group-services li { font-size: 0.78rem; }
.docker-group-services li span { color: var(--text-muted, var(--text-secondary)); font-size: 0.78rem; }

/* ══════════════════════════════════════
   RESOURCE BARS
   ══════════════════════════════════════ */
.resource-group { margin-bottom: 8px; }
.resource-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; color: var(--text-secondary);
}
.resource-header span:last-child {
    color: var(--text-primary); font-weight: 500;
    min-width: 4ch; text-align: right;
}
.bar-bg {
    width: 100%; height: 5px;
    background: var(--bg-card); border-radius: 4px; overflow: hidden;
}
.bar-fill {
    height: 100%; background: var(--accent-purple);
    border-radius: 4px; transition: width 0.6s ease;
}
.bar-fill.warn { background: var(--warning); }
.bar-fill.bad  { background: var(--danger); }

/* ══════════════════════════════════════
   SPARKLINE GRAPHS
   ══════════════════════════════════════ */
.sparkline-container {
    flex-grow: 1;
    height: 24px;
    margin: 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.sparkline {
    width: 80px; height: 24px;
}

/* ══════════════════════════════════════
   TASK LIST
   ══════════════════════════════════════ */
.task-list { display: flex; flex-direction: column; gap: 9px; }
.task-item {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.88rem; color: var(--text-secondary);
}
.task-item.done { text-decoration: line-through; opacity: 0.5; }
.task-item input[type="checkbox"] {
    accent-color: var(--accent-blue);
    width: 15px; height: 15px; cursor: pointer; flex-shrink: 0;
}
.task-input {
    width: 100%; background: transparent; border: none;
    border-bottom: 1px dashed var(--border-hover);
    color: var(--text-primary); padding: 8px 0; margin-top: 10px;
    outline: none; font-size: 0.88rem;
}
.task-input::placeholder { color: var(--text-muted); }

/* Task Timer Styles */
.task-text { flex: 1; min-width: 0; }
.task-text-title {
    display: block;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.task-text-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}
.task-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    line-height: 1;
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--bg-card);
}
.task-meta-chip i { font-size: 0.72em; opacity: 0.78; }
.task-meta-chip-project {
    color: var(--accent-blue);
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.22);
}
a.task-meta-chip-project:hover {
    color: #93c5fd;
    background: rgba(59,130,246,0.18);
}
.task-meta-chip-upcoming {
    color: var(--success);
    background: rgba(16,185,129,0.12);
    border-color: rgba(16,185,129,0.2);
}
.task-meta-chip-overdue {
    color: var(--danger);
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.22);
}
.task-meta-chip-backlog {
    color: var(--warning);
    background: rgba(245,158,11,0.12);
    border-color: rgba(245,158,11,0.2);
}
.task-meta-chip-neutral {
    color: var(--text-secondary);
}
.task-timer {
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-muted);
    margin-left: auto;
    min-width: 48px;
    text-align: right;
}
.task-item.timer-active .task-timer { color: var(--accent-blue); }
.task-timer-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 5px;
    font-size: 0.7rem;
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.task-timer-btn:hover { opacity: 1; color: var(--accent-blue); }
.task-timer-btn.reset { opacity: 0.35; }
.task-timer-btn.reset:hover { color: var(--warning); }
.task-item.timer-active { background: rgba(59, 130, 246, 0.06); border-radius: 6px; }

/* ══════════════════════════════════════
   PROJECTS / GITHUB LIST
   ══════════════════════════════════════ */
.project-link {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-primary); transition: color 0.2s;
    font-size: 0.88rem; flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-link:hover { color: var(--accent-blue); }

.badge {
    font-size: 0.62rem; padding: 2px 6px; border-radius: 4px;
    background: var(--bg-card-hover); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
    flex-shrink: 0; margin-left: 8px;
}
.badge.active { background: rgba(16,185,129,0.12); color: var(--success); }
.badge.wip    { background: rgba(245,158,11,0.12); color: var(--warning); }

/* GitHub compact list */
.github-list-compact { display: flex; flex-direction: column; gap: 4px; }
.github-repo-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 8px; border-radius: 5px;
    transition: background 0.15s;
    font-size: 0.82rem; color: var(--text-secondary);
}
.github-repo-row:hover { background: var(--bg-card); color: var(--text-primary); }
.github-repo-row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.github-repo-row-time { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; margin-left: 8px; }

/* GitHub detailed list */
.github-list-detailed { display: flex; flex-direction: column; gap: 6px; }
.github-list-head { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.github-repo-card {
    display: block;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 10px;
    transition: all 0.15s; color: var(--text-secondary);
    box-shadow: var(--shadow);
}
.github-repo-card:hover { background: var(--bg-card); border-color: var(--border-hover); color: var(--text-primary); }
.github-repo-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 5px; }
.github-repo-name { font-size: 0.82rem; font-weight: 500; color: var(--text-primary); }
.github-repo-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.gh-tag { font-size: 0.6rem; padding: 1px 5px; border-radius: 3px; text-transform: uppercase; }
.gh-tag.public   { background: rgba(59,130,246,0.1);  color: var(--accent-blue); }
.gh-tag.private  { background: rgba(139,92,246,0.1);  color: var(--accent-purple); }
.gh-tag.archived { background: rgba(82,82,91,0.3);    color: var(--text-muted); }
.github-repo-desc { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 7px; }
.github-repo-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.7rem; color: var(--text-muted); }
.github-repo-meta span { display: flex; align-items: center; gap: 3px; }
.github-repo-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 5px; }

/* ══════════════════════════════════════
   SCRATCHPAD
   ══════════════════════════════════════ */
textarea.scratchpad {
    width: 100%; height: 120px;
    background: transparent; border: none;
    color: var(--text-primary); font-size: 0.88rem;
    line-height: 1.6; resize: none; outline: none;
}
textarea.scratchpad::placeholder { color: var(--text-muted); }
.save-indicator { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; text-align: right; }

/* ══════════════════════════════════════
   CRM INLINE CONTROLS
   ══════════════════════════════════════ */
.inline-control {
    font-size: 0.72rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 5px;
}
.inline-control select {
    min-width: 120px;
    outline: none;
}

/* ══════════════════════════════════════
   MINI STAT GRID
   ══════════════════════════════════════ */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.stat-grid > div {
    background: var(--bg-surface); border-radius: 7px;
    padding: 9px 11px;
}
.stat-grid span { display: block; font-size: 0.68rem; color: var(--text-muted); margin-bottom: 3px; }
.stat-grid strong { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

/* ══════════════════════════════════════
   DRIVE FILE LIST
   ══════════════════════════════════════ */
.file-list { display: flex; flex-direction: column; gap: 7px; }
.file-list li { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.file-list li i { color: var(--text-muted); width: 12px; flex-shrink: 0; }
.file-list li span { flex: 1; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li small { font-size: 0.68rem; color: var(--text-muted); flex-shrink: 0; }

/* ══════════════════════════════════════
   MISC UTILITIES
   ══════════════════════════════════════ */
.empty-box { color: var(--text-muted); font-size: 0.82rem; padding: 10px 0; }

.widget-scroll {
    max-height: var(--widget-max-height);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.mini-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary); border-radius: var(--radius-sm);
    padding: 3px 8px; font-size: 0.72rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    transition: all 0.15s;
}
.mini-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }

.icon-pill {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary); border-radius: var(--radius-sm);
    padding: 3px 6px; font-size: 0.7rem; cursor: pointer;
    transition: all 0.15s;
}
.icon-pill:hover { color: var(--text-primary); }
.icon-pill.danger { color: var(--danger); }
.icon-pill.danger:hover { background: rgba(239,68,68,0.08); }

.coming-badge {
    font-size: 0.62rem; padding: 1px 5px; border-radius: 3px;
    background: rgba(82,82,91,0.35); color: var(--text-muted);
}

.open-link-btn {
    font-size: 0.72rem; padding: 2px 7px;
    background: rgba(59,130,246,0.08); color: var(--accent-blue);
    border-radius: 4px; border: 1px solid rgba(59,130,246,0.18);
    transition: all 0.15s;
}
.open-link-btn:hover { background: rgba(59,130,246,0.16); }

/* ══════════════════════════════════════
   SIDE PANELS (AI + NOTIFICATIONS)
   ══════════════════════════════════════ */
body.panel-open { overflow: hidden; }

.side-panel {
    position: fixed; right: 0; top: 0; height: 100vh; width: 360px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    backdrop-filter: blur(20px);
    z-index: 200; transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex; flex-direction: column;
}
.side-panel.open { transform: translateX(0); }

.side-panel-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.side-panel-header h2 {
    font-size: 0.9rem; font-weight: 500;
    display: flex; align-items: center; gap: 8px;
}
.side-panel-header-actions { display: flex; align-items: center; gap: 8px; }

.side-panel-body { flex: 1; overflow-y: auto; padding: 14px 18px; }

/* AI Panel */
.ai-panel .side-panel-body { padding: 0; }
.ai-messages {
    flex: 1; overflow-y: auto; padding: 14px 18px;
    display: flex; flex-direction: column; gap: 10px;
}
.ai-message { max-width: 88%; }
.ai-message.user     { align-self: flex-end; }
.ai-message.assistant { align-self: flex-start; }
.ai-message p {
    padding: 9px 13px; border-radius: 9px;
    font-size: 0.82rem; line-height: 1.5;
}
.ai-message.user p { background: var(--accent-purple); color: #fff; }
.ai-message.assistant p {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.ai-message.thinking p { color: var(--text-muted); font-style: italic; }
.ai-form {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex; gap: 7px; flex-shrink: 0;
}
.ai-form input {
    flex: 1; background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px; padding: 7px 11px;
    font-size: 0.82rem; outline: none; color: var(--text-primary);
}
.ai-form input:focus { border-color: rgba(139,92,246,0.35); }
.ai-form button {
    background: var(--accent-purple); border: none; color: #fff;
    border-radius: 6px; width: 32px; height: 32px; cursor: pointer;
    display: grid; place-items: center; font-size: 0.78rem; flex-shrink: 0;
}

/* Notifications */
.notification-item {
    padding: 11px; border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 7px; cursor: pointer; transition: all 0.15s;
    box-shadow: var(--shadow);
}
.notification-item:hover { background: var(--bg-card-hover); }
.notification-item.is-read { opacity: 0.45; }
.notification-item h4 { font-size: 0.72rem; font-weight: 600; margin-bottom: 3px; }
.notification-item p  { font-size: 0.8rem; color: var(--text-secondary); }
.notification-item small { font-size: 0.68rem; color: var(--text-muted); display: block; margin-top: 4px; }
.notification-item.good h4 { color: var(--success); }
.notification-item.warn h4 { color: var(--warning); }
.notification-item.bad  h4 { color: var(--danger); }

/* ══════════════════════════════════════
   LINK MODAL
   ══════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: var(--bg-overlay); backdrop-filter: blur(6px);
    z-index: 300; display: none;
    align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: min(500px, 100%);
    box-shadow: var(--shadow-lg);
}
.modal-head {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 20px;
}
.modal-head h3 {
    font-size: 0.95rem; font-weight: 500;
    display: flex; align-items: center; gap: 7px;
}
.modal-form { display: flex; flex-direction: column; gap: 13px; }
.modal-form label {
    display: flex; flex-direction: column; gap: 5px;
    font-size: 0.75rem; color: var(--text-muted);
}
.modal-form input,
.modal-form select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 7px 10px;
    font-size: 0.85rem; outline: none; color: var(--text-primary);
    transition: border-color 0.2s;
}
.modal-form input:focus,
.modal-form select:focus { border-color: rgba(139,92,246,0.35); }
.modal-form input[type="color"] { height: 36px; padding: 2px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-row.multi { grid-template-columns: 1fr auto; align-items: end; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }

.traffic-token-status {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.traffic-token-status.ok { color: var(--success); }

.traffic-inline-check {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    font-size: 0.76rem !important;
}
.traffic-inline-check input {
    width: auto;
    accent-color: var(--accent-blue);
}

.traffic-sources {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.traffic-source-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}
.traffic-source-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
.traffic-config-error {
    min-height: 1em;
    color: var(--danger);
    font-size: 0.78rem;
}

/* ══════════════════════════════════════
   TRAFFIC DETAIL MODAL
   ══════════════════════════════════════ */
.traffic-row.clickable { cursor: pointer; }

.traffic-detail-card {
    width: min(780px, 100%) !important;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.traffic-detail-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.traffic-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 8px 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s, border-color 0.15s;
}
.traffic-tab:hover { color: var(--text-primary); }
.traffic-tab.active {
    color: var(--text-primary);
    border-bottom-color: rgba(139,92,246,0.6);
}
.traffic-detail-body {
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
}
.td-section {
    margin-bottom: 18px;
}
.td-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.td-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.td-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    box-shadow: var(--shadow);
}
.td-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}
.td-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.td-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.td-table th {
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.td-table th:not(:first-child) { text-align: right; }
.td-table td {
    padding: 5px 8px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}
.td-table td:not(:first-child) { text-align: right; color: var(--text-muted); }
.td-table td:first-child {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.td-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
    padding: 4px 0;
}
.td-spark-bar {
    flex: 1;
    min-width: 0;
    background: rgba(139,92,246,0.4);
    border-radius: 2px 2px 0 0;
    position: relative;
    transition: background 0.15s;
}
.td-spark-bar:hover { background: rgba(139,92,246,0.7); }
.td-spark-bar .spark-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
}
.td-spark-bar:hover .spark-tip { display: block; }
.td-spark-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.td-tab-content { display: none; }
.td-tab-content.active { display: block; }
.td-empty {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 24px 0;
}

/* ══════════════════════════════════════
   IDEAS MODAL + DETAIL PANEL
   ══════════════════════════════════════ */
.idea-modal-overlay {
    position: fixed; inset: 0;
    background: var(--bg-overlay); backdrop-filter: blur(6px);
    z-index: 300; display: none;
    align-items: center; justify-content: center; padding: 24px;
}
.idea-modal-overlay.open { display: flex; }

.idea-modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg); width: min(480px, 100%);
    overflow: hidden; position: relative;
}
.idea-modal-accent { height: 3px; background: var(--accent-blue); }
.idea-modal-header {
    padding: 16px 20px 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.idea-modal-header h3 { font-size: 0.9rem; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.idea-modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.88rem; }
.idea-modal-body { padding: 0 20px 14px; display: flex; flex-direction: column; gap: 11px; }
.idea-form-group { display: flex; flex-direction: column; gap: 4px; }
.idea-form-label { font-size: 0.72rem; color: var(--text-muted); }
.idea-form-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px; padding: 7px 10px; font-size: 0.82rem;
    outline: none; color: var(--text-primary);
}
.idea-form-input:focus { border-color: rgba(59,130,246,0.35); }
textarea.idea-form-input { min-height: 70px; resize: vertical; line-height: 1.5; }
.idea-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.idea-modal-error { color: var(--danger); font-size: 0.78rem; display: none; }
.idea-modal-error.show { display: block; }
.idea-modal-footer {
    padding: 11px 20px 16px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* Idea Detail Panel */
.idea-detail-overlay {
    position: fixed; inset: 0; background: var(--bg-overlay); z-index: 190; display: none;
}
.idea-detail-overlay.open { display: block; }
.idea-detail-panel {
    position: fixed; right: 0; top: 0; height: 100vh; width: 360px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    z-index: 195; transform: translateX(100%);
    transition: transform 0.25s ease; display: flex; flex-direction: column;
}
.idea-detail-panel.open { transform: translateX(0); }
.idea-detail-accent { height: 3px; flex-shrink: 0; }
.idea-detail-header { padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.idea-detail-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.idea-detail-header-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.idea-detail-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.85rem; }
.idea-detail-title-input { width: 100%; background: none; border: none; color: var(--text-primary); font-size: 0.95rem; font-weight: 500; outline: none; }
.idea-detail-body { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 14px; }
.idea-detail-section { display: flex; flex-direction: column; gap: 5px; }
.idea-detail-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.idea-detail-select,
.idea-detail-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 5px; padding: 6px 9px; font-size: 0.82rem;
    outline: none; color: var(--text-primary);
}
.idea-detail-textarea {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 5px; padding: 9px; font-size: 0.82rem;
    outline: none; color: var(--text-primary);
    resize: none; min-height: 90px; line-height: 1.5;
}
.idea-save-indicator { font-size: 0.68rem; text-align: right; color: var(--text-muted); min-height: 14px; }
.idea-save-indicator.saving { color: var(--warning); }
.idea-save-indicator.saved  { color: var(--success); }
.idea-save-indicator.error  { color: var(--danger); }
.idea-detail-footer {
    padding: 11px 18px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; flex-shrink: 0;
}
.idea-delete-btn {
    background: none; border: 1px solid rgba(239,68,68,0.3);
    color: var(--danger); border-radius: 6px;
    padding: 6px 11px; cursor: pointer;
    font-size: 0.78rem; display: flex; align-items: center; gap: 5px; transition: all 0.15s;
}
.idea-delete-btn:hover { background: rgba(239,68,68,0.1); }
.idea-close-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary); border-radius: 6px;
    padding: 6px 14px; cursor: pointer; font-size: 0.78rem; transition: all 0.15s;
}
.idea-close-btn:hover { color: var(--text-primary); }

/* Idea rows in ideas list */
.ideas-list { display: flex; flex-direction: column; gap: 4px; }
.idea-row {
    width: 100%; display: flex; align-items: center;
    justify-content: space-between; padding: 7px 9px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    cursor: pointer; text-align: left;
    transition: all 0.15s; gap: 7px;
    box-shadow: var(--shadow);
}
.idea-row:hover { background: var(--bg-card); }
.idea-row-title {
    font-size: 0.82rem; color: var(--text-secondary);
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.idea-badges  { display: flex; gap: 3px; flex-shrink: 0; }
.idea-badge   { font-size: 0.58rem; padding: 1px 4px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.ib-idea        { background: rgba(59,130,246,0.12);  color: var(--accent-blue); }
.ib-in-progress { background: rgba(245,158,11,0.12);  color: var(--warning); }
.ib-done        { background: rgba(16,185,129,0.12);  color: var(--success); }
.ib-archived    { background: rgba(82,82,91,0.2);     color: var(--text-muted); }
.ib-high        { background: rgba(239,68,68,0.12);   color: var(--danger); }
.ib-medium      { background: rgba(245,158,11,0.08);  color: var(--warning); }
.ib-low         { background: rgba(82,82,91,0.14);    color: var(--text-muted); }

.count-pill {
    font-size: 0.65rem; padding: 1px 5px; border-radius: 9px;
    background: var(--bg-card-hover); color: var(--text-muted);
}

/* ══════════════════════════════════════
   TASK DETAIL PANEL
   ══════════════════════════════════════ */
.detail-overlay {
    position: fixed; inset: 0; background: var(--bg-overlay); z-index: 190; display: none;
}
.detail-overlay.open { display: block; }
.task-detail-panel {
    position: fixed; right: 0; top: 0; height: 100vh; width: 420px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    z-index: 195; transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
}
.task-detail-panel.open { transform: translateX(0); }
.task-detail-accent { height: 3px; background: var(--accent-blue); flex-shrink: 0; }
.task-detail-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.task-detail-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.task-detail-header-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.task-detail-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 18px; cursor: pointer; transition: color 0.15s;
    padding: 2px 4px; border-radius: 6px;
}
.task-detail-close:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.task-detail-title-input {
    width: 100%; background: none; border: none;
    color: var(--text-primary); font-size: 1.1rem; font-weight: 500;
    outline: none; line-height: 1.2;
}
.task-detail-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.task-detail-body::-webkit-scrollbar { width: 4px; }
.task-detail-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.task-detail-section { display: flex; flex-direction: column; gap: 8px; }
.task-detail-label {
    font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
}
.task-detail-select,
.task-detail-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 12px;
    font-size: 0.875rem; outline: none;
    color: var(--text-primary);
    transition: border-color 0.15s;
}
.task-detail-select:focus,
.task-detail-input:focus {
    border-color: rgba(59,130,246,0.4);
}
.task-detail-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px; padding: 12px 14px;
    font-size: 0.875rem; outline: none;
    color: var(--text-primary);
    resize: vertical; min-height: 120px; line-height: 1.5;
    transition: border-color 0.15s;
    font-family: 'Inter', sans-serif;
}
.task-detail-textarea:focus { border-color: rgba(59,130,246,0.4); }
.task-save-indicator {
    font-size: 0.75rem; color: var(--text-muted);
    min-height: 16px; transition: color 0.2s;
}
.task-save-indicator.saving { color: var(--warning); }
.task-save-indicator.saved  { color: var(--success); }
.task-save-indicator.error  { color: var(--danger); }
.task-detail-project-meta {
    min-height: 32px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.task-detail-project-empty {
    color: var(--text-muted);
    font-size: 0.84rem;
}
.task-detail-footer {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; flex-shrink: 0;
}
.task-delete-btn {
    background: none; border: 1px solid rgba(239,68,68,0.3);
    color: var(--danger); border-radius: 8px;
    padding: 8px 14px; cursor: pointer;
    font-size: 0.875rem; display: flex; align-items: center; gap: 6px;
    transition: all 0.15s;
}
.task-delete-btn:hover { background: rgba(239,68,68,0.1); }
.task-close-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary); border-radius: 8px;
    padding: 8px 18px; cursor: pointer; font-size: 0.875rem;
    transition: all 0.15s;
}
.task-close-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }

/* ══════════════════════════════════════
   DASHBOARD SECTIONS
   ══════════════════════════════════════ */
.section-personal,
.section-clients,
.section-infra,
.section-projects {
    position: relative;
    padding: 10px 0 14px;
}

/* ══════════════════════════════════════
   FAVICON IMAGES in sidebar
   ══════════════════════════════════════ */
.nav-favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.85;
    display: block;
}

.nav-favicon-placeholder {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: var(--bg-card-hover);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: var(--text-muted);
}

.nav-custom-icon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: var(--bg-card-hover);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
}

/* ══════════════════════════════════════
   RESPONSIVE — Tablet (≤1100px)
   ══════════════════════════════════════ */
@media (max-width: 1100px) {
    .sidebar { width: 220px; min-width: 220px; padding: 28px 16px; }
    .main-content { padding: 28px 28px; }
    .section-personal,
    .section-clients,
    .section-infra,
    .section-projects { padding: 9px 0 12px; }
    .col { padding: 0 18px; }
    .section-personal .divided-grid > .col,
    .section-clients .divided-grid > .col,
    .section-infra .divided-grid > .col,
    .section-projects .divided-grid > .col {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
        padding: 0;
    }
    .header h2 { font-size: 1.5rem; }
    .sys-indicators { display: none; }
    .calendar-widget { padding: 10px 8px; }
    .calendar-day-name { font-size: 0.62rem; padding: 3px 0; }
    .calendar-day { min-height: 30px; padding: 3px 1px; }
}

/* ══════════════════════════════════════
   RESPONSIVE — Mobile (≤768px)
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    .traffic-detail-card { width: 100% !important; max-height: 90vh; }
    .td-stat-row { grid-template-columns: 1fr 1fr; }
    .td-table td:first-child { max-width: 160px; }

    body {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    /* Sidebar becomes a collapsible drawer */
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        z-index: 500;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        background: var(--bg-surface);
        backdrop-filter: blur(20px);
        border-right: 1px solid var(--border);
        width: 260px; min-width: 260px;
        overflow-y: auto;
    }
    body.sidebar-collapsed .sidebar {
        width: 260px; min-width: 260px;
        padding: 40px 24px;
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-backdrop {
        display: none;
        position: fixed; inset: 0;
        background: var(--bg-overlay);
        z-index: 490;
        backdrop-filter: blur(3px);
    }
    .sidebar-backdrop.open { display: block; }

    .fade-line-v { display: none; }

    .main-content {
        flex: none;
        width: 100%;
        height: auto;
        overflow: visible;
        padding: 16px;
    }

    .header { flex-wrap: wrap; gap: 8px; }
    .header-left { gap: 8px; }
    .header h2 { font-size: 1.3rem; }
    .header-right { flex-wrap: wrap; gap: 6px; }
    .clock { display: none; }

    /* Mobile menu button */
    .sidebar-toggle {
        display: flex !important;
    }

    /* Divided grid stacks vertically */
    .divided-grid {
        flex-direction: column;
        gap: 24px;
    }
    .col {
        padding: 0;
        border-right: none;
        border-image: none;
    }
    .col + .col {
        padding-top: 20px;
        border-top: 1px solid var(--border);
    }
    .section-personal .divided-grid > .col,
    .section-clients .divided-grid > .col,
    .section-infra .divided-grid > .col,
    .section-projects .divided-grid > .col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .section-personal,
    .section-clients,
    .section-infra,
    .section-projects { padding: 8px 0 10px; }
    .item-list.metrics-grid { grid-template-columns: 1fr; }
    .widget-scroll {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .traffic-source-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ambient-glow { display: none; }

    .side-panel { width: 100%; }
    .project-detail-panel { width: 100%; }
    .project-detail-edit-grid { grid-template-columns: 1fr; }
    .project-detail-edit-grid .span-2 { grid-column: auto; }
    .project-detail-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .project-detail-footer-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Sidebar toggle button */
.sidebar-toggle {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    width: 32px; height: 32px;
    cursor: pointer;
    align-items: center; justify-content: center;
    font-size: 12px;
    padding: 0;
    flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.sidebar-toggle.active {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

/* ── Social Growth Indicator ── */
.social-growth { font-size: 0.72rem; margin-top: 3px; line-height: 1; }
.social-growth.growth-up { color: #22c55e; }
.social-growth.growth-down { color: #ef4444; }
.social-growth.growth-flat { color: var(--text-muted); }

/* ── Social Detail Modal ── */
.social-modal-card {
    width: 100%;
    max-width: 680px;
    min-width: 320px;
}
.social-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.social-modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.social-stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    transition: background 0.15s, border-color 0.15s;
    box-shadow: var(--shadow);
}
.social-stat-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}
.social-stat-item.active {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}
.social-stat-item.active .social-stat-val {
    color: var(--text-primary);
}
.social-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.social-stat-val {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}
.social-modal-chart-section {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}
.social-modal-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.social-modal-chart-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.chart-range-btns {
    display: flex;
    gap: 4px;
}
.chart-range-btn {
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.chart-range-btn:hover,
.chart-range-btn.active {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}
.social-chart-wrap {
    position: relative;
    height: 200px;
    border-radius: 6px;
    overflow: hidden;
}
.social-chart-wrap canvas {
    width: 100% !important;
    height: 200px !important;
    display: block;
    border-radius: 6px;
    background: var(--bg-input);
}
.social-modal-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-size: 0.85rem;
    gap: 8px;
    background: var(--bg-input);
    border-radius: 6px;
}

/* ══════════════════════════════════════
   CALENDAR WIDGET
   ══════════════════════════════════════ */
.section-calendar { padding: 9px 0 13px; }


.calendar-widget {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    margin-bottom: 8px;
}

.calendar-day-name {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 4px 0;
    font-weight: 500;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    min-height: 36px;
    min-width: 0;
    overflow: hidden;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day:not(.empty):hover {
    background: var(--bg-card);
}

.calendar-day.today {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid var(--accent-blue);
}

.calendar-day.has-events {
    background: var(--bg-card);
}

.calendar-day-num {
    font-size: clamp(0.64rem, 0.35vw + 0.52rem, 0.78rem);
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1;
}

.calendar-day.today .calendar-day-num {
    color: var(--accent-blue);
}

.calendar-event-dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
    flex-wrap: wrap;
    justify-content: center;
}

.calendar-event-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-events-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 2px;
    width: 100%;
    overflow: hidden;
}

.calendar-event-item {
    font-size: 0.65rem;
    padding: 1px 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid;
    cursor: pointer;
    transition: background 0.15s;
}

.calendar-event-item:hover {
    background: var(--bg-card-hover);
}

/* Full Calendar Modal */
.full-calendar-container {
    padding: 12px;
}

.full-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.full-calendar-grid .calendar-day {
    min-height: 80px;
    aspect-ratio: unset;
    align-items: flex-start;
    padding: 6px;
}

.full-calendar-grid .calendar-day-num {
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.full-calendar-grid .calendar-events-list {
    gap: 2px;
}

.full-calendar-grid .calendar-event-item {
    font-size: 0.72rem;
    padding: 2px 6px;
}

/* Task Panel (Tasks Without Dates) */
.task-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.task-without-date-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-surface);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: var(--shadow);
}

.task-without-date-item:hover {
    background: var(--bg-card);
}

.task-without-date-priority {
    width: 3px;
    height: 100%;
    min-height: 24px;
    border-radius: 2px;
    flex-shrink: 0;
}

.task-without-date-content {
    flex: 1;
    min-width: 0;
}

.task-without-date-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-without-date-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Upcoming Events */
.upcoming-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.upcoming-event-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-surface);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: var(--shadow);
}

.upcoming-event-item:hover {
    background: var(--bg-card);
}

.upcoming-event-color {
    width: 3px;
    height: 100%;
    min-height: 24px;
    border-radius: 2px;
    flex-shrink: 0;
}

.upcoming-event-content {
    flex: 1;
    min-width: 0;
}

.upcoming-event-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-event-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ══════════════════════════════════════
   RESPONSIVE — Small Desktop (≤1400px)
   ══════════════════════════════════════ */
@media (max-width: 1400px) and (min-width: 1101px) {
    .main-content { padding: 36px 40px; }
    .section-personal,
    .section-clients,
    .section-infra,
    .section-projects { padding: 9px 0 13px; }
    .col { padding: 0 20px; }
}

/* ══════════════════════════════════════
   REPLY BADGE STYLES
   ══════════════════════════════════════ */
.email-badge.eb-replied {
    background: rgba(251,191,36,0.15); color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.35);
}
.reply-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.35);
    margin-left: 5px;
}
.reply-indicator i {
    font-size: 9px;
}
.list-reply-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.35);
    margin-left: 5px;
    vertical-align: middle;
}

/* ─── PROJECTS GRID ─── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    padding: 4px 0;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    min-height: 146px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--pc-color, var(--accent-blue)), transparent 75%);
    opacity: 0.9;
}

.project-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.project-card-brand {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.project-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.project-card.active {
    border-color: rgba(59,130,246,0.4);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.16), 0 12px 30px rgba(0,0,0,0.28);
}

.project-card--create {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9em;
    min-height: 112px;
    border-style: dashed;
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

.project-card--create:hover {
    border-color: rgba(59,130,246,0.4);
    color: var(--accent-blue);
}

.project-detail-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 299;
    display: none;
}

.project-detail-overlay.open { display: block; }

.project-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(460px, 100vw);
    height: 100vh;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 300;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.project-detail-panel.open { transform: translateX(0); }

.project-detail-strip {
    height: 3px;
    background: var(--accent-blue);
    flex-shrink: 0;
}

.project-detail-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.project-detail-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-detail-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.project-detail-emoji {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}

.project-detail-title-wrap {
    min-width: 0;
    flex: 1;
}

.project-detail-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-detail-type {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.project-detail-header-actions,
.project-detail-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.project-detail-edit-btn,
.project-detail-ghost-btn,
.project-detail-primary-btn,
.project-detail-danger-btn {
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.project-detail-edit-btn,
.project-detail-ghost-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.project-detail-edit-btn:hover,
.project-detail-ghost-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.project-detail-edit-btn.active {
    color: var(--accent-blue);
    border-color: rgba(59,130,246,0.36);
    background: rgba(59,130,246,0.12);
}

.project-detail-primary-btn {
    background: var(--accent-blue);
    border: 1px solid rgba(59,130,246,0.45);
    color: #fff;
}

.project-detail-primary-btn:hover { filter: brightness(1.06); }

.project-detail-danger-btn {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: var(--danger);
}

.project-detail-danger-btn:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
}

.project-detail-btn-sm {
    padding: 7px 12px;
    font-size: 11px;
    white-space: nowrap;
}

.project-detail-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.project-detail-close:hover { color: var(--text-primary); }

.project-detail-sections {
    flex: 1;
    overflow-y: auto;
}

.project-detail-sections::-webkit-scrollbar { width: 4px; }
.project-detail-sections::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 10px;
}

.project-detail-body {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.project-detail-body:last-child { border-bottom: none; }

.project-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.project-detail-value {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.project-detail-value.empty,
.project-detail-summary-empty {
    color: var(--text-muted);
    line-height: 1.6;
}

.project-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-detail-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.74rem;
    white-space: nowrap;
}

.project-detail-meta-pill.status-active {
    background: rgba(16,185,129,0.12);
    border-color: rgba(16,185,129,0.18);
    color: #10b981;
}

.project-detail-meta-pill.status-planning {
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.18);
    color: #60a5fa;
}

.project-detail-meta-pill.status-on-hold {
    background: rgba(139,92,246,0.12);
    border-color: rgba(139,92,246,0.18);
    color: #a78bfa;
}

.project-detail-meta-pill.status-completed {
    background: rgba(16,185,129,0.12);
    border-color: rgba(16,185,129,0.18);
    color: #34d399;
}

.project-detail-meta-pill.status-archived {
    background: rgba(113,113,122,0.18);
    border-color: rgba(113,113,122,0.24);
    color: #a1a1aa;
}

.project-detail-quick-links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.project-detail-link-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.project-detail-link-icon:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.project-detail-summary-copy {
    margin-top: 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.project-detail-editor {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-detail-form-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.project-detail-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.project-detail-form-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.project-detail-form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 11px 14px;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.project-detail-form-input:focus {
    border-color: rgba(59,130,246,0.5);
    background: var(--bg-card);
}

.project-detail-form-input::placeholder { color: var(--text-muted); }

textarea.project-detail-form-input {
    resize: vertical;
    min-height: 88px;
}

.project-detail-inline-hint {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.5;
    margin-top: -6px;
}

.project-detail-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.project-detail-edit-grid .span-2 { grid-column: 1 / -1; }

.project-detail-emoji-picker-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
}

.project-detail-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-detail-color-option {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
}

.project-detail-color-option.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.16);
}

.project-detail-todo-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.project-detail-todo-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.project-detail-task-progress {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--bg-card-hover);
    overflow: hidden;
}

.project-detail-task-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #8b5cf6);
    border-radius: inherit;
    transition: width 0.2s ease;
}

.project-detail-task-count {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.project-detail-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-detail-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.project-detail-task-item input[type="checkbox"] {
    accent-color: var(--accent-blue);
    flex-shrink: 0;
}

.project-detail-task-title {
    flex: 1;
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.4;
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.project-detail-task-item.done .project-detail-task-title {
    color: var(--text-muted);
    text-decoration: line-through;
}

.project-detail-task-meta {
    max-width: 240px;
    color: var(--text-muted);
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-detail-task-delete {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-detail-task-delete:hover {
    background: rgba(239,68,68,0.12);
    color: var(--danger);
}

.project-detail-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.project-card--create::before {
    display: none;
}

.project-card--create i {
    font-size: 1.2em;
}

.project-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--pc-color, var(--accent-blue)) 16%, transparent);
    color: var(--pc-color, var(--accent-blue));
    font-size: 1em;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc-color, var(--accent-blue)) 20%, transparent);
}

.project-card-head {
    flex: 1;
    min-width: 0;
}

.project-card-name {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-primary);
    line-height: 1.3;
}

.project-card-sub {
    margin-top: 3px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-card-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.project-card-description {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.project-card-footer-note {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.project-card-links {
    display: flex;
    gap: 6px;
}

.project-link-indicator {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.75em;
}

.project-status-badge {
    display: inline-block;
    font-size: 0.68em;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    border-radius: 999px;
}

.project-status-badge.pc-active {
    background: rgba(16,185,129,0.15);
    color: #10b981;
    border: 1px solid rgba(16,185,129,0.3);
}

.project-status-badge.pc-paused {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
    border: 1px solid rgba(245,158,11,0.3);
}

.project-status-badge.pc-planning {
    background: rgba(59,130,246,0.15);
    color: #3b82f6;
    border: 1px solid rgba(59,130,246,0.3);
}

.project-status-badge.pc-archived {
    background: rgba(107,114,128,0.15);
    color: #6b7280;
    border: 1px solid rgba(107,114,128,0.3);
}

/* ─── PROJECT DETAIL VIEW ─── */
.project-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.project-detail-name {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.project-detail-desc {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin: 4px 0 0;
}

.project-detail-status-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.82em;
}

.project-detail-section {
    min-height: 60px;
}

.project-detail-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.project-detail-row {
    font-size: 0.85em;
    color: var(--text-secondary);
    display: flex;
    gap: 6px;
    align-items: center;
}

.project-detail-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.project-detail-row a {
    color: var(--accent-blue);
    text-decoration: none;
}

.project-detail-row a:hover {
    text-decoration: underline;
}

.project-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85em;
}

.project-list-item:last-child {
    border-bottom: none;
}

/* ─── PROJECT MODAL FORM ─── */
#projectModal .form-row {
    display: flex;
    gap: 12px;
}

#projectModal .form-row label {
    flex: 1;
}

#projectModal input[type="color"] {
    height: 36px;
    width: 50px;
    padding: 2px;
    border-radius: 6px;
    cursor: pointer;
}

#projectModal textarea {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.9em;
    resize: vertical;
    font-family: inherit;
}

#projectModal select {
    width: 100%;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.9em;
}

/* ─── PROJECT SIDE PANEL ─── */
.side-panel-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 399;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.side-panel-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 400;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-panel.open {
    transform: translateX(0);
}

.side-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
}

.side-panel-header h3 {
    flex: 1;
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-panel-edit-toggle {
    font-size: 0.82em;
    padding: 6px 10px;
}

.side-panel-header select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.82em;
}

.side-panel-header .close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5em;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.side-panel-header .close-btn:hover {
    color: var(--text-primary);
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.panel-section {
    border-bottom: 1px solid var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}

.section-header:hover {
    background: var(--bg-card);
}

.section-header.section-header-static {
    cursor: default;
}

.section-header.section-header-static:hover {
    background: transparent;
}

.section-header span {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-header .add-section-btn {
    font-size: 0.8em;
    color: var(--accent-blue);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
}

.section-header .add-section-btn:hover {
    text-decoration: underline;
}

.section-content {
    padding: 0 16px 16px;
}

.section-content textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    font-size: 0.9em;
    resize: vertical;
    font-family: inherit;
}

.section-content input[type="url"],
.section-content input[type="text"] {
    width: 100%;
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.9em;
}

/* Projects workbench layout */
.projects-workbench {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.projects-top-grid,
.projects-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
    gap: 18px;
}

.projects-surface,
.projects-task-workspace {
    border: none;
    background: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.projects-surface-head,
.projects-task-workspace-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0 10px;
    border-bottom: none;
}

.projects-surface-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.projects-surface-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.projects-surface-title .count-pill {
    margin-left: 8px;
}

.projects-surface-actions,
.projects-task-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.projects-surface-note {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.projects-surface-body {
    padding: 0;
}

.projects-calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.82fr);
    gap: 16px;
    padding: 0;
}

.calendar-side-rail {
    border-left: 1px solid var(--border);
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.calendar-side-rail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.calendar-side-rail-title {
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 600;
}

.projects-workspace-copy {
    margin: 10px 0 0;
    max-width: 70ch;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.projects-task-flow-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
}

.projects-flow-lane {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    padding: 0;
    border-radius: 0;
    border: none;
    background: none;
}

.projects-flow-lane--backlog {
    background: none;
}

.projects-flow-lane--schedule {
    background: none;
}

.projects-flow-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.projects-flow-title {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.projects-flow-copy {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.projects-flow-callout,
.projects-flow-schedule-preview {
    border: none;
    background: none;
    border-radius: 0;
    padding: 4px 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.55;
}

.projects-flow-schedule-preview {
    margin-top: auto;
}

.projects-flow-schedule-preview-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 6px;
}

.projects-flow-schedule-preview-copy {
    color: var(--text-muted);
}

.projects-surface--scratchpad {
    display: flex;
    flex-direction: column;
}

.projects-surface--scratchpad .scratchpad {
    margin: 0;
    min-height: 180px;
}

.projects-surface--ideas .ideas-list {
    padding: 0;
}

@media (max-width: 1200px) {
    .projects-top-grid,
    .projects-bottom-grid,
    .projects-calendar-layout,
    .projects-task-flow-grid {
        grid-template-columns: 1fr;
    }

    .calendar-side-rail {
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 16px;
    }
}

@media (max-width: 768px) {
    .projects-surface-head,
    .projects-task-workspace-head,
    .calendar-side-rail-head,
    .projects-flow-head {
        flex-direction: column;
        align-items: stretch;
    }

    .projects-surface-actions,
    .projects-task-legend {
        justify-content: flex-start;
    }
}

/* Simple create modal for projects */
#createProjectModal {
    width: 400px;
}

#createProjectModal h3 {
    margin: 0 0 16px;
    font-size: 1.1em;
}

#createProjectModal input[type="text"] {
    width: 100%;
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 1em;
    margin-bottom: 16px;
}

#createProjectModal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ── Task Status Pills (project task list) ── */
.task-status-pill {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.task-status-pill-planned    { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.task-status-pill-in_progress{ background: rgba(245,158,11,0.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.task-status-pill-to_review  { background: rgba(139,92,246,0.18); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }

/* ── Project Detail Panel — Slider ── */
/* The panel is display:flex + flex-direction:column + overflow:hidden.
   The color strip is flex-shrink:0. The slider fills the rest. */
.pdp-slider {
    display: flex;
    width: 200%;
    flex: 1;
    min-height: 0;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.pdp-slider.task-open { transform: translateX(-50%); }

.pdp-layer {
    width: 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    min-height: 0;
}

/* Main layer: header is shrink-0, sections scroll, footer shrink-0 */
#pdpMainLayer .project-detail-header  { flex-shrink: 0; }
#pdpMainLayer .project-detail-sections { flex: 1; min-height: 0; overflow-y: auto; }
#pdpMainLayer .project-detail-footer  { flex-shrink: 0; }

/* ── Task Drill-down Layer ── */
.pdp-task-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.pdp-back-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.18s;
    flex-shrink: 0;
}
.pdp-back-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }

.pdp-task-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pdp-task-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdp-task-status {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    width: fit-content;
}
.pdp-task-status-new        { background: var(--bg-card-hover); color: #71717a; border: 1px solid var(--border); }
.pdp-task-status-planned    { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.pdp-task-status-in_progress{ background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.pdp-task-status-to_review  { background: rgba(139,92,246,0.18); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }

.pdp-task-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.pdp-task-content::-webkit-scrollbar { width: 4px; }
.pdp-task-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.pdp-task-fields {
    padding: 16px 18px 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}
.pdp-field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pdp-field-label {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.pdp-field-input,
.pdp-field-select,
.pdp-field-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.86rem;
    padding: 8px 10px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.18s;
}
.pdp-field-input:focus,
.pdp-field-select:focus,
.pdp-field-textarea:focus {
    outline: none;
    border-color: rgba(59,130,246,0.45);
}
.pdp-field-textarea { resize: vertical; min-height: 64px; }

/* ── AI Planner ── */
.pdp-ai-planner {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    min-height: 0;
}
.pdp-ai-planner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    flex-shrink: 0;
}
.pdp-ai-thinking {
    font-size: 0.72rem;
    font-weight: 500;
    color: #60a5fa;
    text-transform: none;
    letter-spacing: 0;
    animation: none;
}
.pdp-ai-chat {
    flex: 1;
    overflow-y: auto;
    padding: 0 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}
.pdp-ai-chat::-webkit-scrollbar { width: 3px; }
.pdp-ai-chat::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.pdp-ai-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
    padding: 20px 8px;
}
.pdp-ai-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.pdp-ai-msg-user { flex-direction: row-reverse; }
.pdp-ai-msg-bubble {
    max-width: 88%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 0.84rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.pdp-ai-msg-user .pdp-ai-msg-bubble {
    background: rgba(59,130,246,0.2);
    border: 1px solid rgba(59,130,246,0.28);
    color: var(--text-primary);
    border-bottom-right-radius: 3px;
}
.pdp-ai-msg-assistant .pdp-ai-msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 3px;
}
.pdp-ai-msg-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    margin-top: 2px;
}
.pdp-ai-msg-assistant .pdp-ai-msg-icon {
    background: rgba(139,92,246,0.2);
    color: #a78bfa;
    border: 1px solid rgba(139,92,246,0.25);
}

/* plan text block inside AI bubble */
.pdp-plan-block {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 8px;
    font-size: 0.82rem;
    white-space: pre-wrap;
    color: #d1fae5;
}

.pdp-ai-input-wrap {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding: 8px 14px 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.pdp-ai-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.84rem;
    padding: 9px 12px;
    font-family: inherit;
    resize: none;
    line-height: 1.45;
    transition: border-color 0.18s;
}
.pdp-ai-input:focus { outline: none; border-color: rgba(59,130,246,0.4); }
.pdp-ai-send {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--accent-blue);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: filter 0.18s;
}
.pdp-ai-send:hover { filter: brightness(1.1); }
.pdp-ai-send:disabled { opacity: 0.45; cursor: default; filter: none; }

.pdp-ai-plan-bar {
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(16,185,129,0.06);
    border-top: 1px solid rgba(16,185,129,0.18);
    flex-shrink: 0;
}
.pdp-ai-plan-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pdp-ai-plan-bar .project-detail-primary-btn {
    background: #10b981;
    border-color: rgba(16,185,129,0.4);
    align-self: flex-start;
}
.pdp-ai-plan-bar .project-detail-primary-btn:hover { filter: brightness(1.08); }

/* ── To-review indicator in task list ── */
.project-detail-task-item.to-review {
    border-color: rgba(139,92,246,0.25);
    background: rgba(139,92,246,0.05);
}

/* ── Subtasks section inside task drill-down ── */
.pdp-subtasks {
    padding: 0 18px 12px;
    flex-shrink: 0;
}
.pdp-subtasks-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.pdp-subtasks-label {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pdp-subtasks-label .pdp-subtasks-count {
    background: var(--bg-card-hover);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 0.6rem;
    color: var(--text-muted);
}
.pdp-subtask-add-btn {
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.18s;
}
.pdp-subtask-add-btn:hover { color: var(--text-primary); border-color: var(--border-hover); }

.pdp-subtask-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
}
.pdp-subtask-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: border-color 0.18s;
}
.pdp-subtask-item:hover { border-color: var(--border); }
.pdp-subtask-item input[type="checkbox"] {
    accent-color: var(--accent-blue);
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}
.pdp-subtask-title {
    flex: 1;
    font-size: 0.83rem;
    color: var(--text-primary);
    line-height: 1.35;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdp-subtask-item.done .pdp-subtask-title {
    color: var(--text-muted);
    text-decoration: line-through;
}
.pdp-subtask-status {
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.pdp-subtask-status-planned    { background: rgba(59,130,246,0.15); color: #60a5fa; }
.pdp-subtask-status-to_review  { background: rgba(139,92,246,0.18); color: #a78bfa; }
.pdp-subtask-delete {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
}
.pdp-subtask-item:hover .pdp-subtask-delete { opacity: 1; }
.pdp-subtask-delete:hover { background: rgba(239,68,68,0.12); color: #ef4444; }

.pdp-subtask-add-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}
.pdp-subtask-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 0.83rem;
    padding: 6px 9px;
    font-family: inherit;
}
.pdp-subtask-input:focus { outline: none; border-color: rgba(59,130,246,0.5); }
.pdp-subtask-save-btn {
    height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    border: none;
    background: var(--accent-blue);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}
.pdp-subtask-cancel-btn {
    height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

/* ── Project Detail Panel: Section header with add button ── */
.project-detail-section-header {
    display: flex; align-items: center; justify-content: space-between;
}

/* ── Project Detail Panel: Section count badge ── */
.pdp-section-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 10px; font-size: 11px; font-weight: 600;
    background: var(--bg-card-hover); color: var(--text-muted);
    margin-left: 6px;
}

/* ── Project Detail Panel: Events Section ── */
.pdp-events-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.pdp-event-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 6px;
    font-size: 13px; color: var(--text-primary);
    transition: background 0.15s;
}
.pdp-event-item:hover { background: var(--bg-card); }
.pdp-event-item.past { opacity: 0.5; }
.pdp-event-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent);
}
.pdp-event-item.past .pdp-event-dot { background: var(--text-muted); }
.pdp-event-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdp-event-date { flex-shrink: 0; font-size: 11px; color: var(--text-muted); }

/* ── Project Detail Panel: Ideas Section ── */
.pdp-ideas-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.pdp-idea-item {
    display: flex; gap: 10px; padding: 8px 10px; border-radius: 6px;
    transition: background 0.15s;
}
.pdp-idea-item:hover { background: var(--bg-card); }
.pdp-idea-icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(250,204,21,0.1); color: #facc15; font-size: 13px;
}
.pdp-idea-content { flex: 1; min-width: 0; }
.pdp-idea-title {
    font-size: 13px; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.pdp-idea-desc {
    font-size: 12px; color: var(--text-muted);
    margin-top: 2px; line-height: 1.4;
}
.pdp-idea-status {
    font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600;
    background: var(--bg-card-hover); color: var(--text-muted);
    text-transform: capitalize; white-space: nowrap;
}

/* ── Project Detail Panel: SEO Section ── */
.pdp-seo-domain {
    font-size: 13px; color: var(--text-primary);
    margin-top: 4px; margin-bottom: 10px;
    padding: 6px 10px; border-radius: 6px;
    background: var(--bg-card);
    font-family: monospace;
}
.pdp-seo-metrics {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.pdp-seo-metric {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 8px; border-radius: 8px;
    background: var(--bg-card); border: 1px solid var(--border);
}
.pdp-seo-metric-val {
    font-size: 20px; font-weight: 700; color: var(--text-primary);
}
.pdp-seo-metric-label {
    font-size: 11px; color: var(--text-muted);
    margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Light theme adjustments ── */
[data-theme="light"] .project-card {
    background: var(--bg-card);
    box-shadow: var(--shadow);
}
[data-theme="light"] .project-card:hover {
    background: var(--bg-card);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
[data-theme="light"] .project-card::before {
    opacity: 0.7;
}
[data-theme="light"] .sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
}
[data-theme="light"] .calendar-day.today {
    background: var(--accent-subtle);
    border-color: var(--accent);
}
[data-theme="light"] .dropzone {
    border-color: var(--border-hover);
}
[data-theme="light"] .status-list li strong.good { color: var(--success); }
[data-theme="light"] .status-list li strong.warn { color: var(--warning); }
[data-theme="light"] .status-list li strong.bad { color: var(--danger); }
