/* Captain Claw — Insights 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;
    --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 ──────────────────────────────────────────── */

.ins-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;
}

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

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

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

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

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

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

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

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

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

.ins-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;
}
.ins-search:focus { border-color: var(--accent); }
.ins-search::placeholder { color: var(--text-muted); }

.ins-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;
}
.ins-filter:focus { border-color: var(--accent); }

.ins-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;
}
.ins-btn:hover { background: var(--accent-hover); }

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

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

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

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

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

.ins-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;
}
.ins-card:hover { border-color: var(--accent); }
.ins-card.active { border-color: var(--accent); background: var(--bg-tertiary); }

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

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

.ins-badge-contact { background: rgba(88,166,255,.15); color: var(--accent); }
.ins-badge-decision { background: rgba(188,140,255,.15); color: var(--purple); }
.ins-badge-preference { background: rgba(210,153,34,.15); color: var(--yellow); }
.ins-badge-fact { background: rgba(63,185,80,.15); color: var(--green); }
.ins-badge-deadline { background: rgba(248,81,73,.15); color: var(--red); }
.ins-badge-project { background: rgba(247,129,102,.15); color: var(--orange); }
.ins-badge-workflow { background: rgba(139,148,158,.15); color: var(--text-secondary); }

.ins-importance {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.ins-card-content {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

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

.ins-card-tags {
    color: var(--text-secondary);
}

/* ─── Detail Panel (shown on card click) ──────────────── */

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

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

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

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

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

.ins-detail-value {
    flex: 1;
    font-size: 13px;
}

.ins-detail-input {
    width: 100%;
    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);
    outline: none;
}
.ins-detail-input:focus { border-color: var(--accent); }

textarea.ins-detail-input {
    min-height: 60px;
    resize: vertical;
}

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

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

.ins-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;
}
.ins-toast.visible { opacity: 1; transform: translateY(0); }
