/* /outbound-agent/public/assets/style.css */
/* Version: 1.2.0 */
/* Changelog:
     - 1.2.0 (2026-07-06) — Added Settings styles: .select, .hint, .tag (saved marker),
       .kv/.kv-row read-only rows, and the .banner setup prompt. All responsive, 44px targets.
     - 1.1.0 (2026-07-06) — Added .center / .card--auth (login page), .head-meta and .logout
       (dashboard sign-out link). Cache-busted via ?v=OBA_VERSION on the <link>.
     - 1.0.0 (2026-07-06) — Initial. Mobile-first responsive styles. Flex/grid layout, no
       fixed pixel widths for structure, 44px minimum tap targets, breakpoints at 320/768/1280.
   Loaded by: public/index.php, public/login.php, public/settings.php. */

:root {
    --bg: #0f1115;
    --panel: #171a21;
    --panel-2: #1e222b;
    --line: #2a2f3a;
    --text: #e7eaf0;
    --muted: #99a0ad;
    --accent: #3b82f6;
    --ok: #16a34a;
    --err: #dc2626;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

.wrap {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.head h1 { font-size: 1.35rem; margin: 0; }
.ver { color: var(--muted); font-size: 0.8rem; }

/* Header right cluster: version + sign-out. */
.head-meta { display: flex; align-items: center; gap: 14px; }
.logout {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.logout:hover { color: var(--accent); text-decoration: underline; }

/* Login page: vertically + horizontally centered card. */
.center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.card--auth {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.card--auth .head { margin-bottom: 4px; }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}

.card h2 { margin: 0 0 12px; font-size: 1.05rem; }

.flash {
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    font-size: 0.95rem;
}
.flash--ok { border-color: var(--ok); color: #86efac; background: rgba(22, 163, 74, 0.1); }
.flash--err { border-color: var(--err); color: #fca5a5; background: rgba(220, 38, 38, 0.1); }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 0.85rem; color: var(--muted); }

.input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.textarea { min-height: 88px; resize: vertical; }

/* Native select styled to match .input; keep the OS arrow for accessibility. */
.select {
    -webkit-appearance: menulist;
    appearance: menulist;
    cursor: pointer;
}

.hint { color: var(--muted); font-size: 0.82rem; margin: 2px 0 0; }

/* "saved" marker next to a field label. */
.tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    color: #86efac;
    border: 1px solid var(--ok);
    vertical-align: middle;
}

/* Read-only key/value rows (agent voice + LLM). */
.kv {
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.kv-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--panel-2);
}
.kv-row + .kv-row { border-top: 1px solid var(--line); }
.kv-k { color: var(--muted); font-size: 0.85rem; }
.kv-v { font-size: 0.9rem; word-break: break-word; text-align: right; }

/* Setup-incomplete banner on the dashboard. */
.banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
    font-size: 0.92rem;
}
.banner-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.banner-link:hover { text-decoration: underline; }

.btn {
    min-height: 44px;
    padding: 12px 18px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }

.muted { color: var(--muted); }

.table-scroll { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; white-space: nowrap; }

.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    border: 1px solid var(--line);
}
.pill--initiated { color: #93c5fd; border-color: #1d4ed8; }
.pill--completed { color: #86efac; border-color: var(--ok); }
.pill--failed { color: #fca5a5; border-color: var(--err); }

/* Stack the table into cards on small screens — no horizontal scroll needed at 320px. */
@media (max-width: 600px) {
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr {
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 6px 10px;
    }
    .table td { border-bottom: 0; display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
    .table td::before { content: attr(data-th); color: var(--muted); font-size: 0.8rem; }
}

@media (min-width: 768px) {
    .wrap { padding: 24px; }
    .head h1 { font-size: 1.6rem; }
}

@media (min-width: 1280px) {
    .wrap { max-width: 960px; }
}
