/* HELM Founder Dashboard — LIFECO styling */

.helm-app {
    --helm-success: #27ae60;
    --helm-warning: #f39c12;
    --helm-danger: #c0392b;
    --helm-muted: #7f8c8d;
    --helm-border: #ecf0f1;
    --helm-surface: #fff;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.helm-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.helm-brand h1 {
    margin: 0 0 4px;
    color: var(--primary-color);
    font-size: 1.6rem;
    letter-spacing: 0.5px;
}

.helm-brand .tagline {
    margin: 0;
    color: var(--helm-muted);
    font-size: 0.92rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 8px;
}

.helm-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.helm-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--helm-surface);
    border: 1px solid var(--helm-border);
    color: var(--primary-color);
}

.helm-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--helm-muted);
}

.helm-pill.is-running .dot { background: var(--helm-success); }
.helm-pill.is-paused .dot { background: var(--helm-warning); }
.helm-pill.is-killed .dot { background: var(--helm-danger); }

.helm-budget-bar {
    min-width: 160px;
}

.helm-budget-bar span {
    display: block;
    font-size: 0.78rem;
    color: var(--helm-muted);
    margin-bottom: 4px;
}

.helm-budget-track {
    height: 6px;
    background: var(--helm-border);
    border-radius: 3px;
    overflow: hidden;
}

.helm-budget-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.helm-budget-fill.is-warning { background: var(--helm-warning); }
.helm-budget-fill.is-danger { background: var(--helm-danger); }

.helm-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--helm-border);
    padding-bottom: 0;
}

.helm-nav button {
    width: auto;
    background: transparent;
    color: var(--helm-muted);
    border-radius: 8px 8px 0 0;
    padding: 10px 16px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.helm-nav button:hover {
    background: rgba(52, 152, 219, 0.08);
    color: var(--primary-color);
}

.helm-nav button.is-active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: transparent;
}

.helm-panel {
    display: none;
}

.helm-panel.is-active {
    display: block;
}

.helm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.helm-card {
    background: var(--helm-surface);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    padding: 22px 20px;
    border: 1px solid var(--helm-border);
}

.helm-card h3 {
    margin: 0 0 12px;
    color: var(--primary-color);
    font-size: 1rem;
}

.helm-card p {
    margin: 0 0 10px;
    line-height: 1.65;
    font-size: 0.94rem;
}

.helm-card ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
    font-size: 0.92rem;
}

.helm-stat {
    text-align: center;
    padding: 16px;
}

.helm-stat .value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.helm-stat .label {
    font-size: 0.82rem;
    color: var(--helm-muted);
}

.helm-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.helm-stats-row .helm-stat {
    background: var(--helm-surface, #fff);
    border: 1px solid var(--helm-border);
    border-radius: 8px;
}

.helm-orchestrator-card h3 {
    margin: 0;
}

.helm-orchestrator-body {
    line-height: 1.65;
    font-size: 0.92rem;
    margin-top: 12px;
}

.helm-task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.helm-task-card {
    background: var(--helm-surface, #fff);
    border: 1px solid var(--helm-border);
    border-radius: 8px;
    padding: 16px;
}

.helm-task-card header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.helm-task-card h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.helm-task-result {
    margin-top: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.helm-task-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.helm-verifier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.helm-verifier-badge.is-verified {
    background: #d5f5e3;
    color: #186a3b;
    border: 1px solid #a9dfbf;
}

.helm-verifier-badge.is-failed {
    background: #fadbd8;
    color: #922b21;
    border: 1px solid #f5b7b1;
}

.helm-execution-hint {
    margin: 0 0 12px;
    padding: 8px 12px;
    background: #f4f6f7;
    border-radius: 6px;
    border-left: 3px solid var(--helm-accent, #1f618d);
}

.helm-cold-email {
    margin-top: 12px;
    padding: 14px;
    background: #f8fafb;
    border: 1px solid var(--helm-border);
    border-radius: 8px;
}

.helm-cold-email-row {
    margin-bottom: 12px;
}

.helm-cold-email-row:last-child {
    margin-bottom: 0;
}

.helm-cold-email-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #566573;
    margin-bottom: 4px;
}

.helm-cold-email-subject {
    margin: 0;
    font-weight: 600;
    color: var(--primary-color);
}

.helm-cold-email-body {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #2c3e50;
}

.helm-cold-email-cta {
    margin: 0;
    font-style: italic;
    color: #1f618d;
}

.helm-cold-email-verify {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--helm-border);
}

.helm-decision-task-preview {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--helm-border);
}

.helm-decision-task-preview h5 {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.helm-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.helm-badge.pending { background: #fef9e7; color: #b7950b; }
.helm-badge.approved { background: #eafaf1; color: #1e8449; }
.helm-badge.rejected { background: #fdedec; color: #922b21; }
.helm-badge.running { background: #ebf5fb; color: #1f618d; }
.helm-badge.queued { background: #f4f6f7; color: #566573; }
.helm-badge.verified { background: #eafaf1; color: #1e8449; }
.helm-badge.failed { background: #fdedec; color: #922b21; }

.helm-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.helm-list-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--helm-border);
}

.helm-list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.helm-list-item header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.helm-list-item h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.helm-meta {
    font-size: 0.82rem;
    color: var(--helm-muted);
}

.helm-ev {
    font-weight: 600;
}

.helm-ev.positive { color: var(--helm-success); }
.helm-ev.negative { color: var(--helm-danger); }

.helm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.helm-actions button {
    width: auto;
    padding: 8px 14px;
    font-size: 0.85rem;
}

.helm-actions .btn-approve {
    background: var(--helm-success);
}

.helm-actions .btn-approve:hover {
    background: #219a52;
}

.helm-actions .btn-reject {
    background: var(--helm-danger);
}

.helm-actions .btn-reject:hover {
    background: #a93226;
}

.helm-actions .btn-secondary {
    background: #95a5a6;
}

.helm-actions .btn-secondary:hover {
    background: #7f8c8d;
}

.helm-actions .btn-kill {
    background: var(--helm-danger);
    font-weight: 700;
}

.helm-progress {
    height: 4px;
    background: var(--helm-border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.helm-progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
}

.helm-agents {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.helm-agent-chip {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid var(--helm-border);
    color: var(--primary-color);
}

.helm-agent-chip.is-paused {
    opacity: 0.6;
}

.helm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.helm-toolbar button {
    width: auto;
    padding: 8px 14px;
    font-size: 0.85rem;
}

.helm-footer-links {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.88rem;
}

.helm-footer-links a {
    color: var(--accent-color);
    text-decoration: none;
}

.helm-footer-links a:hover {
    text-decoration: underline;
}

.helm-empty {
    color: var(--helm-muted);
    font-size: 0.92rem;
    font-style: italic;
}

.helm-mission {
    font-size: 0.92rem;
    color: var(--helm-muted);
    margin: 0 0 16px;
    line-height: 1.6;
}

.helm-lead {
    color: var(--helm-muted);
    font-size: 0.94rem;
    line-height: 1.65;
    margin: 0 0 16px;
}

.helm-empty-state {
    text-align: center;
    padding: 32px 24px;
}

.helm-empty-state h2,
.helm-empty-state h3 {
    margin-top: 0;
}

.helm-loading-banner {
    background: #ebf5fb;
    color: #1f618d;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.helm-error-banner {
    background: #fdedec;
    color: #922b21;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.helm-success {
    color: var(--helm-success);
    font-size: 0.88rem;
    margin: 8px 0 0;
}

.helm-error-inline {
    color: var(--helm-danger);
    font-size: 0.88rem;
    margin: 8px 0 0;
}

.helm-chat {
    max-height: 360px;
    overflow-y: auto;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid var(--helm-border);
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.helm-chat-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.55;
}

.helm-chat-user {
    align-self: flex-end;
    background: var(--accent-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.helm-chat-ai {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--helm-border);
    border-bottom-left-radius: 4px;
}

.helm-chat-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--helm-border);
    border-radius: 8px;
    font: inherit;
    resize: vertical;
    min-height: 72px;
}

.helm-chat-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.helm-input-with-mic {
    position: relative;
}

.helm-input-with-mic textarea {
    padding-right: 58px;
}

.helm-mic-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 44px;
    height: 44px;
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    background: #eef6fc;
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.18);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.helm-mic-btn .helm-mic-svg {
    display: block;
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.helm-mic-btn:hover:not(:disabled) {
    background: #dceefb;
    border-color: #2980b9;
    color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.22);
}

.helm-mic-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.28);
}

.helm-mic-btn.is-listening {
    background: #fdecea;
    border-color: #e74c3c;
    color: #c0392b;
    animation: helm-mic-pulse 1.4s ease-in-out infinite;
}

.helm-mic-btn.is-error {
    background: #fef5e7;
    border-color: #f39c12;
    color: #d68910;
}

.helm-mic-btn.is-unsupported,
.helm-mic-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@keyframes helm-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

.helm-voice-hint {
    margin: -8px 0 12px;
    font-size: 0.8rem;
    color: #7f8c8d;
    min-height: 1.2em;
}

.helm-voice-hint.is-error {
    color: var(--error-color);
}

.helm-voice-settings {
    margin: 18px 0 0;
    padding: 14px 16px;
    border: 1px solid var(--helm-border);
    border-radius: 8px;
    background: #f8fafb;
}

.helm-voice-settings legend {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0 6px;
}

.helm-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.helm-radio input {
    width: auto;
    margin: 0;
}

.helm-voice-settings-note {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #7f8c8d;
    line-height: 1.45;
}

.helm-draft-panel {
    background: #fef9e7;
    border: 1px solid #f9e79f;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.88rem;
}

.helm-draft-panel h4 {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.helm-decision-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.helm-decision-card {
    background: var(--helm-surface);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    padding: 22px 20px;
    border: 1px solid var(--helm-border);
}

.helm-decision-card header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.helm-decision-card h4 {
    margin: 0;
    font-size: 1.02rem;
    color: var(--primary-color);
}

.helm-brief {
    line-height: 1.65;
    font-size: 0.94rem;
    margin: 10px 0;
}

.helm-advisor-notes {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 12px 0;
    font-size: 0.86rem;
}

.helm-advisor-notes h5 {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: var(--helm-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.helm-advisor-notes ul {
    margin: 0;
    padding-left: 18px;
}

.helm-badge.deferred {
    background: #f4f6f7;
    color: #566573;
}

.helm-settings label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.88rem;
    color: var(--primary-color);
}

.helm-settings label input[type="text"],
.helm-settings label input[type="password"],
.helm-settings label input[type="url"] {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--helm-border);
    border-radius: 8px;
    font: inherit;
}

.helm-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.helm-check input {
    width: auto;
    margin: 0;
}

.helm-provider-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.helm-provider-tab {
    width: auto;
    padding: 8px 14px;
    font-size: 0.85rem;
    background: #f4f6f7;
    color: var(--primary-color);
    border: 1px solid var(--helm-border);
    border-radius: 8px;
}

.helm-provider-tab.is-active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.helm-provider-tab:hover {
    background: #eaf2f8;
}

.helm-provider-tab.is-active:hover {
    background: #2980b9;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    width: auto;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-primary:disabled,
button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .helm-app {
        padding: 24px 16px 48px;
    }

    .helm-brand h1 {
        font-size: 1.35rem;
    }

    .helm-nav button {
        padding: 8px 12px;
        font-size: 0.88rem;
    }

    .helm-chat-bubble {
        max-width: 95%;
    }
}
