/* ============================================================================
   Reverb Control — deployment console
   Aesthetic: mission-control / terminal-industrial. Deep near-black panels,
   hairline borders, a single lime signal accent, IBM Plex Mono for telemetry.
   ============================================================================ */

:root {
    --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    --bg: #0a0c11;
    --panel: #11141c;
    --panel-2: #151926;
    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.13);

    --text: #e7e9f0;
    --muted: #8a91a6;
    --dim: #5c6379;

    --signal: #c7f24a;     /* lime — ok / primary */
    --signal-ink: #0c1004;
    --amber: #f6b740;      /* running / warn */
    --red: #ff6058;        /* failed / danger */
    --blue: #6f9cff;       /* incidental accent */

    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 540px at 80% -12%, rgba(199, 242, 74, 0.07), transparent 60%),
        radial-gradient(820px 520px at -6% 112%, rgba(111, 156, 255, 0.05), transparent 60%);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.5;
}

/* faint mission-grid overlay, masked toward the top */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(circle at 50% 24%, #000 28%, transparent 78%);
    mask-image: radial-gradient(circle at 50% 24%, #000 28%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.strong { font-weight: 600; }
.pad { padding: 28px 4px; }
.ta-r { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---- Shell -------------------------------------------------------------- */
.shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 244px 1fr;
    min-height: 100vh;
}

.rail {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 26px 18px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 22px;
}
.brand-mark {
    font-size: 22px;
    color: var(--signal);
    text-shadow: 0 0 18px rgba(199, 242, 74, 0.55);
    line-height: 1;
}
.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: 17px;
}
.brand-sub { color: var(--signal); margin-left: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--dim);
    transition: background 0.15s, box-shadow 0.15s;
}
.nav-link.active { background: rgba(199, 242, 74, 0.08); color: var(--text); }
.nav-link.active .nav-dot { background: var(--signal); box-shadow: 0 0 10px var(--signal); }

.rail-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.env-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--signal);
    border: 1px solid rgba(199, 242, 74, 0.3);
    background: rgba(199, 242, 74, 0.06);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}
.rail-note { color: var(--dim); font-size: 11px; margin-top: 8px; }

/* ---- Stage / page chrome ----------------------------------------------- */
.stage {
    padding: 40px 48px 80px;
    max-width: 1180px;
    width: 100%;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 6px;
}
h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 34px;
    letter-spacing: -0.01em;
    margin: 0;
}
h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 21px;
    margin: 0 0 4px;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn {
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    padding: 9px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.08s, background 0.15s, border-color 0.15s, color 0.15s;
    background: transparent;
    color: var(--text);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; }

.btn-primary {
    background: var(--signal);
    color: var(--signal-ink);
    box-shadow: 0 0 0 1px rgba(199, 242, 74, 0.2), 0 8px 24px -10px rgba(199, 242, 74, 0.6);
}
.btn-primary:hover:not(:disabled) { background: #d3f86a; }

.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--muted); }

.btn-danger-ghost { border-color: rgba(255, 96, 88, 0.3); color: #ff8b85; }
.btn-danger-ghost:hover { background: rgba(255, 96, 88, 0.1); border-color: var(--red); }

.btn-danger { background: var(--red); color: #1a0606; }
.btn-danger:hover:not(:disabled) { background: #ff7a73; }

.link { color: var(--signal); border-bottom: 1px solid transparent; transition: border-color 0.15s; }
.link:hover { border-color: var(--signal); }
.link.big { font-family: var(--font-mono); font-size: 15px; }
.link-plain { color: var(--text); border-bottom: 1px solid transparent; transition: color 0.15s, border-color 0.15s; }
.link-plain:hover { color: var(--signal); border-color: var(--signal); }

/* ---- Detail page ------------------------------------------------------- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.card-title {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kv { display: grid; grid-template-columns: 104px 1fr; gap: 9px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }
.card-error { color: #ff9a95; font-size: 12px; margin: 0 0 12px; word-break: break-word; }
.form-ok { color: var(--signal); font-size: 12px; margin: 0 0 12px; }
.logs-section { margin-top: 4px; }
.logs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.logs-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logs-controls .input-sm { width: auto; padding: 5px 26px 5px 10px; font-size: 12px; }
.logs-controls .logs-filter { width: 220px; padding-right: 10px; }
.spin {
    width: 12px; height: 12px;
    border: 2px solid var(--line-2);
    border-top-color: var(--signal);
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- SQL access card --------------------------------------------------- */
.btn-sm { padding: 5px 11px; font-size: 12px; }
.sql-card { margin-bottom: 24px; }
.sql-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.k { color: var(--muted); font-size: 12.5px; }
.kv-line { display: flex; align-items: center; gap: 12px; font-size: 13.5px; margin-bottom: 9px; min-height: 28px; }
.kv-line .k { width: 78px; flex: 0 0 auto; }
.secret { color: var(--signal); background: rgba(199, 242, 74, 0.08); padding: 3px 9px; border-radius: 6px; user-select: all; }
.tunnel-box { border-left: 1px solid var(--line); padding-left: 24px; }
.tunnel-row { display: flex; gap: 8px; align-items: center; margin-top: 11px; }
.tunnel-row .input { flex: 1; }
.rules { margin-top: 22px; }
.rules-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.grid.mini { margin-top: 2px; }
.grid.mini td { padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--line); }
.grid.mini tr:last-child td { border-bottom: none; }

/* Logs front-and-center: a taller console on the details page. */
.console.tall .console-body { height: min(58vh, 640px); }
/* Wider dialog for the SQL access tool. */
.modal.wide { width: min(720px, calc(100vw - 40px)); }
.card-action { margin-top: 16px; }

/* ---- Panels & tables --------------------------------------------------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.grid { width: 100%; border-collapse: collapse; }
.grid thead th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dim);
    font-weight: 500;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.015);
}
.grid tbody td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.grid tbody tr:last-child td { border-bottom: none; }
.grid tbody tr {
    animation: rowIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--row, 0) * 40ms);
    transition: background 0.12s;
}
.grid tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.grid .sub { color: var(--dim); font-size: 12px; font-family: var(--font-sans); margin-top: 2px; }

@keyframes rowIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}

/* ---- Pills & status ---------------------------------------------------- */
.pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    color: var(--muted);
}
.pill-env { color: var(--blue); border-color: rgba(111, 156, 255, 0.3); background: rgba(111, 156, 255, 0.07); }
.pill-db { color: var(--muted); }
.pill-self { color: var(--signal); border-color: rgba(199, 242, 74, 0.3); background: rgba(199, 242, 74, 0.08); margin-left: 8px; font-size: 10px; }
.pill-role { color: var(--signal); border-color: rgba(199, 242, 74, 0.25); background: rgba(199, 242, 74, 0.08); }

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    text-transform: lowercase;
}
.status-queued { color: var(--muted); }
.status-running { color: var(--amber); border-color: rgba(246, 183, 64, 0.35); background: rgba(246, 183, 64, 0.08); }
.status-succeeded { color: var(--signal); border-color: rgba(199, 242, 74, 0.35); background: rgba(199, 242, 74, 0.08); }
.status-failed { color: var(--red); border-color: rgba(255, 96, 88, 0.35); background: rgba(255, 96, 88, 0.08); }

.pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--amber);
    animation: pulse 1.4s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(246, 183, 64, 0.5); }
    70% { box-shadow: 0 0 0 7px rgba(246, 183, 64, 0); }
    100% { box-shadow: 0 0 0 0 rgba(246, 183, 64, 0); }
}

/* ---- Empty state ------------------------------------------------------- */
.empty {
    border: 1px dashed var(--line-2);
    border-radius: var(--radius);
    padding: 64px 24px;
    text-align: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

/* ---- Forms ------------------------------------------------------------- */
.form-panel { padding: 26px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 22px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 500;
}
.field em { color: var(--dim); font-style: normal; font-size: 11px; }
.hint { color: var(--dim); font-family: var(--font-mono); font-size: 11px; }
.span-2 { grid-column: 1 / -1; }

.input {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}
.input:focus {
    outline: none;
    border-color: var(--signal);
    box-shadow: 0 0 0 3px rgba(199, 242, 74, 0.12);
}
select.input { cursor: pointer; appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13.5px;
    cursor: pointer;
}
.check input { accent-color: var(--signal); width: 16px; height: 16px; }

.errors {
    margin: 20px 0 0;
    padding: 14px 16px 14px 34px;
    border: 1px solid rgba(255, 96, 88, 0.3);
    background: rgba(255, 96, 88, 0.07);
    border-radius: var(--radius-sm);
    color: #ff9a95;
    font-size: 13.5px;
}

.form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

/* ---- Modal ------------------------------------------------------------- */
.modal-veil {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(5, 6, 9, 0.72);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: veilIn 0.18s ease;
}
.modal {
    width: min(460px, calc(100vw - 40px));
    background: var(--panel-2);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    animation: modalIn 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.modal h2.danger { color: #ff8b85; }
.modal .field { margin-top: 18px; }
.modal .check { margin-top: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

@keyframes veilIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---- Console (live log) ------------------------------------------------ */
.status-block { display: flex; align-items: center; gap: 14px; }
.elapsed { color: var(--dim); font-size: 13px; }

.console {
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    overflow: hidden;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
        #0b0e07;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.5);
}
.console-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}
.cdot { width: 10px; height: 10px; border-radius: 50%; opacity: 0.65; }
.d-r { background: var(--red); }
.d-y { background: var(--amber); }
.d-g { background: var(--signal); }
.console-title { color: var(--dim); font-size: 12px; margin-left: 8px; }

.console-body {
    padding: 16px 18px;
    height: 460px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}
.logline { display: flex; gap: 12px; white-space: pre-wrap; word-break: break-word; }
.logline .ts { color: var(--dim); flex: 0 0 auto; }
.logline .lv { flex: 0 0 16px; text-align: center; color: var(--muted); }
.logline .msg { color: var(--text); flex: 1; }

.lvl-section { margin-top: 10px; }
.lvl-section .lv, .lvl-section .msg { color: var(--signal); font-weight: 600; }
.lvl-step .msg { color: var(--text); }
.lvl-info .msg { color: var(--muted); }
.lvl-ok .lv, .lvl-ok .msg { color: var(--signal); }
.lvl-warn .lv, .lvl-warn .msg { color: var(--amber); }
.lvl-error .lv, .lvl-error .msg { color: var(--red); }
.cursor .msg { color: var(--signal); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Result banner ----------------------------------------------------- */
.result {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line-2);
    background: var(--panel);
}
.result.ok { border-color: rgba(199, 242, 74, 0.3); }
.result.fail { border-color: rgba(255, 96, 88, 0.3); }
.result .result-mark { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.result.ok .result-mark { color: var(--signal); }
.result.fail .result-mark { color: #ff8b85; }
.result .err-msg { color: #ff9a95; font-size: 13px; flex: 1; }
.result .btn { margin-left: auto; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .rail { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
    .rail-foot { margin: 0 0 0 auto; border: none; padding: 0; }
    .nav { flex-direction: row; }
    .stage { padding: 28px 20px 60px; }
    .form-grid { grid-template-columns: 1fr; }
    .sql-grid { grid-template-columns: 1fr; }
    .tunnel-box { border-left: none; padding-left: 0; }
}

/* ---- Auth: login page + user chip ------------------------------------- */
.full-stage { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login-stage { width: 100%; max-width: 360px; }
.login-card {
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    padding: 24px 24px 22px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.login-card .brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.login-card .brand-mark { color: var(--signal); font-size: 18px; }
.login-card .brand-name { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.05em; font-size: 14px; }
.login-card .brand-sub { color: var(--muted); font-weight: 500; }
.login-title { font-family: var(--font-display); margin: 0 0 16px; font-size: 22px; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.login-form .field .input { padding: 8px 10px; font-size: 13px; }
.login-form .check { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-submit { margin-top: 8px; padding: 9px 14px; }
.login-error {
    margin-top: 12px;
    color: var(--red);
    background: rgba(255, 96, 88, 0.08);
    border: 1px solid rgba(255, 96, 88, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 12px;
}

.user-chip {
    display: flex; flex-direction: column; gap: 4px;
    padding: 10px 12px; margin-bottom: 12px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.user-chip .user-name { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.user-chip a.user-name:hover { color: var(--signal); }
.user-chip-links { display: flex; gap: 12px; margin-top: 4px; }
.user-chip .pill-role {
    align-self: flex-start;
    font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 999px;
    background: rgba(199, 242, 74, 0.12); color: var(--signal);
    border: 1px solid rgba(199, 242, 74, 0.25);
}
.user-chip .user-signout {
    font-size: 11px; color: var(--muted); text-decoration: none; margin-top: 4px;
}
.user-chip .user-signout:hover { color: var(--signal); }

/* ---- Account / profile page ------------------------------------------- */
.acct-panel { max-width: 620px; margin-bottom: 18px; }
.acct-panel + .acct-panel { margin-top: 0; }
.acct-h { font-size: 15px; margin: 0 0 16px; }
.acct-id { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; }
.acct-static { font-size: 13px; color: var(--text); padding: 2px 0; }
.acct-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ---- Initial-setup users: summary list + dialog ----------------------- */
.seed-users { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.seed-users-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.seed-empty { margin: 8px 0 12px; font-size: 12.5px; }

.seed-user-list { list-style: none; padding: 0; margin: 0 0 10px; }
.seed-user-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.seed-user-item:last-child { margin-bottom: 0; }
.seed-user-id { min-width: 0; }
.seed-user-id .mono { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seed-user-id .dim { font-size: 12px; margin-top: 2px; }
.seed-user-roles { display: flex; gap: 6px; flex-wrap: wrap; }
.seed-user-actions { display: flex; gap: 6px; }

/* The Add / Edit user modal. */
.seed-dialog { width: min(560px, calc(100vw - 40px)); }
.seed-dialog-sub { font-size: 13px; margin: 0 0 18px; }
.seed-dialog .pw-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.seed-dialog .pw-wrap .input { flex: 1; }
.seed-dialog .pw-toggle-btn {
    background: transparent; border: 1px solid var(--line-2);
    color: var(--muted); cursor: pointer;
    font-size: 11px; padding: 5px 10px; border-radius: var(--radius-sm);
}
.seed-dialog .pw-toggle-btn:hover { color: var(--text); border-color: var(--muted); }

.role-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.role-section-h {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--dim); margin-bottom: 10px;
}
.role-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 12px; margin-bottom: 6px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.role-row:hover { background: rgba(255, 255, 255, 0.02); }
.role-row:has(input:checked) {
    border-color: rgba(199, 242, 74, 0.35);
    background: rgba(199, 242, 74, 0.05);
}
.role-row input[type="checkbox"] { margin: 3px 0 0; flex: 0 0 auto; }
.role-text { flex: 1; }
.role-name { font-weight: 600; font-size: 13.5px; }
.role-desc { color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.role-warn { color: var(--amber); }

/* ---- Deploy page two-column layout ----------------------------------- */
.deploy-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-bottom: 18px; }
.deploy-cols .form-panel { padding: 22px 24px; }
.panel-h {
    font-family: var(--font-display); font-weight: 700; font-size: 16px;
    margin: 0 0 12px; color: var(--text);
}
.form-pad { margin: 0 0 14px; font-size: 13px; }
.deploy-foot { margin-top: 4px; }

@media (max-width: 960px) {
    .deploy-cols { grid-template-columns: 1fr; }
    .seed-user-row {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: auto;
        padding: 10px 0;
    }
    .seed-col-email, .seed-col-pw { grid-column: 1 / -1; }
}

/* ---- Deploy form: Advanced collapsible ------------------------------- */
.advanced-toggle { margin: 4px 0; }
.advanced-btn {
    background: transparent;
    border: 1px dashed var(--line-2);
    color: var(--muted);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 12.5px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    width: 100%;
    text-align: left;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.advanced-btn:hover { color: var(--text); border-color: var(--muted); background: rgba(255, 255, 255, 0.02); }
.advanced-btn .caret { display: inline-block; width: 14px; color: var(--signal); font-family: var(--font-mono); }
.advanced-btn .adv-hint { font-size: 11.5px; }

/* ---- Jobs history panel ---------------------------------------------- */
.history-panel { margin-top: 18px; padding: 0; }
.history-toggle {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 14px 18px;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius);
    transition: background 0.12s;
}
.history-toggle:hover { background: rgba(255, 255, 255, 0.02); }
.history-toggle .caret { display: inline-block; width: 14px; color: var(--signal); font-family: var(--font-mono); }
.history-toggle .history-count { font-weight: 400; font-size: 12.5px; margin-left: 4px; }

.history-body { padding: 0 18px 16px; border-top: 1px solid var(--line); }

.history-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 14px 0 12px;
    flex-wrap: wrap;
}
.history-controls .input-sm { width: auto; padding: 6px 10px; font-size: 12.5px; }
.history-controls .history-search { flex: 1; min-width: 260px; }

/* ---- SQL access: connection-strings sub-section --------------------- */
.conn-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.conn-body { padding: 12px 0 4px; display: flex; flex-direction: column; gap: 10px; }
.conn-row { display: flex; flex-direction: column; gap: 4px; }
.conn-row .k { font-size: 11.5px; color: var(--muted); }
.conn-value { display: flex; gap: 8px; align-items: center; }
.conn-value .input { flex: 1; padding: 6px 10px; font-size: 12px; cursor: text; }
.conn-value .input[readonly] { background: var(--panel-2); border-color: var(--line); }
.conn-copied { color: var(--signal); margin-top: 2px; }

/* ---- Custom domains card --------------------------------------------- */
.domains-card .card-title { display: flex; align-items: center; justify-content: space-between; }
.card-action-inline { margin-left: auto; font-size: 11px; }
.domain-list { list-style: none; padding: 0; margin: 0 0 12px; }
.domain-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.domain-host { display: flex; align-items: center; gap: 8px; min-width: 0; }
.domain-host .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.domain-actions { display: flex; gap: 6px; }
.pill-domain-primary {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 2px 7px; border-radius: 999px;
    color: var(--signal); border: 1px solid rgba(199, 242, 74, 0.3); background: rgba(199, 242, 74, 0.07);
}

/* ---- Site Details: lifecycle panel at the bottom -------------------- */
.lifecycle-panel {
    margin-top: 28px;
    padding: 22px 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.lifecycle-head { margin-bottom: 16px; }
.lifecycle-head .panel-h { margin: 0 0 4px; }
.lifecycle-head .muted { font-size: 13px; margin: 0; }
.lifecycle-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.lifecycle-btn {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    padding: 14px 16px;
    transition: background 0.12s, border-color 0.12s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.lifecycle-btn:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--line-2); }
.lifecycle-btn-name { font-weight: 600; font-size: 13.5px; }
.lifecycle-btn-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.lifecycle-btn-danger { border-color: rgba(255, 96, 88, 0.25); }
.lifecycle-btn-danger:hover { border-color: var(--red); background: rgba(255, 96, 88, 0.05); }
.lifecycle-btn-danger .lifecycle-btn-name { color: #ff8b85; }
