/* Sovereign Console — Dark Command Center Theme */

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

:root {
    --bg: #0a0c0f;
    --surface: #111318;
    --surface2: #181c23;
    --border: #22272f;
    --accent: #6366f1;
    --accent2: #818cf8;
    --text: #e2e8f0;
    --text-muted: #64748b;
    --green: #4ade80;
    --red: #f87171;
    --mono: 'Courier New', monospace;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

/* ── Shell ── */
.shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: 220px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.logo-mark { font-size: 20px; color: var(--accent); }
.logo-text { font-size: 16px; font-weight: 700; letter-spacing: 0.05em; }

.nav-links { list-style: none; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--accent2); border-left-color: var(--accent); background: var(--surface2); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border);
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* ── Content ── */
.content {
    margin-left: 220px;
    padding: 32px 40px;
    flex: 1;
    max-width: 1200px;
}

.page-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 { font-size: 24px; font-weight: 700; }
.timestamp { color: var(--text-muted); font-size: 12px; font-family: var(--mono); }
.ws-status { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }

/* ── Stat Grid ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.stat-card.highlight { border-color: var(--accent); }

.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-value.green { color: var(--green); }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── Section Headers ── */
.section-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

/* ── Info Row ── */
.info-row {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.info-label { color: var(--text-muted); min-width: 140px; }
.info-value { font-family: var(--mono); }

/* ── Quick Nav ── */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 8px;
}

.quick-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}

.quick-card:hover { border-color: var(--accent); }
.qc-icon { font-size: 24px; margin-bottom: 8px; }
.qc-label { font-weight: 600; margin-bottom: 4px; }
.qc-desc { font-size: 12px; color: var(--text-muted); }

/* ── Persona Grid ── */
.persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.persona-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.15s;
}

.persona-card:hover { border-color: var(--accent); }
.persona-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.persona-group-tag {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--accent2);
    margin-bottom: 8px;
}
.persona-soul { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.persona-path { font-size: 10px; color: var(--text-muted); font-family: var(--mono); }

/* ── Persona Breadcrumb ── */
.persona-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 13px;
}

.bc-item { color: var(--text-muted); }
.bc-link { color: var(--accent2); cursor: pointer; text-decoration: none; }
.bc-link:hover { text-decoration: underline; }
.bc-active { color: var(--text); font-weight: 600; }
.bc-sep { color: var(--text-muted); font-size: 11px; }

/* ── Avatars ── */
.group-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.member-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.avatar-fallback {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent2);
    font-size: 20px;
    flex-shrink: 0;
}

.avatar-fallback.group-size {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

/* ── Group Tiles (Level 1) ── */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.group-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.group-tile:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.group-tile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.group-tile-head-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.group-tile-name {
    font-size: 18px;
    font-weight: 700;
}

.group-tile-badge {
    background: var(--accent);
    color: #fff;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

.group-tile-mission {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.group-tile-agents {
    font-size: 11px;
    color: var(--accent2);
    font-family: var(--mono);
}

/* ── Member Tiles (Level 2) ── */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.member-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

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

.member-tile:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.member-tile-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.member-tile-title {
    font-size: 12px;
    color: var(--accent2);
    margin-bottom: 8px;
}

.member-tile-brief {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.member-tile-files {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.member-file-tag {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    color: var(--text-muted);
}

/* ── Detail View (Level 3) ── */
.detail-header {
    margin-bottom: 16px;
}

.detail-header h2 {
    font-size: 22px;
    font-weight: 700;
    display: inline;
    margin-right: 12px;
}

.detail-title {
    font-size: 13px;
    color: var(--accent2);
}

.detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.detail-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 10px 18px;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.detail-tab:hover { color: var(--text); }
.detail-tab.active {
    color: var(--accent2);
    border-bottom-color: var(--accent);
}

.detail-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px 28px;
    min-height: 200px;
}

/* ── Markdown Content ── */
.md-content h1 { font-size: 20px; font-weight: 700; margin: 0 0 12px; color: var(--text); }
.md-content h2 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.md-content h3 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; color: var(--text); }
.md-content h4 { font-size: 13px; font-weight: 600; margin: 14px 0 4px; color: var(--text-muted); }

.md-content p { margin: 8px 0; line-height: 1.6; font-size: 13px; }

.md-content ul, .md-content ol { margin: 8px 0 8px 20px; font-size: 13px; line-height: 1.6; }
.md-content li { margin-bottom: 4px; }

.md-content code {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent2);
}

.md-content pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 10px 0;
}

.md-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text);
    font-size: 12px;
}

.md-content table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12px; }
.md-content th {
    background: var(--surface2);
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.md-content td { padding: 8px 12px; border-bottom: 1px solid var(--border); }

.md-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 8px 16px;
    margin: 10px 0;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--surface2);
    border-radius: 0 6px 6px 0;
}

.md-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.md-content a { color: var(--accent2); text-decoration: none; }
.md-content a:hover { text-decoration: underline; }

.md-content strong { color: var(--text); }

/* ── Live Feed ── */
.live-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 180px);
}

.feed-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-label {
    padding: 12px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

.feed {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feed-empty { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 40px; }

.feed-item {
    background: var(--surface2);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    border-left: 2px solid var(--border);
    line-height: 1.5;
}

.feed-ts { color: var(--text-muted); font-family: var(--mono); margin-right: 8px; }
.feed-agent, .feed-sender, .feed-recipient { color: var(--accent2); font-weight: 600; }
.feed-arrow { color: var(--text-muted); margin: 0 4px; }
.feed-event { color: var(--green); margin-left: 4px; }
.feed-payload { color: var(--text-muted); margin-left: 8px; }
.feed-content { color: var(--text); margin-top: 4px; padding-left: 4px; border-left: 1px solid var(--border); }

/* ── Logs ── */
.logs-container { display: flex; flex-direction: column; gap: 24px; }

.log-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.log-table-wrap { overflow-x: auto; max-height: 400px; overflow-y: auto; }

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.log-table th {
    background: var(--surface2);
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}

.log-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.log-table tr:hover td { background: var(--surface2); }

.mono { font-family: var(--mono); color: var(--text-muted); }
.agent-tag { color: var(--accent2); font-weight: 600; }
.payload-cell { color: var(--text-muted); max-width: 300px; }
.empty-row { text-align: center; color: var(--text-muted); padding: 24px; }

/* ── Quick Nav 4-col ── */
.quick-nav-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Projects Page ── */

/* Category progress inside group tiles */
.category-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* Progress bar */
.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--surface2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-lg { height: 8px; border-radius: 4px; }

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-label {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
    white-space: nowrap;
}

.progress-label-lg {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Status badge */
.status-badge {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--badge-color, var(--border));
    color: var(--badge-color, var(--text-muted));
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

/* Priority badge */
.priority-badge {
    display: inline-block;
    background: var(--badge-color, var(--surface2));
    color: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

/* Kosha tag */
.kosha-tag {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    color: var(--accent2);
    font-style: italic;
}

/* Project list (Level 2) */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 12px;
}

.project-card-title {
    font-size: 16px;
    font-weight: 700;
}

.project-card-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.project-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.project-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-card-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Project detail sections */
.project-detail-section {
    margin-bottom: 24px;
}

.project-detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.project-detail-section p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.project-detail-progress {
    margin-top: 8px;
}

/* Meta grid */
.project-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.meta-value {
    font-size: 12px;
}

/* Task list */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 4px;
    transition: background 0.1s;
}

.task-item:hover { background: var(--surface2); }

.task-check {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.task-check-checkmark {
    background: var(--green);
    border-color: var(--green);
    position: relative;
}

.task-check-checkmark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.task-check-blocked {
    border-color: var(--red);
    background: transparent;
}

.task-check-pending {
    border-color: var(--border);
    background: transparent;
}

.task-name {
    flex: 1;
    font-size: 13px;
}

.task-complete .task-name {
    color: var(--text-muted);
    text-decoration: line-through;
}

.task-blocked .task-name {
    color: var(--red);
}

.task-status-label {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* Dependency list */
.dep-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dep-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface2);
    border-radius: 4px;
    font-size: 13px;
}

.dep-target { color: var(--text); font-weight: 600; }
.dep-arrow { color: var(--red); font-size: 11px; font-style: italic; }
.dep-source { color: var(--text-muted); }

/* ── View Toggle ── */
.view-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.view-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 20px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-right: 1px solid var(--border);
}

.view-toggle-btn:last-child { border-right: none; }

.view-toggle-btn:hover { color: var(--text); background: var(--surface2); }

.view-toggle-btn.active {
    color: #fff;
    background: var(--accent2);
    font-weight: 600;
}

/* ── Kosha Grid (Level 1) ── */
.kosha-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kosha-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--kosha-color, var(--accent));
    border-radius: 8px;
    padding: 22px 24px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.kosha-tile:hover {
    border-color: var(--kosha-color, var(--accent));
    transform: translateY(-2px);
}

.kosha-tile-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
}

.kosha-tile-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    color: var(--kosha-color, var(--accent));
}

.kosha-tile-titles { flex: 1; min-width: 0; }

.kosha-tile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--kosha-color, var(--text));
    margin-bottom: 2px;
}

.kosha-tile-english {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.kosha-tile-count {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--kosha-color, var(--accent2));
    flex-shrink: 0;
    align-self: center;
}

.kosha-tile-marketing {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 4px;
}

.kosha-tile-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.kosha-tile-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.kosha-tile-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.kosha-tile-projects {
    font-size: 11px;
    color: var(--accent2);
    font-family: var(--mono);
}

/* ── Maturity Badge ── */
.maturity-badge {
    display: inline-block;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.maturity-badge.maturity-seed {
    background: rgba(212, 160, 23, 0.15);
    color: #d4a017;
    border: 1px solid rgba(212, 160, 23, 0.3);
}

.maturity-badge.maturity-emerging {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.maturity-badge.maturity-functional {
    background: rgba(74, 222, 128, 0.15);
    color: var(--green);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.maturity-badge.maturity-mature {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ── Category Origin Tag (Kosha Level 2) ── */
.category-origin-tag {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ── Rhythms Page ── */

/* Prana Grid (Level 1) */
.prana-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prana-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--prana-color, var(--accent));
    border-radius: 8px;
    padding: 22px 24px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.prana-tile:hover {
    border-color: var(--prana-color, var(--accent));
    transform: translateY(-2px);
}

.prana-tile-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
}

.prana-tile-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    color: var(--prana-color, var(--accent));
}

.prana-tile-titles { flex: 1; min-width: 0; }

.prana-tile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--prana-color, var(--text));
    margin-bottom: 2px;
}

.prana-tile-function {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.prana-tile-count {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--prana-color, var(--accent2));
    flex-shrink: 0;
    align-self: center;
}

.prana-tile-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.prana-tile-rhythms {
    font-size: 11px;
    color: var(--accent2);
    font-family: var(--mono);
}

/* Rhythm Status Dots */
.rhythm-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.rhythm-status-dot.status-green {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.rhythm-status-dot.status-red {
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
}

.rhythm-status-dot.status-gray {
    background: var(--text-muted);
}

/* Prana Badge */
.prana-badge {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--prana-color, var(--border));
    color: var(--prana-color, var(--text-muted));
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

/* Rhythm Group Badge */
.rhythm-group-badge {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    color: var(--accent2);
}

/* Rhythm List */
.rhythm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Rhythm Cards */
.rhythm-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.rhythm-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.rhythm-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rhythm-card-name {
    font-size: 16px;
    font-weight: 700;
}

.rhythm-card-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.rhythm-card-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.rhythm-card-detail {
    font-size: 12px;
    color: var(--text-muted);
}

.rhythm-card-detail strong {
    color: var(--text);
    font-weight: 600;
}

/* ── Skills Page ── */

/* Skill List */
.skill-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Skill Cards */
.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.skill-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.skill-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 12px;
}

.skill-card-title {
    font-size: 16px;
    font-weight: 700;
}

.skill-card-trigger-count {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
    flex-shrink: 0;
}

.skill-card-excerpt {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.skill-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.skill-card-triggers {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.skill-trigger-tag {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    color: var(--accent2);
    font-family: var(--mono);
}

.skill-card-tools {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.skill-tool-tag {
    display: inline-block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* Trigger List (Skill Detail) */
.trigger-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trigger-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface2);
    border-radius: 4px;
    font-size: 13px;
}

.trigger-text {
    color: var(--accent2);
    font-family: var(--mono);
}

/* Tool List (Skill Detail) */
.tool-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface2);
    border-radius: 4px;
    font-size: 13px;
}

.tool-text {
    color: var(--text);
    font-family: var(--mono);
    font-size: 12px;
}

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 36px 32px;
    width: 100%;
    max-width: 380px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.login-logo-mark { font-size: 24px; color: var(--accent); }
.login-logo-text { font-size: 18px; font-weight: 700; letter-spacing: 0.05em; }

.login-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--red);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 20px;
}

.login-success {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: var(--green);
    border-radius: 6px;
    padding: 14px;
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-field {
    margin-bottom: 18px;
}

.form-field label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-field input,
.form-field textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

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

.login-btn {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
}

.login-btn:hover { opacity: 0.9; }

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.login-footer a {
    color: var(--accent2);
    text-decoration: none;
    font-size: 13px;
}

.login-footer a:hover { text-decoration: underline; }

/* ── CRM Pipeline ── */
.pipeline-funnel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pipeline-stage {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.pipeline-stage:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.pipeline-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pipeline-stage-name {
    font-size: 15px;
    font-weight: 600;
    text-transform: capitalize;
}

.pipeline-stage-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent2);
}

/* ── CRM Contact Cards ── */
.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.contact-card-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.contact-card-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── CRM Action Buttons ── */
.btn-approve {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid var(--green);
    color: var(--green);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-approve:hover { background: rgba(74, 222, 128, 0.3); }

.btn-deny {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid var(--red);
    color: var(--red);
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-deny:hover { background: rgba(248, 113, 113, 0.3); }

/* ── Teaser Login Embed ── */
.login-embed {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.teaser-login-form {
    background: #111111;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 28px 24px 20px;
    max-width: 340px;
    margin: 0 auto;
}

.teaser-login-form .form-field label {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 6px;
}

.teaser-login-form .form-field input {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 14px;
    color: #f0f0f0;
    font-size: 14px;
    font-family: inherit;
}

.teaser-login-form .form-field input:focus {
    outline: none;
    border-color: #f7931a;
}

.teaser-login-form .form-field { margin-bottom: 16px; }

.teaser-login-form .login-btn {
    width: 100%;
    background: #f7931a;
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.teaser-login-form .login-btn:hover { opacity: 0.9; }

.teaser-login-footer {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
}

.teaser-login-footer a {
    color: #f7931a;
    text-decoration: none;
}

.teaser-login-footer a:hover { text-decoration: underline; }

.teaser-login-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #f87171;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 14px;
    text-align: center;
}

/* ── User Menu (sidebar) ── */
.user-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.user-menu-name {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-logout {
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
    flex-shrink: 0;
}

.user-menu-logout:hover { color: var(--red); }
