/* ============================================
   Honcho — shared design tokens & components
   Loaded by Copilot, Console, and public pages
   ============================================ */

/* --- Design tokens --- */
:root {
    --h-accent: #4f46e5;
    --h-accent-hover: #4338ca;
    --h-accent-bg: rgba(79, 70, 229, 0.08);
    --h-link: #2563eb;
    --h-text: #1a1a2e;
    --h-text-secondary: #374151;
    --h-text-muted: #6c757d;
    --h-text-faint: #9ca3af;
    --h-bg: #f5f6f8;
    --h-bg-card: #fff;
    --h-border: #dee2e6;
    --h-border-light: rgba(0, 0, 0, 0.06);
    --h-border-input: #e5e7eb;
    --h-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --h-header-h: 42px;
    --h-sidebar-w: 240px;
}

/* --- Base --- */
body {
    font-family: var(--h-font);
    color: var(--h-text);
}

/* --- Header --- */
.chat-header-wrap {
    background: var(--h-bg-card);
    border-bottom: 1px solid var(--h-border-light);
    flex-shrink: 0;
    z-index: 10;
}
.chat-header {
    background: var(--h-bg-card);
    padding: 0 1rem;
    height: var(--h-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.chat-header .brand {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--h-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}
.chat-header .brand:hover { color: var(--h-text); }
.chat-header .brand img { border-radius: 5px; }
.chat-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* --- Header action buttons --- */
.header-user-link {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--h-text-muted);
    text-decoration: none;
}
.header-user-link:hover { color: var(--h-text); }

.header-logout-btn {
    font-size: 0.78rem;
    color: var(--h-text-muted);
    border: 1px solid var(--h-border);
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
    text-decoration: none;
    transition: all 0.15s;
}
.header-logout-btn:hover { color: var(--h-text); background: rgba(0,0,0,0.05); border-color: #adb5bd; }

.header-icon-btn {
    background: #f3f4f6;
    border: 1px solid var(--h-border-input);
    color: var(--h-text-secondary);
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}
.header-icon-btn:hover { background: #e5e7eb; border-color: #d1d5db; color: var(--h-text); }
.header-icon-btn svg { width: 18px; height: 18px; }
.header-icon-btn.active { background: #e5e7eb; border-color: #d1d5db; color: var(--h-text); }

/* --- Surface switcher --- */
.surface-switcher {
    display: inline-flex;
    background: rgba(0,0,0,0.05);
    border-radius: 0.5rem;
    padding: 2px;
    gap: 2px;
}
.surface-switcher__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--h-text-muted);
    border-radius: 0.4rem;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1;
}
.surface-switcher__btn:hover {
    color: var(--h-text);
    background: rgba(255,255,255,0.6);
}
.surface-switcher__btn--active {
    background: var(--h-bg-card);
    color: var(--h-text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    cursor: default;
}
.surface-switcher__btn--active:hover {
    background: var(--h-bg-card);
    color: var(--h-text);
}
.surface-switcher__btn .bi { font-size: 0.85rem; }
.surface-switcher__btn svg { width: 14px; height: 14px; flex-shrink: 0; }

@media (max-width: 600px) {
    .surface-switcher__btn span { display: none; }
    .surface-switcher__btn { padding: 0.3rem 0.5rem; }
}

/* --- Dark header (unbranded) --- */
.dark-header .chat-header-wrap { background: #212529; border-bottom-color: rgba(255,255,255,0.1); }
.dark-header .chat-header { background: #212529; }
.dark-header .chat-header .brand { color: #fff; }
.dark-header .surface-switcher { background: rgba(255,255,255,0.1); }
.dark-header .surface-switcher__btn { color: rgba(255,255,255,0.7); }
.dark-header .surface-switcher__btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.dark-header .surface-switcher__btn--active { background: #fff; color: var(--h-text); box-shadow: none; }
.dark-header .surface-switcher__btn--active:hover { background: #fff; color: var(--h-text); }
.dark-header .header-user-link { color: rgba(255,255,255,0.85); }
.dark-header .header-user-link:hover { color: #fff; }
.dark-header .header-logout-btn { color: rgba(255,255,255,0.7); border-color: rgba(255,255,255,0.3); }
.dark-header .header-logout-btn:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }
.dark-header .header-icon-btn { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); }
.dark-header .header-icon-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: #fff; }

/* --- Login / auth page card --- */
.login-card {
    max-width: 400px;
    margin: 100px auto 0;
}

/* --- Destination switcher (login page) --- */
.destination-switcher {
    display: flex;
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 3px;
    gap: 3px;
}
.dest-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--h-text-muted);
    background: transparent;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.15s;
}
.dest-btn:hover { color: var(--h-text); background: rgba(255,255,255,0.5); }
.dest-btn.active {
    background: var(--h-bg-card);
    color: var(--h-text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.dest-btn .bi { font-size: 0.9rem; }
