/* Captain Claw — Sister Session / Briefings Browser */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --green: #3fb950;
    --red: #f85149;
    --yellow: #d29922;
    --orange: #f78166;
    --purple: #bc8cff;
    --cyan: #39d2c0;
    --radius: 8px;
    --radius-sm: 6px;
    --header-height: 48px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

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

html, body {
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

/* ─── Header ──────────────────────────────────────────── */

.brf-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.brf-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brf-header-left h1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.brf-logo-link img {
    height: 24px;
    width: auto;
    display: block;
}

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

.brf-nav-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
}
.brf-nav-link:hover { color: var(--accent-hover); }

.brf-unread-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    margin-left: 6px;
}

/* ─── Stats Bar ──────────────────────────────────────── */

.brf-stats-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.brf-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.brf-stat-value {
    color: var(--text-secondary);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ─── Layout ──────────────────────────────────────────── */

.brf-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
}

/* ─── Tabs ────────────────────────────────────────────── */

.brf-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.brf-tab {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
}

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

.brf-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.brf-tab-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ─── Toolbar ─────────────────────────────────────────── */

.brf-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.brf-search {
    flex: 1;
    max-width: 500px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    outline: none;
}
.brf-search:focus { border-color: var(--accent); }
.brf-search::placeholder { color: var(--text-muted); }

.brf-filter {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
}
.brf-filter:focus { border-color: var(--accent); }

.brf-btn {
    padding: 6px 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
}
.brf-btn:hover { background: var(--accent-hover); }

.brf-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.brf-btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.brf-btn-danger {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--border);
}
.brf-btn-danger:hover { background: rgba(248,81,73,.15); }

.brf-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
}

/* ─── List ────────────────────────────────────────────── */

.brf-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}

.brf-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ─── Briefing Card ──────────────────────────────────── */

.brf-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .15s;
}
.brf-card:hover { border-color: var(--accent); }

.brf-card.unread {
    border-left: 3px solid var(--accent);
}

.brf-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.brf-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.brf-badge-intuition   { background: rgba(188,140,255,.15); color: var(--purple); }
.brf-badge-insight     { background: rgba(88,166,255,.15);  color: var(--accent); }
.brf-badge-deadline    { background: rgba(248,81,73,.15);   color: var(--red); }
.brf-badge-watch       { background: rgba(57,210,192,.15);  color: var(--cyan); }
.brf-badge-manual      { background: rgba(210,153,34,.15);  color: var(--yellow); }

.brf-status-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.brf-status-unread   { background: rgba(88,166,255,.2); color: var(--accent); }
.brf-status-read     { background: rgba(139,148,158,.1); color: var(--text-muted); }
.brf-status-dismissed { background: rgba(139,148,158,.1); color: var(--text-muted); }
.brf-status-acted    { background: rgba(63,185,80,.15);  color: var(--green); }

.brf-card-summary {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 500;
}

.brf-card-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 6px;
    max-height: 60px;
    overflow: hidden;
}

.brf-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.brf-card-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.brf-card-actions button {
    padding: 2px 8px;
    font-size: 11px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font);
}
.brf-card-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ─── Confidence indicator ───────────────────────────── */

.brf-conf {
    font-size: 11px;
    color: var(--text-muted);
}

.brf-actionable {
    font-size: 11px;
    color: var(--green);
    font-weight: 600;
}

.brf-not-actionable {
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── Task Card ──────────────────────────────────────── */

.brf-task-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: border-color .15s;
}
.brf-task-card:hover { border-color: var(--accent); }

.brf-task-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.brf-task-status {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.brf-task-queued   { background: rgba(210,153,34,.15);  color: var(--yellow); }
.brf-task-running  { background: rgba(88,166,255,.2);   color: var(--accent); }
.brf-task-done     { background: rgba(63,185,80,.15);   color: var(--green); }
.brf-task-failed   { background: rgba(248,81,73,.15);   color: var(--red); }
.brf-task-dismissed { background: rgba(139,148,158,.1); color: var(--text-muted); }

.brf-task-priority {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.brf-task-reason {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.brf-task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── Watch Card ─────────────────────────────────────── */

.brf-watch-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: border-color .15s;
}
.brf-watch-card:hover { border-color: var(--accent); }

.brf-watch-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.brf-watch-query {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.brf-watch-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── Detail Panel ───────────────────────────────────── */

.brf-detail-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 100;
}
.brf-detail-overlay.visible { display: flex; align-items: center; justify-content: center; }

.brf-detail {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 640px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
}

.brf-detail h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.brf-detail-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.brf-detail-label {
    width: 100px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 2px;
}

.brf-detail-value {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
}

.brf-detail-value pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.brf-detail-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ─── Toast ───────────────────────────────────────────── */

.brf-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    z-index: 200;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s, transform .2s;
}
.brf-toast.visible { opacity: 1; transform: translateY(0); }
