/* Captain Claw — Nervous System / Intuitions 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 ──────────────────────────────────────────── */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.nts-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;
}
.nts-card:hover { border-color: var(--accent); }

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

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

.nts-badge-connection  { background: rgba(88,166,255,.15);  color: var(--accent); }
.nts-badge-pattern     { background: rgba(188,140,255,.15); color: var(--purple); }
.nts-badge-hypothesis  { background: rgba(210,153,34,.15);  color: var(--yellow); }
.nts-badge-association { background: rgba(57,210,192,.15);  color: var(--cyan); }

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

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

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

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

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

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

.nts-card-layers {
    color: var(--text-secondary);
}

/* ─── Confidence bar ──────────────────────────────────── */

.nts-conf-bar {
    width: 50px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}

.nts-conf-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .3s;
}

.nts-conf-low  { background: var(--red); }
.nts-conf-med  { background: var(--yellow); }
.nts-conf-high { background: var(--green); }

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

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

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

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

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

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

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

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

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

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

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

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