:root {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: #16233a;
    background: #eef3f8;

    --navy: #11223d;
    --blue: #246bfe;
    --blue-dark: #1550c7;
    --muted: #68778d;
    --border: #d8e1ec;
    --surface: #ffffff;
    --green: #17a778;
    --danger: #b42318;
    --danger-bg: #fff1ef;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(36, 107, 254, 0.09),
            transparent 34rem
        ),
        #eef3f8;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

[hidden] {
    display: none !important;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 30px;
}

.auth-shell {
    display: grid;
    width: min(100%, 1040px);
    min-height: 610px;
    grid-template-columns: 1.05fr 0.95fr;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--surface);
    box-shadow:
        0 24px 70px
        rgba(18, 38, 68, 0.14);
}

.brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 70px;
    color: #ffffff;
    background:
        linear-gradient(
            145deg,
            #246bfe,
            #11223d
        );
}

.brand-mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    margin-bottom: 40px;
    border: 1px solid
        rgba(255, 255, 255, 0.35);
    border-radius: 18px;
    background:
        rgba(255, 255, 255, 0.13);
    font-size: 28px;
    font-weight: 800;
}

.brand-mark-small {
    width: 42px;
    height: 42px;
    margin: 0;
    border: 0;
    border-radius: 13px;
    background: var(--blue);
    font-size: 20px;
}

.eyebrow,
.card-label {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-panel .eyebrow {
    color:
        rgba(255, 255, 255, 0.72);
}

.brand-panel h1 {
    margin: 0;
    font-size:
        clamp(42px, 5vw, 66px);
    line-height: 1;
    letter-spacing: -0.045em;
}

.brand-copy {
    max-width: 430px;
    margin: 26px 0 0;
    color:
        rgba(255, 255, 255, 0.8);
    font-size: 18px;
    line-height: 1.65;
}

.private-badge,
.secure-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
}

.private-badge {
    margin-top: 40px;
    background:
        rgba(255, 255, 255, 0.12);
}

.secure-badge {
    color: #14694f;
    background: #e4f8f1;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #31d69b;
    box-shadow:
        0 0 0 4px
        rgba(49, 214, 155, 0.14);
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 70px;
}

.auth-card h2 {
    margin: 0;
    color: var(--navy);
    font-size: 32px;
    letter-spacing: -0.035em;
}

.intro-copy {
    margin: 14px 0 0;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 10px;
    margin-top: 34px;
}

.auth-form label {
    margin-top: 10px;
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
}

.auth-form input {
    height: 50px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    padding: 0 15px;
    color: var(--navy);
}

.auth-form input:focus {
    border-color: var(--blue);
    box-shadow:
        0 0 0 4px
        rgba(36, 107, 254, 0.12);
}

.primary-button,
.secondary-button {
    min-height: 48px;
    border-radius: 12px;
    padding: 0 20px;
    font-weight: 800;
}

.primary-button {
    margin-top: 14px;
    border: 0;
    color: #ffffff;
    background: var(--blue);
}

.primary-button:hover:not(:disabled) {
    background: var(--blue-dark);
}

.secondary-button {
    border: 1px solid var(--border);
    color: var(--navy);
    background: #ffffff;
}

.button-progress {
    display: none;
}

.auth-form.is-busy
.button-label {
    display: none;
}

.auth-form.is-busy
.button-progress {
    display: inline;
}

.form-alert {
    margin-top: 10px;
    border: 1px solid #f5c2bd;
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--danger);
    background: var(--danger-bg);
    font-size: 14px;
}

.security-note {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.topbar {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    padding:
        14px clamp(22px, 5vw, 64px);
    background: #ffffff;
}

.topbar-brand,
.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-brand > div:last-child,
.topbar-user > div {
    display: grid;
}

.topbar span {
    color: var(--muted);
    font-size: 12px;
}

.workspace {
    width: min(100% - 40px, 1240px);
    margin: 0 auto;
    padding: 52px 0 72px;
}

.workspace-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.workspace-heading h1 {
    margin: 0;
    color: var(--navy);
    font-size:
        clamp(32px, 5vw, 48px);
    letter-spacing: -0.04em;
}

.workspace-heading p:last-child {
    color: var(--muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 34px;
}

.dashboard-card,
.placeholder-panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow:
        0 12px 32px
        rgba(18, 38, 68, 0.06);
}

.dashboard-card {
    min-height: 220px;
    padding: 28px;
}

.dashboard-card h2,
.placeholder-panel h2 {
    margin: 10px 0 0;
    color: var(--navy);
}

.dashboard-card p:not(.card-label),
.placeholder-panel p:last-child,
.dashboard-card ul {
    color: var(--muted);
    line-height: 1.6;
}

.detail-list {
    display: grid;
    gap: 13px;
    margin: 24px 0 0;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #edf1f5;
    padding-top: 13px;
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
    font-weight: 700;
}

.dashboard-card ul {
    padding-left: 20px;
}

.placeholder-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-top: 20px;
    padding: 38px;
}

.signal-bars {
    display: flex;
    width: 150px;
    height: 100px;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
    border-radius: 16px;
    background: #eaf1ff;
}

.signal-bars span {
    width: 18px;
    border-radius: 7px 7px 3px 3px;
    background: var(--blue);
}

.signal-bars span:nth-child(1) {
    height: 36px;
}

.signal-bars span:nth-child(2) {
    height: 68px;
}

.signal-bars span:nth-child(3) {
    height: 52px;
}

.app-message {
    margin-top: 20px;
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: 300px;
        padding: 44px;
    }

    .auth-card {
        padding: 48px 44px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .workspace-heading,
    .placeholder-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 580px) {
    .auth-page {
        padding: 16px;
    }

    .auth-card,
    .brand-panel {
        padding: 34px 26px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .workspace {
        width: min(100% - 28px, 1240px);
    }

    .signal-bars {
        width: 100%;
    }
}


/* ===== Stage 5B4: agent runtime controls ===== */

.runtime-status-card {
    position: relative;
}

.runtime-state-code {
    display: inline-flex;
    margin-top: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf3ff;
    color: #2367e8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.runtime-panel {
    margin-top: 24px;
    padding: 34px 38px;
    border: 1px solid #d8e1ef;
    border-radius: 22px;
    background: #ffffff;
    box-shadow:
        0 18px 45px rgba(31, 61, 104, 0.08);
}

.runtime-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
}

.runtime-panel-heading h2 {
    margin: 5px 0 8px;
    color: #10233f;
    font-size: 28px;
}

.runtime-panel-heading p {
    margin-bottom: 0;
}

.runtime-live-indicator {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #f1f4f8;
    color: #68768a;
    font-size: 13px;
    font-weight: 800;
}

.runtime-live-indicator span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a5b0be;
}

.runtime-live-indicator.is-active {
    background: #eafaf4;
    color: #087552;
}

.runtime-live-indicator.is-active span {
    background: #29d49d;
    box-shadow:
        0 0 0 5px rgba(41, 212, 157, 0.14);
}

.runtime-information-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.runtime-information-card {
    padding: 19px 21px;
    border: 1px solid #e0e7f1;
    border-radius: 16px;
    background: #f8faff;
}

.runtime-information-card strong {
    display: block;
    margin-top: 6px;
    color: #10233f;
    font-size: 17px;
}

.runtime-information-card p {
    margin: 7px 0 0;
    font-size: 13px;
}

.runtime-information-label {
    color: #667891;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.runtime-controls {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.runtime-button {
    min-height: 52px;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease;
}

.runtime-button:not(:disabled):hover {
    transform: translateY(-1px);
}

.runtime-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.primary-button {
    background: #2d6df6;
    color: #ffffff;
    box-shadow:
        0 10px 22px rgba(45, 109, 246, 0.18);
}

.success-button {
    background: #18a978;
    color: #ffffff;
}

.warning-button {
    background: #f0a62b;
    color: #142139;
}

.danger-button {
    background: #ec5e63;
    color: #ffffff;
}

.runtime-safety-note {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid #dbe5f5;
    border-radius: 13px;
    background: #f7faff;
    color: #53677f;
    font-size: 13px;
    line-height: 1.55;
}

.runtime-safety-note strong {
    color: #183358;
}

.app-message[data-kind="success"] {
    border-color: #a8ead4;
    background: #ecfbf5;
    color: #087552;
}

.app-message[data-kind="info"] {
    border-color: #bed4ff;
    background: #eff5ff;
    color: #245bb7;
}

.app-message[data-kind="error"] {
    border-color: #f2b4b4;
    background: #fff0ef;
    color: #bd2929;
}

@media (max-width: 900px) {
    .runtime-panel-heading {
        flex-direction: column;
    }

    .runtime-information-grid {
        grid-template-columns: 1fr;
    }

    .runtime-controls {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .runtime-panel {
        padding: 24px 20px;
    }

    .runtime-controls {
        grid-template-columns: 1fr;
    }
}


/* Agent assigned-campaign selector */
.runtime-campaign-picker {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.runtime-campaign-select {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0.72rem 0.8rem;
    border: 1px solid #cdd9ea;
    border-radius: 0.7rem;
    background: #ffffff;
    color: #09254a;
    font: inherit;
}

.runtime-campaign-select:focus {
    outline: 2px solid #2f6ff5;
    outline-offset: 2px;
}

.runtime-campaign-select:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    background: #f4f7fb;
}

.runtime-campaign-picker .secondary-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .runtime-campaign-picker {
        flex-direction: column;
    }

    .runtime-campaign-picker .secondary-button {
        width: 100%;
    }
}


/* Stage 6D40-R3 — Admin inert lead import UI */

.lead-import-form {
    margin-top: 4px;
}

.lead-import-file {
    display: block;
    width: 100%;
    margin-top: 10px;
    color: #183358;
    font: inherit;
}

.lead-import-file::file-selector-button {
    margin-right: 12px;
    padding: 9px 12px;
    border: 1px solid #cdd9ea;
    border-radius: 9px;
    background: #ffffff;
    color: #245bb7;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.lead-import-result,
.lead-import-rejections {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid #dbe5f5;
    border-radius: 13px;
    background: #f8faff;
    color: #53677f;
    line-height: 1.55;
}

.lead-import-result strong,
.lead-import-rejections strong {
    color: #183358;
}

.lead-import-result p {
    margin: 7px 0 0;
}

.lead-import-rejections ol {
    margin: 10px 0 0;
    padding-left: 22px;
}

.lead-import-rejections li + li {
    margin-top: 6px;
}

.lead-import-rejections p {
    margin: 10px 0 0;
}
