/* BranchManager — base styles */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    background: #0f0f0f;
    color: #e0e0e0;
}

/* Layout */
.bm-layout { display: flex; flex-direction: column; min-height: 100vh; }
.bm-nav    { display: flex; gap: 1.5rem; align-items: center; padding: .75rem 1.5rem; background: #1a1a1a; border-bottom: 1px solid #2a2a2a; }
.bm-nav a  { color: #ccc; text-decoration: none; }
.bm-nav a:hover { color: #fff; }
.bm-nav__brand { font-weight: 700; color: #fff !important; margin-right: 1rem; }
.bm-main  { padding: 1.5rem; flex: 1; }

/* Chat layout */
.bm-chat-layout { display: flex; flex-direction: column; height: 100vh; }
.bm-chat-header { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; background: #1a1a1a; border-bottom: 1px solid #2a2a2a; }
.bm-chat-header__name { font-weight: 600; }
.bm-chat-header__user { color: #888; font-size: 12px; }
.bm-chat-main { flex: 1; overflow: hidden; }

/* Chat */
.bm-chat { display: flex; flex-direction: column; height: 100%; }
.bm-chat__messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.bm-chat__msg { display: flex; }
.bm-chat__msg--user      { justify-content: flex-end; }
.bm-chat__msg--assistant { justify-content: flex-start; }
.bm-chat__bubble { max-width: 70%; padding: .6rem .9rem; border-radius: 12px; line-height: 1.5; }
.bm-chat__msg--user      .bm-chat__bubble { background: #2563eb; color: #fff; border-bottom-right-radius: 3px; }
.bm-chat__msg--assistant .bm-chat__bubble { background: #1e1e1e; border: 1px solid #2a2a2a; border-bottom-left-radius: 3px; }
.bm-chat__bubble--thinking { opacity: .5; font-style: italic; }
.bm-chat__input-row { display: flex; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid #2a2a2a; background: #111; }
.bm-chat__input-row textarea { flex: 1; background: #1a1a1a; border: 1px solid #333; border-radius: 8px; color: #e0e0e0; padding: .5rem .75rem; resize: none; }
.bm-chat__suspended, .bm-chat__paused { padding: 1rem; text-align: center; color: #888; background: #1a1a1a; border-top: 1px solid #2a2a2a; }

/* Tables */
.bm-table { width: 100%; border-collapse: collapse; }
.bm-table th, .bm-table td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid #2a2a2a; }
.bm-table th { color: #888; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.bm-table tr:hover td { background: #1a1a1a; }
.bm-row--critical td { background: #2a0a0a; }

/* Badges */
.bm-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.bm-badge--active, .bm-badge--healthy { background: #14532d; color: #86efac; }
.bm-badge--paused, .bm-badge--stale   { background: #713f12; color: #fde68a; }
.bm-badge--archived                    { background: #1e1e1e; color: #888; }
.bm-badge--critical                    { background: #7f1d1d; color: #fca5a5; }
.bm-badge--warning                     { background: #713f12; color: #fde68a; }
.bm-badge--info                        { background: #1e3a5f; color: #93c5fd; }
.bm-badge--deleted                     { background: #111; color: #555; }

/* Forms */
.bm-form { display: flex; flex-direction: column; gap: .75rem; max-width: 400px; }
.bm-form label { font-weight: 600; color: #aaa; font-size: 12px; text-transform: uppercase; }
.bm-form input { background: #1a1a1a; border: 1px solid #333; border-radius: 6px; color: #e0e0e0; padding: .5rem .75rem; }

/* EULA */
.bm-eula { max-width: 640px; margin: 2rem auto; padding: 1.5rem; }
.bm-eula__text { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0; max-height: 320px; overflow-y: auto; }
.bm-eula__text p { line-height: 1.7; color: #ccc; }
.bm-eula__checkbox { display: flex; align-items: flex-start; gap: .5rem; margin: 1rem 0; }

/* Misc */
.bm-note  { color: #888; font-size: 12px; margin-bottom: 1rem; }
.bm-error { color: #f87171; margin-top: .5rem; }
.bm-filters { display: flex; gap: 1rem; margin-bottom: 1rem; }
.bm-filters select { background: #1a1a1a; border: 1px solid #333; color: #e0e0e0; padding: .3rem .6rem; border-radius: 4px; }

button {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .4rem .85rem;
    cursor: pointer;
    font-size: 13px;
}
button:hover    { background: #1d4ed8; }
button:disabled { opacity: .4; cursor: not-allowed; }
