/* ============================================
   TABS — Tab-specific style overrides
   ============================================ */

/* ---- Activity Feed ---- */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-md);
    padding: var(--sp-sm) 0;
    border-bottom: 1px solid rgba(100, 120, 200, 0.06);
    font-size: 0.85rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 60px;
}

/* ---- Priority List ---- */
.priority-item {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    padding: var(--sp-sm) var(--sp-md);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-sm);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.priority-item:hover {
    border-color: var(--glass-border-hover);
}

.priority-number {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--accent-light);
    min-width: 20px;
}

/* ---- Revenue Tab ---- */
.revenue-chart-container {
    width: 100%;
    height: 250px;
    position: relative;
}

.revenue-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: var(--sp-md);
    height: 200px;
    padding-top: var(--sp-md);
}

.revenue-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-xs);
}

.revenue-bar {
    width: 100%;
    max-width: 60px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: linear-gradient(to top, var(--accent), var(--accent-light));
    transition: height 0.8s var(--ease-out);
    min-height: 4px;
    position: relative;
}

.revenue-bar-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.revenue-bar-value {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---- Client Table ---- */
.client-table {
    width: 100%;
    border-collapse: collapse;
}

.client-table th {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    padding: var(--sp-sm) var(--sp-md);
    border-bottom: 1px solid var(--glass-border);
}

.client-table td {
    font-size: 0.85rem;
    padding: var(--sp-sm) var(--sp-md);
    border-bottom: 1px solid rgba(100, 120, 200, 0.05);
    vertical-align: middle;
}

.client-table tr:hover td {
    background: rgba(100, 120, 200, 0.04);
}

/* ---- Agent Grid ---- */
.agent-card {
    cursor: pointer;
}

.agent-card:hover {
    border-color: var(--accent);
}

.agent-card .agent-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.agent-card .agent-role {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: var(--sp-sm);
}

.agent-card .agent-model {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ---- Meeting Cards ---- */
.meeting-card {
    cursor: pointer;
}

.meeting-card .meeting-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.meeting-card .meeting-time {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.meeting-card .meeting-attendees {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: var(--sp-xs);
}

.meeting-expanded {
    margin-top: var(--sp-md);
    padding-top: var(--sp-md);
    border-top: 1px solid var(--glass-border);
    display: none;
}

.meeting-card.expanded .meeting-expanded {
    display: block;
    animation: fadeIn 0.3s var(--ease-out);
}

/* ---- Intel ---- */
.intel-categories {
    display: flex;
    gap: var(--sp-sm);
    flex-wrap: wrap;
    margin-bottom: var(--sp-lg);
}

.intel-filter-btn {
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.intel-filter-btn:hover,
.intel-filter-btn.active {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-light);
    border-color: rgba(108, 92, 231, 0.3);
}

.intel-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-md);
}

.intel-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.intel-item-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: var(--sp-xs);
}

.intel-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

/* ---- Notes Tab ---- */
.notes-area {
    width: 100%;
    min-height: 400px;
    font-family: var(--font);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-lg);
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
}

.notes-area:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.notes-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--sp-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Decisions List ---- */
.decision-item {
    padding: var(--sp-md);
    margin-bottom: var(--sp-sm);
}

.decision-question {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.decision-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: var(--sp-xs);
}

.decision-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ---- Calendar Screen ---- */
.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--sp-lg);
    flex-wrap: wrap;
    gap: var(--sp-md);
}

.cal-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-title {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    font-size: 1.3rem;
    font-weight: 700;
}

.cal-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.cal-header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

.cal-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cal-nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
}

.cal-nav-range {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    min-width: 180px;
    text-align: center;
}

/* Always Running bar */
.cal-recurring {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    padding: var(--sp-md) var(--sp-lg);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-lg);
    flex-wrap: wrap;
}

.cal-recurring-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.cal-recurring-pills {
    display: flex;
    gap: var(--sp-sm);
    flex-wrap: wrap;
}

.cal-recurring-pill {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    border: 1px solid;
    background: rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* Week grid */
.cal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 400px;
}

.cal-day {
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.cal-day-today {
    background: rgba(108, 92, 231, 0.06);
}

.cal-day-today .cal-day-header {
    background: rgba(108, 92, 231, 0.12);
}

.cal-day-today .cal-day-name {
    color: var(--accent-light);
}

.cal-day-today .cal-day-num {
    background: var(--accent);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-sm) var(--sp-sm);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.15);
}

.cal-day-name {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.cal-day-num {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.cal-day-body {
    flex: 1;
    padding: var(--sp-xs);
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
    overflow-y: auto;
}

.cal-day-empty {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    padding: var(--sp-lg) var(--sp-xs);
    opacity: 0.5;
}

/* Calendar task cards */
.cal-card {
    padding: 6px 8px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    animation: fadeIn 0.3s var(--ease-out) both;
}

.cal-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cal-card-done {
    opacity: 0.5;
}

.cal-card-done .cal-card-title {
    text-decoration: line-through;
}

.cal-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cal-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 4px;
}

.cal-card-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cal-card-assignee {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* Google Calendar event cards */
.cal-event-card {
    padding: 6px 8px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.25);
    border-left: 3px solid #0ea5e9;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.cal-event-card:hover {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.45);
}

.cal-event-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #7dd3fc;
    line-height: 1.3;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-event-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cal-event-time {
    font-size: 0.68rem;
    color: #38bdf8;
    font-weight: 500;
}

.cal-event-location {
    font-size: 0.62rem;
    color: #7dd3fc;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

/* Calendar responsive */
@media (max-width: 900px) {
    .cal-week {
        grid-template-columns: repeat(7, minmax(100px, 1fr));
        overflow-x: auto;
    }
}

@media (max-width: 640px) {
    .cal-header {
        flex-direction: column;
    }

    .cal-header-right {
        width: 100%;
        justify-content: space-between;
    }

    .cal-week {
        grid-template-columns: repeat(7, minmax(90px, 1fr));
    }

    .cal-day {
        min-height: 250px;
    }
}

/* ---- Team Screen ---- */
.team-mission {
    padding: var(--sp-lg) var(--sp-xl);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(0, 206, 201, 0.08));
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-xl);
    text-align: center;
}

.team-mission-quote {
    font-size: 1.05rem;
    font-weight: 500;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.6;
}

.team-header {
    text-align: center;
    margin-bottom: var(--sp-xl);
}

.team-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.team-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--sp-lg);
    margin-bottom: var(--sp-2xl);
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--sp-lg);
    transition: all var(--transition-normal);
    animation: fadeIn 0.3s var(--ease-out) both;
}

.team-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.team-card-planned {
    opacity: 0.55;
}

.team-card-header {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    margin-bottom: var(--sp-md);
}

.team-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

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

.team-card-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.team-card-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.team-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.3s;
}

.team-status-dot.team-status-working {
    animation: teamStatusPulse 1.5s ease-in-out infinite;
}

@keyframes teamStatusPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--warning); }
    50% { box-shadow: 0 0 6px 2px var(--warning); }
}

.team-working-label {
    font-size: 0.7rem;
    color: var(--warning);
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.team-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--sp-md);
}

.team-card-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--sp-md);
}

.team-skill-tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid;
    background: rgba(0, 0, 0, 0.2);
}

.team-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-md);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.team-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Org chart */
.team-org {
    margin-top: var(--sp-xl);
    text-align: center;
}

.team-org-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--sp-lg);
}

.team-org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.team-org-node {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: var(--sp-sm) var(--sp-lg);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
}

.team-org-node span {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
}

.team-org-top {
    border-color: var(--accent);
}

.team-org-dimmed {
    opacity: 0.4;
}

.team-org-line {
    width: 2px;
    height: 24px;
    background: var(--glass-border);
}

.team-org-row {
    display: flex;
    gap: var(--sp-lg);
    position: relative;
}

.team-org-row::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 80px);
    height: 2px;
    background: var(--glass-border);
}

.team-archetype-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border: 1px solid;
    border-radius: 999px;
    margin-right: 6px;
}

.team-trigger-badge {
    display: inline-block;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--glass-bg);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
}

@media (max-width: 640px) {
    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-mission {
        padding: var(--sp-md);
    }

    .team-mission-quote {
        font-size: 0.9rem;
    }
}

/* ---- Team Detail Panel ---- */

.team-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.team-detail-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}
.team-detail-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.team-detail-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}
.team-detail-close:hover { color: var(--text); }

.team-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.team-detail-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.team-detail-model {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}

.team-detail-section {
    margin-bottom: 1rem;
}
.team-detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}
.team-detail-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.team-detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1rem;
}
.team-detail-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.team-detail-tab:hover { color: var(--text); }
.team-detail-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.team-detail-tab-content {
    max-height: calc(100vh - 380px);
    overflow-y: auto;
}

.team-detail-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 1rem 0;
}

/* Skills tab */
.team-detail-skill {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(100,120,200,0.06);
}
.team-detail-skill:last-child { border-bottom: none; }
.team-detail-skill-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-transform: capitalize;
    margin-bottom: 0.3rem;
}
.team-detail-skill-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.team-detail-keyword {
    font-size: 0.68rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

/* Tools tab */
.team-detail-tool-cat {
    margin-bottom: 0.75rem;
}
.team-detail-tool-cat-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid rgba(100,120,200,0.06);
}
.team-detail-tool {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.25rem 0;
}
.team-detail-tool-name {
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
}
.team-detail-tool-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* TOOLS.md doc tab */
.team-detail-doc {
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.6;
    padding-bottom: 1rem;
}
.team-doc-h1 { font-size: 1.1rem; font-weight: 700; margin: 1rem 0 0.5rem; color: var(--text); }
.team-doc-h2 { font-size: 0.95rem; font-weight: 600; margin: 0.75rem 0 0.3rem; color: var(--text); }
.team-doc-h3 { font-size: 0.85rem; font-weight: 600; margin: 0.5rem 0 0.2rem; color: var(--text-secondary); }
.team-detail-doc code {
    background: var(--bg-card);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.75rem;
    border: 1px solid var(--glass-border);
}
.team-detail-doc li {
    margin-left: 1rem;
    list-style: disc;
    margin-bottom: 0.2rem;
}

/* ---- Memory Screen ---- */
.mem-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1px;
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 500px;
}

.mem-sidebar {
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 75vh;
}

.mem-sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-md) var(--sp-md);
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--glass-border);
}

.mem-sidebar-stats {
    padding: var(--sp-sm) var(--sp-md);
    font-size: 0.72rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

.mem-sidebar-list {
    flex: 1;
    overflow-y: auto;
}

.mem-sidebar-item {
    padding: var(--sp-sm) var(--sp-md);
    cursor: pointer;
    border-bottom: 1px solid rgba(100, 120, 200, 0.06);
    transition: all var(--transition-fast);
}

.mem-sidebar-item:hover {
    background: var(--bg-card-hover);
}

.mem-sidebar-item-active {
    background: rgba(108, 92, 231, 0.12);
    border-left: 3px solid var(--accent);
}

.mem-sidebar-indent {
    padding-left: var(--sp-xl);
}

.mem-sidebar-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mem-sidebar-item-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.mem-empty-sidebar {
    padding: var(--sp-lg);
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Memory content panel */
.mem-content {
    background: var(--bg-surface);
    padding: var(--sp-lg) var(--sp-xl);
    overflow-y: auto;
    max-height: 75vh;
}

.mem-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-lg);
    padding-bottom: var(--sp-md);
    border-bottom: 1px solid var(--glass-border);
}

.mem-content-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.mem-content-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mem-content-body {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.mem-h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--sp-lg) 0 var(--sp-sm);
}

.mem-h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--sp-md) 0 var(--sp-xs);
}

.mem-p {
    margin-bottom: var(--sp-sm);
}

.mem-list {
    padding-left: var(--sp-lg);
    margin-bottom: var(--sp-sm);
    list-style: disc;
}

.mem-list li {
    margin-bottom: 4px;
}

.mem-list-num {
    list-style: decimal;
}

.mem-hr {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: var(--sp-lg) 0;
}

.mem-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.mem-codeblock {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--sp-md);
    overflow-x: auto;
    margin: var(--sp-sm) 0;
}

.mem-codeblock code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: pre;
}

/* Memory search */
.mem-search-wrap {
    position: relative;
    padding: var(--sp-sm) var(--sp-md);
    border-bottom: 1px solid var(--glass-border);
}

.mem-search {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 6px 28px 6px 10px;
    font-size: 0.78rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.mem-search:focus {
    border-color: var(--accent);
}

.mem-search::placeholder {
    color: var(--text-muted);
}

.mem-search-clear {
    position: absolute;
    right: calc(var(--sp-md) + 6px);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 4px;
}

.mem-search-clear:hover {
    color: var(--text-primary);
}

/* Memory sidebar controls */
.mem-sidebar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-xs) var(--sp-md);
    border-bottom: 1px solid var(--glass-border);
}

.mem-sidebar-controls .mem-sidebar-stats {
    padding: 0;
    border-bottom: none;
}

.mem-view-toggle {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.mem-view-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.mem-view-btn:hover {
    color: var(--text-primary);
}

.mem-view-btn.active {
    background: var(--accent);
    color: #fff;
}

/* Search highlight */
.mem-highlight {
    background: rgba(253, 203, 110, 0.35);
    color: var(--text-primary);
    padding: 1px 2px;
    border-radius: 2px;
}

/* Date badge in sidebar */
.mem-date-badge {
    font-size: 0.65rem;
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-light);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Table rendering */
.mem-table-row {
    display: flex;
    gap: 1px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    margin: 2px 0;
}

.mem-table-cell {
    flex: 1;
    padding: 4px 8px;
    font-size: 0.78rem;
    background: var(--bg-surface);
}

.mem-table-row:first-of-type .mem-table-cell {
    font-weight: 600;
    color: var(--text-primary);
}

/* Section heading in all-view */
.mem-section-heading {
    color: var(--accent-light);
    margin-top: var(--sp-lg);
    margin-bottom: var(--sp-sm);
    padding-bottom: var(--sp-xs);
    border-bottom: 1px solid var(--glass-border);
}

.mem-section-heading:first-child {
    margin-top: 0;
}

@media (max-width: 768px) {
    .mem-layout {
        grid-template-columns: 1fr;
    }

    .mem-sidebar {
        max-height: 200px;
        border-bottom: 1px solid var(--glass-border);
    }
}

/* ---- Today's Meetings ---- */
.today-meetings-header {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-md) var(--sp-lg);
    background: linear-gradient(135deg, rgba(253, 203, 110, 0.1), rgba(108, 92, 231, 0.05));
    border: 1px solid rgba(253, 203, 110, 0.15);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-lg);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ============================================
   ATLAS CHAT — Floating button + drawer
   ============================================ */

/* FAB button */
.atlas-fab {
    display: none; /* HIDDEN: OpenClaw service archived 2026-03-10. Remove this line to restore. */
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 600;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
}

.atlas-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.atlas-fab.active {
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    box-shadow: var(--glass-shadow);
}

/* Chat drawer */
.atlas-chat-drawer {
    position: fixed;
    bottom: 88px;
    right: 24px;
    z-index: 601;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--bg-elevated);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.95);
    transition: all var(--transition-normal);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(108, 92, 231, 0.08);
}

.atlas-chat-drawer.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.atlas-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-md) var(--sp-md);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.15);
}

.atlas-chat-header-left {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    font-weight: 700;
    font-size: 0.92rem;
}

.atlas-chat-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.atlas-chat-close:hover {
    color: var(--text-primary);
    background: rgba(100, 120, 200, 0.1);
}

/* Messages area */
.atlas-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-md);
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}

/* Message bubble */
.atlas-msg {
    max-width: 85%;
    animation: fadeIn 0.2s var(--ease-out) both;
}

.atlas-msg-bot {
    align-self: flex-start;
}

.atlas-msg-user {
    align-self: flex-end;
}

.atlas-msg-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.atlas-msg-bot .atlas-msg-label {
    color: var(--accent-light);
}

.atlas-msg-user .atlas-msg-label {
    color: var(--success);
    text-align: right;
}

.atlas-msg-text {
    font-size: 0.85rem;
    line-height: 1.5;
    padding: var(--sp-sm) var(--sp-md);
    border-radius: var(--radius-md);
    word-break: break-word;
}

.atlas-msg-bot .atlas-msg-text {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.atlas-msg-user .atlas-msg-text {
    background: rgba(108, 92, 231, 0.2);
    border: 1px solid rgba(108, 92, 231, 0.3);
    color: var(--text-primary);
}

/* Typing indicator */
.atlas-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--sp-sm) var(--sp-md) !important;
}

.atlas-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: atlasBounce 1.4s infinite ease-in-out both;
}

.atlas-dot:nth-child(1) { animation-delay: 0s; }
.atlas-dot:nth-child(2) { animation-delay: 0.16s; }
.atlas-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes atlasBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.atlas-chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: var(--sp-sm);
    padding: var(--sp-md);
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.1);
}

.atlas-chat-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    max-height: 100px;
    transition: border-color var(--transition-fast);
}

.atlas-chat-input:focus {
    border-color: var(--accent);
}

.atlas-chat-input::placeholder {
    color: var(--text-muted);
}

.atlas-chat-send {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.atlas-chat-send:hover {
    background: var(--accent-light);
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* Mobile */
@media (max-width: 480px) {
    .atlas-chat-drawer {
        bottom: 76px;
        right: 12px;
        width: calc(100vw - 24px);
        height: calc(100vh - 100px);
    }

    .atlas-fab {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   DOCS — Document browser
   ============================================ */

.docs-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1px;
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 500px;
}

.docs-sidebar {
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 80vh;
}

.docs-sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-md);
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--glass-border);
}

/* Category pills */
.docs-cat-bar {
    display: flex;
    gap: 4px;
    padding: var(--sp-sm) var(--sp-md);
    flex-wrap: wrap;
    border-bottom: 1px solid var(--glass-border);
}

.docs-cat-pill {
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.docs-cat-pill:hover {
    border-color: var(--glass-border-hover);
    color: var(--text-secondary);
}

.docs-cat-pill.active {
    background: rgba(108, 92, 231, 0.15);
    border-color: rgba(108, 92, 231, 0.3);
    color: var(--accent-light);
}

/* File list */
.docs-file-list {
    flex: 1;
    overflow-y: auto;
}

.docs-file-item {
    padding: var(--sp-sm) var(--sp-md);
    cursor: pointer;
    border-bottom: 1px solid rgba(100, 120, 200, 0.06);
    transition: all var(--transition-fast);
}

.docs-file-item:hover {
    background: var(--bg-card-hover);
}

.docs-file-active {
    background: rgba(108, 92, 231, 0.12);
    border-left: 3px solid var(--accent);
}

.docs-file-item-top {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: 2px;
}

.docs-file-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-file-meta {
    display: flex;
    gap: var(--sp-md);
    font-size: 0.68rem;
    color: var(--text-muted);
    padding-left: 22px;
}

.docs-file-cat {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.65rem;
}

/* Docs heading */
.docs-h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: var(--sp-lg) 0 var(--sp-md);
    padding-bottom: var(--sp-xs);
    border-bottom: 1px solid var(--glass-border);
}

.docs-h1:first-child {
    margin-top: 0;
}

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        max-height: 250px;
        border-bottom: 1px solid var(--glass-border);
    }
}

/* ---- Office (Pixel Art) ---- */

.office-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.office-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.office-title {
    font-size: 1rem;
}

.office-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}

.office-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.office-clock {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* Wrapper */
#screen-office { height: 100%; }
#officeRoot { height: 100%; }
.office-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Floor */
.office-floor {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 280px;
    background:
        repeating-conic-gradient(
            rgba(255,255,255,0.02) 0% 25%,
            transparent 0% 50%
        ) 0 0 / 40px 40px;
    background-color: #0d0d14;
    border-bottom: 1px solid var(--glass-border);
    overflow: hidden;
}

/* Workstations */
.office-workstation {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.office-ws-neil { top: 60px; left: 50%; transform: translateX(-50%); }
.office-ws-atlas { top: 240px; left: 25%; transform: translateX(-50%); }
.office-ws-amber { top: 240px; left: 75%; transform: translateX(-50%); }
.office-ws-offline { opacity: 0.4; }

/* Desk */
.office-desk {
    position: relative;
    width: 100px;
    height: 48px;
}

.office-desk-surface {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background: #2a2a3a;
    border-radius: 3px;
    border: 1px solid #3a3a4a;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.office-monitor {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 30px;
    background: #1a1a28;
    border: 2px solid #3a3a4a;
    border-radius: 3px 3px 0 0;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

.office-monitor-screen {
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 22px;
    background: linear-gradient(135deg, #1a3a5c, #0f2847);
    border-radius: 2px;
    opacity: 0.7;
    box-shadow: 0 0 12px rgba(74, 158, 255, 0.15);
}

/* Agent sprite */
.office-agent {
    margin-top: -4px;
    image-rendering: pixelated;
    line-height: 0;
}

.office-agent svg {
    image-rendering: pixelated;
    width: 20px;
    height: auto;
}

.office-agent-standing svg {
    width: 20px;
}

/* Agent label */
.office-agent-label {
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    letter-spacing: 0.3px;
}

/* Status dot (near agent) */
.office-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 2px;
}

.office-status-online {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.office-status-working {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    animation: officePulse 2s ease-in-out infinite;
}

.office-status-idle {
    background: var(--warning);
    box-shadow: 0 0 4px var(--warning);
}

.office-status-offline {
    background: var(--text-muted);
}

.office-status-error {
    background: var(--danger, #ef4444);
    box-shadow: 0 0 6px var(--danger, #ef4444);
}

@keyframes officePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Screen glow effect for working agents */
.office-screen-glow {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    background: radial-gradient(ellipse, rgba(74, 158, 255, 0.2), transparent 70%);
    pointer-events: none;
    opacity: 0.3;
}

/* Task bubble */
.office-task-bubble {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.6rem;
    color: var(--text-secondary);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    animation: bubbleFloat 3s ease-in-out infinite;
}

.office-task-bubble::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 7px;
    height: 7px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.office-task-bubble.office-task-active {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.office-task-bubble.office-task-active::after {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

/* Decorative: Plants */
.office-plant {
    position: absolute;
}

.office-plant-1 { bottom: 30px; left: 40px; }
.office-plant-2 { bottom: 30px; right: 40px; }

.office-plant-pot {
    width: 20px;
    height: 16px;
    background: #8b5e3c;
    border-radius: 2px 2px 4px 4px;
    margin: 0 auto;
}

.office-plant-leaves {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, #2ecc71 40%, #27ae60 60%, transparent 70%);
    border-radius: 50%;
    margin: -12px auto 0;
}

/* Decorative: Water cooler */
.office-cooler {
    position: absolute;
    top: 160px;
    right: 60px;
}

.office-cooler-tank {
    width: 14px;
    height: 20px;
    background: rgba(74, 158, 255, 0.25);
    border: 1px solid rgba(74, 158, 255, 0.4);
    border-radius: 4px 4px 0 0;
    margin: 0 auto;
}

.office-cooler-base {
    width: 18px;
    height: 22px;
    background: #2a2a3a;
    border: 1px solid #3a3a4a;
    border-radius: 0 0 2px 2px;
    margin: 0 auto;
}

/* Decorative: Whiteboard */
.office-whiteboard {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 32px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.office-wb-text {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Coffee mug */
.office-mug {
    position: absolute;
    top: 88px;
    left: calc(50% + 35px);
    width: 8px;
    height: 8px;
    background: #8b5e3c;
    border-radius: 0 0 2px 2px;
    border: 1px solid #a0724b;
}

.office-mug::after {
    content: '';
    position: absolute;
    top: 1px;
    right: -4px;
    width: 4px;
    height: 5px;
    border: 1px solid #a0724b;
    border-left: none;
    border-radius: 0 3px 3px 0;
}

/* ── Agent Status Bar (bottom) ── */

.office-statusbar {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    flex-shrink: 0;
}

.office-sb-card {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: border-color 0.2s;
    flex: 1;
    min-width: 0;
}

.office-sb-card:hover {
    border-color: var(--accent);
}

.office-sb-offline {
    opacity: 0.5;
}

.office-sb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.office-sb-info {
    min-width: 0;
}

.office-sb-name {
    font-weight: 600;
    font-size: 0.82rem;
}

.office-sb-role {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.office-sb-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.office-sb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.office-sb-task {
    font-size: 0.6rem;
    color: var(--accent-light);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Office responsive ── */
@media (max-width: 768px) {
    .office-wrapper { height: auto; min-height: 100%; }
    .office-floor { min-height: 260px; }
    .office-ws-neil { top: 30px; }
    .office-ws-atlas { top: 150px; left: 30%; }
    .office-ws-amber { top: 150px; left: 70%; }
    .office-statusbar { flex-direction: column; }
    .office-plant-1 { left: 15px; bottom: 10px; }
    .office-plant-2 { right: 15px; bottom: 10px; }
    .office-cooler { right: 20px; top: 110px; }
    .office-whiteboard { width: 120px; top: 6px; }
}

/* ============================================
   COMMS — AI-powered team chat with channels
   ============================================ */

/* Layout: sidebar + main chat */
.comms-layout {
    display: flex;
    height: calc(100vh - 64px);
}

/* Channel sidebar */
.comms-sidebar {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 20, 0.4);
}

.comms-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 14px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comms-new-ch-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, border-color 0.15s;
}

.comms-new-ch-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.comms-channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 6px;
}

.comms-channel-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}

.comms-channel-item:hover {
    background: var(--glass-bg);
    color: var(--text);
}

.comms-channel-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent);
}

.comms-channel-hash {
    font-weight: 700;
    opacity: 0.5;
}

.comms-channel-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main chat area */
.comms-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.comms-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px 10px;
    position: relative;
}

.comms-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.comms-header-members {
    display: flex;
    gap: 4px;
    margin-left: 4px;
}

.comms-agent-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.8;
}

.comms-members-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.comms-members-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.comms-members-dropdown {
    position: absolute;
    top: 48px;
    right: 24px;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px;
    z-index: 20;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.comms-member-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    font-size: 0.8rem;
    color: var(--text);
    cursor: pointer;
    border-radius: 4px;
}

.comms-member-option:hover {
    background: var(--glass-bg);
}

.comms-member-option.disabled {
    opacity: 0.5;
    cursor: default;
}

.comms-member-option input[type="checkbox"] {
    accent-color: var(--accent);
}

.comms-member-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.comms-count {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Messages area */
.comms-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.comms-date-divider {
    text-align: center;
    margin: 20px 0 14px;
}

.comms-date-divider span {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 4px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    letter-spacing: 0.3px;
}

.comms-system-msg {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin: 8px 0;
    font-style: italic;
    opacity: 0.6;
}

.comms-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    animation: fadeIn 0.2s ease;
}

.comms-msg-chain {
    margin-bottom: 4px;
}

.comms-msg-sent {
    justify-content: flex-end;
}

.comms-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.comms-avatar-spacer {
    width: 34px;
    flex-shrink: 0;
}

.comms-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.comms-msg-sent .comms-bubble {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
    border-bottom-right-radius: 4px;
}

.comms-msg-received .comms-bubble {
    border-bottom-left-radius: 4px;
}

.comms-bubble-atlas {
    background: rgba(34, 211, 238, 0.06);
    border-color: rgba(34, 211, 238, 0.15);
}

.comms-bubble-cody {
    background: rgba(167, 139, 250, 0.06);
    border-color: rgba(167, 139, 250, 0.15);
}

.comms-bubble-amber {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.15);
}

.comms-bubble-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}

.comms-sender {
    font-size: 0.78rem;
    font-weight: 600;
}

.comms-time {
    font-size: 0.62rem;
    color: var(--text-muted);
}

.comms-text {
    font-size: 0.85rem;
    line-height: 1.55;
    word-break: break-word;
}

.comms-mention {
    color: var(--accent);
    font-weight: 500;
}

/* Typing indicator */
.comms-typing-area {
    min-height: 0;
    padding: 0 24px;
}

.comms-typing-indicator {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 4px 0;
}

.comms-typing-dots span {
    animation: commsDotBounce 1.4s infinite;
    display: inline-block;
}

.comms-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.comms-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes commsDotBounce {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* Input area */
.comms-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-card, rgba(15, 15, 25, 0.8));
}

.comms-input {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.85rem;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.comms-input:focus {
    border-color: var(--accent);
}

.comms-send-btn {
    background: var(--accent);
    border: none;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: filter 0.15s, transform 0.1s;
}

.comms-send-btn:hover {
    filter: brightness(1.15);
}

.comms-send-btn:active {
    transform: scale(0.95);
}

/* Image attach button */
.comms-img-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}
.comms-img-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Pending image preview strip */
.comms-img-preview {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 24px;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-card, rgba(15,15,25,0.8));
}
.comms-img-thumb {
    max-height: 80px;
    max-width: 160px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}
.comms-img-remove {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s;
}
.comms-img-remove:hover {
    background: rgba(255,80,80,0.2);
    color: #f87171;
    border-color: #f87171;
}

/* Image in message bubble */
.comms-msg-img-wrap {
    margin-bottom: 4px;
}
.comms-msg-img {
    max-width: 280px;
    max-height: 220px;
    border-radius: 10px;
    object-fit: cover;
    cursor: zoom-in;
    border: 1px solid var(--glass-border);
    display: block;
    transition: opacity 0.15s;
}
.comms-msg-img:hover {
    opacity: 0.9;
}

/* Lightbox overlay */
.comms-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.comms-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.comms-empty,
.comms-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 80px 20px;
    font-size: 0.9rem;
}

/* New channel modal */
.comms-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comms-modal {
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
    width: 340px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.comms-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.comms-modal-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.comms-modal-input:focus {
    border-color: var(--accent);
}

.comms-modal-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.comms-modal-members {
    margin-bottom: 16px;
}

.comms-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.comms-modal-cancel {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

.comms-modal-cancel:hover {
    color: var(--text);
}

.comms-modal-create {
    background: var(--accent);
    border: none;
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.comms-modal-create:hover {
    filter: brightness(1.15);
}

/* Message edit/delete actions */
.comms-msg {
    position: relative;
}

.comms-msg-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    gap: 2px;
    background: var(--bg-card, rgba(15, 15, 25, 0.95));
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 2px;
    z-index: 5;
}

.comms-msg-sent:hover .comms-msg-actions {
    display: flex;
}

.comms-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}

.comms-action-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.comms-action-btn[data-action="delete"]:hover {
    color: #ef4444;
}

.comms-edited-tag {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 2px;
    display: block;
}

/* Inline edit mode */
.comms-edit-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comms-edit-input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--text);
    font-size: 0.85rem;
    resize: none;
    outline: none;
    font-family: inherit;
    min-height: 40px;
    box-sizing: border-box;
}

.comms-edit-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.comms-edit-cancel {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.72rem;
}

.comms-edit-cancel:hover {
    color: var(--text);
}

.comms-edit-save {
    background: var(--accent);
    border: none;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
}

.comms-edit-save:hover {
    filter: brightness(1.15);
}

/* Auto-reply toggle in members dropdown */
.comms-autoreply-toggle {
    padding: 0 0 4px 0;
}

.comms-members-divider {
    border-top: 1px solid var(--glass-border);
    margin: 4px 0;
}

/* Channel muted indicator (auto-reply off) */
.comms-channel-muted {
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-left: auto;
}

/* Archive button */
.comms-archive-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    transition: color 0.15s, border-color 0.15s;
}

.comms-archive-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* Archive banner */
.comms-archive-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--text);
}

.comms-archive-back {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.72rem;
    transition: background 0.15s;
}

.comms-archive-back:hover {
    background: rgba(99, 102, 241, 0.15);
}

/* Archive search */
.comms-archive-search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.comms-archive-search-input {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 0.82rem;
    outline: none;
    font-family: inherit;
}

.comms-archive-search-input:focus {
    border-color: var(--accent);
}

.comms-archive-search-btn {
    background: var(--accent);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
}

.comms-archive-search-btn:hover {
    filter: brightness(1.15);
}

/* Archive date list */
.comms-archive-date-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comms-archive-date-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text);
    transition: background 0.15s;
}

.comms-archive-date-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Archive search results */
.comms-archive-result {
    margin-bottom: 12px;
    cursor: pointer;
    border-radius: 8px;
    padding: 8px;
    transition: background 0.15s;
}

.comms-archive-result:hover {
    background: rgba(255, 255, 255, 0.03);
}

.comms-archive-result-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.7rem;
}

.comms-archive-result-date {
    color: var(--accent);
    font-weight: 600;
}

.comms-archive-result-channel {
    color: var(--text-muted);
}

/* Reesa + Troy bubble styles */
.comms-bubble-reesa {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.15);
}

.comms-bubble-troy {
    background: rgba(251, 146, 60, 0.06);
    border-color: rgba(251, 146, 60, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .comms-layout { flex-direction: column; height: calc(100vh - 56px); }
    .comms-sidebar { width: 100%; height: auto; max-height: 120px; border-right: none; border-bottom: 1px solid var(--glass-border); }
    .comms-channel-list { display: flex; gap: 4px; overflow-x: auto; padding: 0 10px 8px; }
    .comms-channel-item { white-space: nowrap; padding: 5px 10px; }
    .comms-header { padding: 12px 16px 8px; }
    .comms-messages { padding: 12px 16px; }
    .comms-input-area { padding: 12px 16px; }
    .comms-bubble { max-width: 85%; }
}

/* ---- Costs Screen ---- */

.costs-container {
    padding: 1.5rem;
    max-width: 1200px;
}

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

.costs-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.costs-provider-badge {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.costs-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.costs-summary-card {
    padding: 1.25rem;
    text-align: center;
}

.costs-summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.costs-summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.costs-summary-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.costs-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 1.5rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.costs-agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.costs-agent-card {
    padding: 1rem 1.25rem;
}

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

.costs-agent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #0a0e17;
    flex-shrink: 0;
}

.costs-agent-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.costs-agent-model {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.costs-agent-cost {
    margin-left: auto;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.costs-agent-stats {
    display: flex;
    gap: 1.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.costs-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.costs-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.costs-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.costs-table-card {
    padding: 0;
    overflow-x: auto;
}

.costs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.costs-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-weight: 600;
    white-space: nowrap;
}

.costs-table td {
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
}

.costs-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.costs-date-cell {
    font-weight: 500;
    color: var(--text-primary);
}

.costs-total-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.costs-empty-cell {
    color: var(--text-muted);
}

.costs-token-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.costs-model-cell {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

.costs-table-calls th,
.costs-table-calls td {
    padding: 0.5rem 0.75rem;
}

@media (max-width: 768px) {
    .costs-container { padding: 1rem; }
    .costs-summary-grid { grid-template-columns: 1fr; }
    .costs-agent-grid { grid-template-columns: 1fr; }
    .costs-agent-stats { flex-wrap: wrap; gap: 0.75rem; }
}

/* ---- Ideas Screen ---- */

.ideas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem 0;
}

.ideas-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ideas-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.ideas-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
}

.ideas-review-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}
.ideas-review-btn:hover { opacity: 0.85; }

.ideas-quick-entry {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem;
}

.ideas-quick-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
    transition: border-color var(--transition-fast);
    resize: none;
    overflow: hidden;
    min-height: 36px;
    max-height: 120px;
    line-height: 1.4;
    font-family: inherit;
}
.ideas-quick-input:focus {
    border-color: var(--accent);
}
.ideas-quick-input::placeholder {
    color: var(--text-muted);
}

.ideas-quick-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast);
}
.ideas-quick-btn:hover { opacity: 0.85; }

.ideas-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem 0.75rem;
    gap: 1rem;
}

.ideas-filter-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.ideas-pill {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.ideas-pill:hover {
    border-color: var(--accent);
    color: var(--text);
}
.ideas-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.ideas-pill-count {
    opacity: 0.7;
    margin-left: 0.2rem;
}

.ideas-sort {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
}

.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 2rem 2rem;
}

.ideas-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.ideas-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}
.ideas-card.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.ideas-card-check {
    flex-shrink: 0;
}
.ideas-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

.ideas-card-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 2rem;
    flex-shrink: 0;
}

.ideas-card-body {
    flex: 1;
    min-width: 0;
}

.ideas-card-title {
    font-size: 0.85rem;
    color: var(--text);
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.ideas-inline-edit-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 1px 2px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s;
    line-height: 1;
    margin-top: 1px;
}
.ideas-card:hover .ideas-inline-edit-btn {
    opacity: 1;
}
.ideas-inline-edit-btn:hover {
    color: var(--accent);
}

.ideas-inline-edit {
    width: 100%;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--bg-secondary, #1e2130);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 2px 6px;
    outline: none;
    line-height: 1.4;
}

.ideas-card-notes {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

.ideas-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ideas-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ideas-card-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.ideas-card-actions {
    flex-shrink: 0;
}
.ideas-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}
.ideas-action-btn:hover { color: var(--accent); }

.ideas-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Detail overlay */
.ideas-detail-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.ideas-detail-panel {
    background: #141c3a;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg, 12px);
    width: 90%;
    max-width: 480px;
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
}

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

.ideas-detail-num {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.ideas-detail-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}
.ideas-detail-close:hover { color: var(--text); }

.ideas-detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.ideas-detail-field {
    margin-bottom: 0.75rem;
}
.ideas-detail-field label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.ideas-detail-status,
.ideas-detail-desc {
    width: 100%;
    background: var(--bg-surface, var(--bg-main));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.5rem;
    font-size: 0.8rem;
    font-family: inherit;
}
.ideas-detail-desc {
    resize: vertical;
}

.ideas-detail-atlas {
    background: var(--bg-surface, var(--bg-main));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.5;
}

.ideas-detail-reviewed {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.ideas-detail-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.ideas-detail-save {
    flex: 1;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}
.ideas-detail-save:hover { opacity: 0.85; }
.ideas-detail-save:disabled { opacity: 0.6; cursor: default; }
.ideas-detail-save.saved { background: #34d399; }

.ideas-detail-delete {
    background: none;
    border: 1px solid var(--danger, #ef4444);
    color: var(--danger, #ef4444);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.ideas-detail-delete:hover {
    background: var(--danger, #ef4444);
    color: #fff;
}

/* Align checkbox/number with first line when card is multi-line */
.ideas-card-check,
.ideas-card-number {
    margin-top: 0.15rem;
}

/* Select-all bar */
.ideas-select-all {
    padding: 0 2rem 0.5rem;
}
.ideas-select-all-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Show more/less link */
.ideas-show-more {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.3rem;
}
.ideas-show-more:hover { text-decoration: underline; }

/* Score badge on cards */
.ideas-score-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}

/* Summarize button */
.ideas-summarize-btn {
    color: var(--text-muted);
}
.ideas-summarize-btn:hover { color: #f59e0b; }

/* Card actions row */
.ideas-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* Reviewing indicator */
.ideas-reviewing-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    animation: ideas-pulse 1.5s ease-in-out infinite;
}
@keyframes ideas-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Detail panel: composite score */
.ideas-composite-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

/* Detail panel: agent review cards */
.ideas-agent-review {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
}
.ideas-agent-review-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.ideas-agent-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ideas-agent-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.ideas-agent-score {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}
.ideas-agent-rationale {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.5;
}

/* Detail panel: summarize button */
.ideas-detail-summarize {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 0.5rem;
}
.ideas-detail-summarize:hover {
    background: rgba(245, 158, 11, 0.2);
}

/* Detail panel: original idea text */
.ideas-detail-original {
    font-size: 0.85rem;
    color: var(--text);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    line-height: 1.6;
    margin-top: 0.4rem;
}

.ideas-detail-description {
    width: 100%;
    font-size: 0.85rem;
    color: var(--text);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    line-height: 1.6;
    margin-top: 0.4rem;
    resize: vertical;
    font-family: inherit;
}
.ideas-detail-description:focus {
    outline: none;
    border-color: var(--accent);
}

.ideas-detail-title-input {
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    line-height: 1.5;
    margin-top: 0.4rem;
    resize: vertical;
    font-family: inherit;
}
.ideas-detail-title-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Category input in detail panel */
.ideas-detail-category {
    width: 100%;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--bg-surface, var(--bg-main));
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    font-family: inherit;
    box-sizing: border-box;
}
.ideas-detail-category:focus {
    outline: none;
    border-color: var(--accent);
}

/* Detail panel: wider for readability */
.ideas-detail-panel {
    max-width: 540px;
}

/* Action bar (Suggest / Summarize / Review) */
.ideas-action-bar {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.ideas-action-bar-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    white-space: nowrap;
}
.ideas-action-bar-btn:hover { opacity: 0.85; }
.ideas-suggest-btn {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(34, 211, 238, 0.3);
}
.ideas-summarize-batch-btn {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.ideas-review-btn {
    background: var(--accent);
    color: #fff;
}

/* Per-card agent assignment area */
.ideas-card-agents {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    position: relative;
}
.ideas-agent-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    position: relative;
    transition: transform var(--transition-fast);
}
.ideas-agent-circle:hover {
    transform: scale(1.15);
}
.ideas-agent-circle-x {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: var(--danger, #ef4444);
    color: #fff;
    border-radius: 50%;
    font-size: 0.55rem;
    line-height: 14px;
    text-align: center;
}
.ideas-agent-circle:hover .ideas-agent-circle-x {
    display: block;
}
.ideas-agent-add {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px dashed var(--glass-border);
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.ideas-agent-add:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Agent dropdown */
.ideas-agent-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.3rem;
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    margin-top: 4px;
}
.ideas-agent-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.ideas-agent-dropdown-item:hover {
    background: rgba(255,255,255,0.05);
}

/* Detail panel: assigned reviewers */
.ideas-detail-reviewers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.ideas-detail-reviewer-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid;
    border-radius: 12px;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text);
    background: rgba(255,255,255,0.03);
}

@media (max-width: 768px) {
    .ideas-header { padding: 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .ideas-quick-entry { padding: 0.5rem 1rem; }
    .ideas-filters { padding: 0 1rem 0.5rem; flex-direction: column; align-items: flex-start; }
    .ideas-list { padding: 0 1rem 1rem; }
    .ideas-card-meta { flex-direction: column; align-items: flex-end; }
    .ideas-select-all { padding: 0 1rem 0.5rem; }
    .ideas-action-bar { flex-wrap: wrap; }
}

