/* ═══════════════════════════════════════════════════════════════
   VIDEO AUTO — Neon Glassmorphism Design System
   Font: Sora (UI) + JetBrains Mono (mono)
   Primary: cyan-blue gradient neon | Secondary: purple glass
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
    --bg-body: #080b14;
    --bg-sidebar: #0a0d18;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-alt: rgba(255, 255, 255, 0.03);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-console: #050609;
    --bg-hover: rgba(255, 255, 255, 0.04);

    --border: rgba(255, 255, 255, 0.08);
    --border-md: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.20);

    --text-primary: #e8ecf4;
    --text-secondary: #64748b;
    --text-muted: #374151;

    /* Cyan — primary */
    --accent: #00d4ff;
    --accent-hover: #40e0ff;
    --accent-muted: rgba(0, 212, 255, 0.12);
    --accent-glow: rgba(0, 180, 255, 0.45);
    --accent-glow-strong: rgba(0, 180, 255, 0.70);

    /* Purple — secondary */
    --purple: #8b5cf6;
    --purple-hover: #a78bfa;
    --purple-muted: rgba(139, 92, 246, 0.14);
    --purple-glow: rgba(139, 92, 246, 0.40);

    /* Semantic */
    --success: #10d9a0;
    --success-muted: rgba(16, 217, 160, 0.12);
    --error: #f43f5e;
    --error-muted: rgba(244, 63, 94, 0.12);
    --warning: #fbbf24;
    --warning-muted: rgba(251, 191, 36, 0.12);
    --info: #60a5fa;
    --info-muted: rgba(96, 165, 250, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 50px;

    --font-ui: 'Sora', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --sidebar-w: 240px;
    --transition: 0.18s ease;
}

/* ── Reset ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

/* ── Body — deep space background com glow atmosférico ──────── */
body {
    font-family: var(--font-ui);
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(ellipse 70% 60% at 20% -10%, rgba(29, 78, 216, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 110%, rgba(139, 92, 246, 0.16) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(0, 180, 255, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
}

/* ── App Layout ──────────────────────────────────────────────── */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: rgba(10, 13, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 1.75rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
    overflow: visible;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: -1px;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg,
            rgba(0, 180, 255, 0.4) 0%,
            transparent 35%,
            transparent 65%,
            rgba(139, 92, 246, 0.35) 100%);
    pointer-events: none;
}

.logo {
    padding: 0.5rem 0;
    margin: 0 -1.25rem 2rem -1.25rem;
}

.logo-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 16px rgba(0, 180, 255, 0.4));
    transition: filter 0.3s ease;
}

.logo-img:hover {
    filter: drop-shadow(0 0 20px rgba(0, 180, 255, 0.55));
}

/* ── Nav ─────────────────────────────────────────────────────── */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-btn {
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.65rem 0.85rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    font-family: var(--font-ui);
    width: 100%;
}

.nav-btn.active {
    background: rgba(0, 180, 255, 0.10);
    color: var(--accent);
    border-left-color: var(--accent);
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.nav-btn:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── WS Status ───────────────────────────────────────────────── */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--error);
    flex-shrink: 0;
    transition: all 0.3s;
}

.dot.connected {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow), 0 0 3px var(--accent);
    animation: pulse 2.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px var(--accent-glow);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 3px var(--accent-glow);
    }
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem 3rem;
    position: relative;
}

/* ── Tab Panels ──────────────────────────────────────────────── */
.tab-panel {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    animation: tabIn 0.22s ease;
}

.tab-panel.active {
    display: flex;
}

@keyframes tabIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Page Header ─────────────────────────────────────────────── */
header h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.75px;
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.highlight {
    color: var(--accent);
    text-shadow: 0 0 24px var(--accent-glow);
}

/* ── Glass Card Base ─────────────────────────────────────────── */
.panel-card,
.settings-card,
.conn-card,
.pipeline-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.panel-card {
    padding: 2rem;
}

/* Card de criação de vídeo mantém largura contida */
.panel-card.card-form {
    max-width: 820px;
}

/* ── Form Elements ───────────────────────────────────────────── */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-row {
    display: flex;
    gap: 0.6rem;
    align-items: stretch;
}

.form-row .text-input {
    flex: 1;
}

label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

/* ── Input glass stack effect ────────────────────────────────── */
.text-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        4px 4px 0 rgba(255, 255, 255, 0.025),
        8px 8px 0 rgba(255, 255, 255, 0.012);
}

.text-input:focus {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow:
        0 0 0 3px rgba(0, 212, 255, 0.10),
        0 0 16px rgba(0, 180, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.text-input::placeholder {
    color: var(--text-muted);
}

textarea.text-input {
    resize: vertical;
}

select.text-input option {
    background: #0f1420;
    color: var(--text-primary);
}

/* ── PRIMARY BUTTON — Pill, blue-cyan gradient, neon glow ────── */
.btn-primary {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.90) 0%, rgba(0, 195, 250, 0.90) 100%);
    color: #fff;
    border: 1px solid rgba(0, 210, 255, 0.40);
    padding: 0.82rem 1.8rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition);
    margin-top: 0.5rem;
    font-family: var(--font-ui);
    width: fit-content;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 0 20px rgba(0, 180, 255, 0.50),
        0 0 44px rgba(0, 180, 255, 0.22),
        0 4px 16px rgba(0, 0, 0, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.1px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 50%);
    border-radius: inherit;
    pointer-events: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(14, 210, 255, 0.95) 100%);
    transform: translateY(-1px);
    box-shadow:
        0 0 28px rgba(0, 180, 255, 0.65),
        0 0 60px rgba(0, 180, 255, 0.28),
        0 6px 20px rgba(0, 0, 0, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-icon {
    width: 16px;
    height: 16px;
}

/* ── Generate button row — primary + queue side by side ──────── */
.generate-btn-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.generate-btn-row .btn-primary {
    flex: 1.6;
}

.generate-btn-row .btn-secondary {
    flex: 1;
}

/* ── SECONDARY BUTTON — Pill, glass, purple border + glow ────── */
.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid rgba(139, 92, 246, 0.55);
    padding: 0.78rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-ui);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 0 14px rgba(139, 92, 246, 0.20),
        0 4px 12px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.10);
    border-color: rgba(139, 92, 246, 0.80);
    color: var(--purple-hover);
    box-shadow:
        0 0 22px rgba(139, 92, 246, 0.35),
        0 4px 16px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── SUCCESS BUTTON — pill ───────────────────────────────────── */
.btn-success {
    background: linear-gradient(135deg, rgba(5, 150, 100, 0.85), rgba(16, 217, 160, 0.85));
    color: #fff;
    border: 1px solid rgba(16, 217, 160, 0.40);
    padding: 0.78rem 1.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-ui);
    box-shadow:
        0 0 18px rgba(16, 217, 160, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-success:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── SMALL PRIMARY — pill ────────────────────────────────────── */
.btn-sm-primary {
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.85) 0%, rgba(0, 195, 250, 0.85) 100%);
    color: #fff;
    border: 1px solid rgba(0, 210, 255, 0.35);
    padding: 0.38rem 1rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.70rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all var(--transition);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow:
        0 0 12px rgba(0, 180, 255, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-sm-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.50), 0 4px 12px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-sm-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm-primary .icon {
    width: 12px;
    height: 12px;
}

/* ── SMALL SECONDARY — pill ──────────────────────────────────── */
.btn-sm-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.45);
    color: var(--text-secondary);
    padding: 0.34rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.70rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-sm-secondary:hover {
    border-color: rgba(139, 92, 246, 0.75);
    color: var(--purple-hover);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.28);
}

.btn-sm-danger {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.40);
    color: rgba(239, 68, 68, 0.75);
    padding: 0.34rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-sm-danger:hover {
    border-color: rgba(239, 68, 68, 0.80);
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.btn-sm-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── SMALL DANGER — pill (delete / destructive) ──────────────── */
.btn-sm-danger {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn-sm-danger:hover {
    border-color: rgba(239, 68, 68, 0.80);
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.10);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.30);
}

.btn-sm-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Icon Square Button — circular, cyan border ──────────────── */
.avatar-select-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.avatar-select-row .text-input {
    flex: 1;
}

.btn-icon-square {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.40);
    color: var(--accent);
    border-radius: var(--radius-pill);
    padding: 0 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 10px rgba(0, 180, 255, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn-icon-square:hover {
    background: rgba(0, 212, 255, 0.10);
    border-color: rgba(0, 212, 255, 0.70);
    box-shadow: 0 0 18px rgba(0, 180, 255, 0.35);
}

.btn-icon-square svg {
    width: 17px;
    height: 17px;
}

/* ── Utility Controls Row ────────────────────────────────────── */
.utility-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.utility-row .text-input {
    flex: 1;
}

.utility-row .btn-secondary {
    padding: 0 1.1rem;
    margin: 0;
    white-space: nowrap;
    font-size: 0.82rem;
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
    padding: 0.22rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.badge-done,
.badge-success {
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid rgba(16, 217, 160, 0.30);
}

.badge-running {
    background: var(--info-muted);
    color: var(--info);
    border: 1px solid rgba(96, 165, 250, 0.30);
}

.badge-error {
    background: var(--error-muted);
    color: var(--error);
    border: 1px solid rgba(244, 63, 94, 0.30);
}

.badge-queue {
    background: var(--warning-muted);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.30);
}

/* ── Pipeline Header ─────────────────────────────────────────── */
.pipeline-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ph-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.ph-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.ph-title-group h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
}

.ph-timer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.ph-timer span {
    font-size: 0.58rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-family: var(--font-mono);
    letter-spacing: 0.8px;
    margin-bottom: 0.15rem;
}

.timer-value {
    color: var(--accent);
    font-size: 1.75rem;
    font-weight: 400;
    font-family: var(--font-mono);
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 0 20px var(--accent-glow);
}

/* ── Stats Grid ──────────────────────────────────────────────── */
.ph-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stat-label {
    font-size: 0.58rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: var(--font-mono);
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stat-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-section {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.progress-bar-bg {
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1d4ed8, #00d4ff);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 180, 255, 0.50);
}

/* ── Pipeline Tabs Bar — active = glowing pill ───────────────── */
.pipeline-tabs-bar {
    display: flex;
    gap: 0.5rem;
    padding-bottom: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.ptb-tab {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    transition: all var(--transition);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    user-select: none;
}

.ptb-tab.active {
    background: rgba(0, 180, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.40);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 180, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.40);
}

.ptb-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* ── Pipeline Steps ──────────────────────────────────────────── */
.pipeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pipeline-row {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    gap: 1rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pipeline-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: all var(--transition);
}

.pipeline-row.done {
    border-color: rgba(16, 217, 160, 0.25);
    background: rgba(16, 217, 160, 0.04);
}

.pipeline-row.active {
    border-color: rgba(0, 212, 255, 0.30);
    background: rgba(0, 180, 255, 0.04);
}

.pipeline-row.error {
    border-color: rgba(244, 63, 94, 0.30);
    background: rgba(244, 63, 94, 0.04);
}

.pipeline-row.done::before {
    background: var(--success);
}

.pipeline-row.active::before {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.pipeline-row.error::before {
    background: var(--error);
}

.pr-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all var(--transition);
}

.pipeline-row.done .pr-icon {
    background: var(--success-muted);
    border-color: rgba(16, 217, 160, 0.28);
}

.pipeline-row.active .pr-icon {
    background: rgba(0, 180, 255, 0.10);
    border-color: rgba(0, 212, 255, 0.30);
    box-shadow: 0 0 14px rgba(0, 180, 255, 0.25);
}

.pipeline-row.error .pr-icon {
    background: var(--error-muted);
    border-color: rgba(244, 63, 94, 0.28);
}

.pr-info {
    flex: 1;
}

.pr-info h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.1rem;
    transition: color var(--transition);
}

.pipeline-row.done .pr-info h3,
.pipeline-row.active .pr-info h3,
.pipeline-row.error .pr-info h3 {
    color: var(--text-primary);
}

.pr-info p {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.pr-status {
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity var(--transition);
    font-family: var(--font-mono);
    font-weight: 500;
}

.pipeline-row.done .pr-status {
    opacity: 1;
    color: var(--success);
}

.pipeline-row.done .pr-status::after {
    content: '✓ DONE';
}

.pipeline-row.active .pr-status {
    opacity: 1;
    color: var(--accent);
}

.pipeline-row.active .pr-status::after {
    content: '⏳ RUNNING';
}

.pipeline-row.error .pr-status {
    opacity: 1;
    color: var(--error);
}

.pipeline-row.error .pr-status::after {
    content: '✕ ERROR';
}

/* ── Pipeline Actions ────────────────────────────────────────── */
.pipeline-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.pipeline-actions .btn-primary,
.pipeline-actions .btn-secondary {
    margin-top: 0;
}

/* ── Console / Logs ──────────────────────────────────────────── */
.console-wrapper {
    background: rgba(5, 6, 9, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.60);
}

.console-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.mac-buttons {
    display: flex;
    gap: 6px;
}

.mac-buttons span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: block;
}

.mac-buttons .close {
    background: #ff5f56;
}

.mac-buttons .minimize {
    background: #ffbd2e;
}

.mac-buttons .maximize {
    background: #27c93f;
}

.console-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    flex: 1;
    text-align: center;
}

.console-copy-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.40);
    color: var(--text-secondary);
    padding: 0.26rem 0.75rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.console-copy-btn:hover {
    border-color: rgba(139, 92, 246, 0.70);
    color: var(--purple-hover);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.20);
}

.console-body {
    padding: 1.25rem 1.5rem;
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.log-entry {
    animation: logIn 0.2s ease;
}

.log-entry .timestamp {
    color: var(--text-muted);
    margin-right: 0.6rem;
}

.log-entry.info {
    color: var(--info);
}

.log-entry.success {
    color: var(--success);
}

.log-entry.error {
    color: var(--error);
}

.log-entry.warning {
    color: var(--warning);
}

@keyframes logIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── Settings Layout ─────────────────────────────────────────── */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 900px;
}

.settings-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sc-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sc-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
    display: flex;
    align-items: center;
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.sc-icon svg {
    width: 100%;
    height: 100%;
}

.sc-title h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sc-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sc-section {
    padding-top: 1.25rem;
    margin-top: 0.25rem;
}

.sc-section+.sc-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sc-section-title {
    font-size: 0.58rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    font-family: var(--font-mono);
    margin-bottom: 1rem;
}

.sc-grid {
    display: grid;
    gap: 1.25rem;
}

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

.sc-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.sc-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.sc-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.settings-card .form-group label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.settings-card .text-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.settings-card .text-input:focus {
    border-color: rgba(0, 212, 255, 0.45);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.10), 0 0 10px rgba(0, 180, 255, 0.10);
}

.sc-help-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 0.35rem;
    display: block;
    line-height: 1.6;
}

/* ── Connection Tab ──────────────────────────────────────────── */
.conn-card {
    padding: 1.5rem;
    max-width: 820px;
    border-radius: var(--radius-lg);
}

.conn-card+.conn-card {
    margin-top: 1.25rem;
}

.conn-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.conn-card-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.conn-status-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.conn-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--error);
    flex-shrink: 0;
    transition: all 0.3s;
}

.conn-dot.connected {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 217, 160, 0.55), 0 0 3px var(--success);
    animation: pulse 2.5s infinite;
}

.conn-badge {
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
}

.conn-badge.badge-connected {
    background: rgba(16, 217, 160, 0.12);
    border-color: rgba(16, 217, 160, 0.35);
    color: var(--success);
}

.conn-badge.badge-disconnected {
    background: rgba(244, 63, 94, 0.10);
    border-color: rgba(244, 63, 94, 0.30);
    color: var(--error);
}

.conn-info-box {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    line-height: 1.6;
    border: 1px solid transparent;
}

.conn-info-box.connected {
    background: rgba(16, 217, 160, 0.07);
    border-color: rgba(16, 217, 160, 0.20);
    color: var(--success);
}

.conn-info-box.disconnected {
    background: rgba(244, 63, 94, 0.07);
    border-color: rgba(244, 63, 94, 0.20);
    color: var(--error);
}

.conn-info-box strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.conn-info-box span {
    color: var(--text-secondary);
    font-size: 0.79rem;
}

.conn-browser-area {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    min-height: 180px;
    margin-bottom: 1rem;
}

#conn-canvas {
    display: none;
    width: 100%;
    height: auto;
    cursor: pointer;
    outline: none;
}

.conn-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.875rem;
}

.conn-placeholder strong {
    color: var(--text-secondary);
}

.conn-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.conn-help-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    line-height: 1.6;
}

/* ── Job History Table ───────────────────────────────────────── */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    table-layout: fixed;
}

.history-table th {
    text-align: left;
    padding: 0.4rem 0.75rem 0.65rem;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
    font-family: var(--font-mono);
}

.history-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Col 1 — Id: 7% */
.history-table th:nth-child(1),
.history-table td:nth-child(1) { width: 7%; font-family: var(--font-mono); font-size: 0.69rem; color: var(--text-muted); }

/* Col 2 — Tópico: 32% */
.history-table th:nth-child(2),
.history-table td:nth-child(2) { width: 32%; color: var(--text-primary); }

/* Col 3 — Avatar: 16% */
.history-table th:nth-child(3),
.history-table td:nth-child(3) { width: 16%; }

/* Col 4 — Status: 8% */
.history-table th:nth-child(4),
.history-table td:nth-child(4) { width: 8%; text-align: center; }

/* Col 5 — Data: 14% */
.history-table th:nth-child(5),
.history-table td:nth-child(5) { width: 14%; font-size: 0.77rem; }

/* Col 6 — Ação: 23% */
.history-table th:nth-child(6),
.history-table td:nth-child(6) { width: 23%; text-align: right; white-space: nowrap; overflow: visible; }

.job-id-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 6px;
    padding: 1px 7px;
    margin-right: 8px;
    vertical-align: middle;
    white-space: nowrap;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* ── Script Modal ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.70);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.is-open {
    display: flex;
    animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-box {
    background: rgba(12, 16, 28, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(0, 212, 255, 0.20);
    border-radius: var(--radius-xl);
    box-shadow:
        0 0 60px rgba(0, 180, 255, 0.12),
        0 24px 80px rgba(0, 0, 0, 0.60),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 780px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.22s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 1.75rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    letter-spacing: -0.2px;
    margin-bottom: 0.25rem;
}

.modal-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    max-width: 580px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.3rem;
}

.modal-stats {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--accent);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.modal-close-btn:hover {
    background: rgba(244, 63, 94, 0.15);
    color: var(--error);
    border-color: rgba(244, 63, 94, 0.30);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.75rem;
}

.script-content {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.75;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.modal-footer {
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* ── Section label inside panel-card ────────────────────────── */
.panel-section-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.job-id-pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    background: linear-gradient(135deg, rgba(0, 195, 250, 0.10), rgba(139, 92, 246, 0.10));
    border: 1px solid rgba(0, 195, 250, 0.28);
    color: #ffffff;
    border-radius: 6px;
    padding: 2px 8px;
    box-shadow: 0 0 6px rgba(0, 195, 250, 0.12);
}

#history-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, rgba(0, 195, 250, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(0, 195, 250, 0.35);
    color: var(--accent-primary);
    box-shadow: 0 0 8px rgba(0, 195, 250, 0.2);
    letter-spacing: 0.3px;
}

/* ── Avatar Prompts ──────────────────────────────────────────── */
.avatar-prompt-group {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.avatar-prompt-group:first-child {
    border-top: none;
    padding-top: 0;
}

.avatar-prompt-id {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Help text sm ────────────────────────────────────────────── */
.help-text-sm {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    line-height: 1.5;
    display: block;
    margin-top: 0.3rem;
}

/* ── Utilities ───────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.13);
}

/* ── #tab-logs full height ───────────────────────────────────── */
#tab-logs {
    height: 100%;
    min-height: 0;
}

#tab-logs .console-wrapper {
    flex: 1;
    min-height: 0;
}

/* ═══════════════════════════════════════════════════════════════
   ENHANCEMENT LAYER v2 — High-impact polish
   Added: noise texture · pipeline spine · shimmer · sweep ·
          stat accents · settings accent · log improvements
═══════════════════════════════════════════════════════════════ */

/* ── 1. Noise grain overlay ──────────────────────────────────── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.028;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 300px 300px;
    background-repeat: repeat;
}

/* ── 2. Dot grid in background ───────────────────────────────── */
.app-container::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
}

/* ── 3. Pipeline spine (vertical connecting line) ────────────── */
.pipeline-list {
    position: relative;
}

.pipeline-list::before {
    content: '';
    position: absolute;
    left: 29px;
    top: 28px;
    bottom: 28px;
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(0, 180, 255, 0.18) 8%,
        rgba(0, 180, 255, 0.12) 92%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* ── 4. Progress bar shimmer animation ───────────────────────── */
@keyframes progressShimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.progress-bar-bg {
    height: 6px;
}

.progress-bar-fill {
    background: linear-gradient(90deg,
        #1d4ed8 0%,
        #00c3fa 35%,
        rgba(160, 240, 255, 0.85) 50%,
        #00c3fa 65%,
        #1d4ed8 100%
    );
    background-size: 200% auto;
    animation: progressShimmer 2.8s linear infinite;
    box-shadow: 0 0 12px rgba(0, 180, 255, 0.65), 0 0 4px rgba(0, 180, 255, 0.4);
}

/* ── 5. Active pipeline row — sweep + pulse ──────────────────── */
@keyframes activeSweep {
    0%   { transform: translateX(-150%); }
    100% { transform: translateX(250%); }
}

@keyframes rowPulse {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 0 0 rgba(0, 180, 255, 0); }
    50%       { box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 0 3px rgba(0, 180, 255, 0.06); }
}

.pipeline-row.active {
    animation: rowPulse 2.2s ease-in-out infinite;
}

.pipeline-row.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 35%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 180, 255, 0.06), transparent);
    animation: activeSweep 2.4s ease-in-out infinite;
    pointer-events: none;
}

/* ── 6. Pipeline row icon — SVG styling ──────────────────────── */
.pr-icon svg {
    width: 16px;
    height: 16px;
    stroke: rgba(255,255,255,0.35);
    transition: stroke var(--transition);
}

.pipeline-row.done .pr-icon svg {
    stroke: var(--success);
    filter: drop-shadow(0 0 4px rgba(16, 217, 160, 0.5));
}

.pipeline-row.active .pr-icon svg {
    stroke: var(--accent);
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.pipeline-row.error .pr-icon svg {
    stroke: var(--error);
    filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.5));
}

/* ── 7. Stat cards — colored top border by position ─────────── */
.ph-stats .stat-card:nth-child(1) {
    border-top: 2px solid rgba(0, 212, 255, 0.35);
}
.ph-stats .stat-card:nth-child(2) {
    border-top: 2px solid rgba(139, 92, 246, 0.35);
}
.ph-stats .stat-card:nth-child(3) {
    border-top: 2px solid rgba(251, 191, 36, 0.35);
}
.ph-stats .stat-card:nth-child(4) {
    border-top: 2px solid rgba(16, 217, 160, 0.35);
}

/* ── 8. Settings card — animated left accent border ─────────── */
.settings-card {
    border-left: 2px solid rgba(0, 212, 255, 0.12);
    transition: border-left-color 0.35s ease, box-shadow 0.35s ease;
}

.settings-card:focus-within {
    border-left-color: rgba(0, 212, 255, 0.50);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        -3px 0 20px rgba(0, 180, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

/* ── 9. RUNNING status text — blink ──────────────────────────── */
@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.pipeline-row.active .pr-status::after {
    content: '● RUNNING';
    animation: statusBlink 1.4s ease-in-out infinite;
}

/* ── 10. pr-status done — checkmark style ────────────────────── */
.pipeline-row.done .pr-status::after {
    content: '✓ DONE';
}

.pipeline-row.error .pr-status::after {
    content: '✕ ERROR';
}

/* ── 11. Timer pulse when running ────────────────────────────── */
@keyframes timerGlow {
    0%, 100% { text-shadow: 0 0 18px var(--accent-glow); }
    50%       { text-shadow: 0 0 32px var(--accent-glow-strong), 0 0 60px rgba(0, 180, 255, 0.18); }
}

#pipeline-timer {
    animation: timerGlow 2s ease-in-out infinite;
}

/* ── 12. Log entry improvements ──────────────────────────────── */
.log-entry {
    animation: logIn 0.15s ease;
    padding: 1px 0;
}

.log-entry.success {
    text-shadow: 0 0 10px rgba(16, 217, 160, 0.3);
}

.log-entry.error {
    background: rgba(244, 63, 94, 0.05);
    border-radius: 3px;
    padding: 2px 5px;
    margin: 0 -5px;
}

.console-body::-webkit-scrollbar {
    width: 4px;
}

.console-body::-webkit-scrollbar-track {
    background: transparent;
}

.console-body::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 255, 0.25);
    border-radius: 2px;
}

.console-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 180, 255, 0.45);
}

/* ── 13. Card panel hover improvement ────────────────────────── */
.panel-card {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 6px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* ── 14. Pipeline row done — subtle checkmark accent ─────────── */
.pipeline-row.done {
    background: linear-gradient(90deg, rgba(16, 217, 160, 0.035) 0%, rgba(16, 217, 160, 0.015) 40%, transparent 100%);
}

/* ── 15. Sidebar nav active — glow halo ──────────────────────── */
.nav-btn.active {
    box-shadow:
        inset 4px 0 12px rgba(0, 180, 255, 0.06),
        0 0 16px rgba(0, 180, 255, 0.06);
}

/* ── 16. Input stack — enhanced hover ────────────────────────── */
.text-input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── 17. Badge running — pulse animation ─────────────────────── */
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 180, 255, 0.3); }
    50%       { box-shadow: 0 0 0 4px rgba(0, 180, 255, 0.0); }
}

.badge-running {
    animation: badgePulse 2s ease-in-out infinite;
}

/* ── 18. Pipeline header — section separator glow ────────────── */
.pipeline-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 180, 255, 0.25), rgba(139, 92, 246, 0.20), transparent);
    pointer-events: none;
}

/* ── 19. Main content scrollbar styling ─────────────────────── */
.main-content::-webkit-scrollbar {
    width: 5px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 180, 255, 0.25);
}

/* ── 20. Pipeline step — tab animation improvement ───────────── */
@keyframes tabIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── 21. Step-done icon — special treatment ─────────────────── */
#step-done.done .pr-icon {
    background: linear-gradient(135deg, rgba(16, 217, 160, 0.15), rgba(0, 180, 255, 0.10));
    border-color: rgba(16, 217, 160, 0.40);
    box-shadow: 0 0 20px rgba(16, 217, 160, 0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}

#step-done.done .pr-info h3 {
    background: linear-gradient(90deg, var(--success), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── 22. History table improvements ─────────────────────────── */
.history-table tbody tr {
    transition: background 0.18s ease;
}

.history-table tbody tr:hover {
    background: rgba(0, 180, 255, 0.04);
}
/* ── 23. Login Overlay ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=Sora:wght@300;400;500&display=swap');

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #070a12;
    overflow: hidden;
}

.login-overlay.hidden {
    display: none;
}

/* Animated grid background */
.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,212,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 40%, transparent 100%);
    pointer-events: none;
}

/* Radial glow behind card */
.login-overlay::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,212,255,0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* Scan line */
.login-scanline {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0,212,255,0.25), transparent);
    animation: scanline 6s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes scanline {
    0%   { top: -2px; opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Circuit corners */
.circuit-corner {
    position: absolute;
    pointer-events: none;
    opacity: 0.7;
    animation: cornerPulse 4s ease-in-out infinite;
}
.circuit-tl { top: 0; left: 0; }
.circuit-tr { top: 0; right: 0; transform: scaleX(-1); }
.circuit-bl { bottom: 0; left: 0; transform: scaleY(-1); }
.circuit-br { bottom: 0; right: 0; transform: scale(-1); }

@keyframes cornerPulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 0.9; }
}

/* Card */
.login-card {
    position: relative;
    z-index: 2;
    background: rgba(10, 14, 26, 0.92);
    border: 1px solid rgba(0, 212, 255, 0.18);
    border-radius: 18px;
    padding: 2.75rem 2.25rem 2.25rem;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    box-shadow:
        0 0 0 1px rgba(0,212,255,0.06),
        0 24px 64px rgba(0,0,0,0.7),
        inset 0 1px 0 rgba(255,255,255,0.05);
    animation: cardIn 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo */
.login-logo-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-logo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(0,212,255,0.3);
    animation: ringPulse 3s ease-in-out infinite;
}

.login-logo-ring::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(0,212,255,0.1);
    animation: ringPulse 3s ease-in-out infinite 0.5s;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%       { transform: scale(1.08); opacity: 1; }
}

.login-logo-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    border-radius: 18px;
}

/* Title */
.login-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #e8ecf4;
    margin: 0 0 0.35rem;
    text-align: center;
    letter-spacing: 0.01em;
}

.login-subtitle {
    font-family: 'Sora', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    color: #64748b;
    margin: 0 0 1.75rem;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Form */
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.login-field {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: #64748b;
    pointer-events: none;
    transition: color 0.2s;
    flex-shrink: 0;
}

.login-field:focus-within .login-field-icon {
    color: #00d4ff;
}

.login-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #e8ecf4;
    font-family: 'Sora', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.login-input::placeholder {
    color: #374151;
}

.login-input:focus {
    border-color: rgba(0,212,255,0.4);
    background: rgba(0,212,255,0.03);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.08), inset 0 0 20px rgba(0,212,255,0.02);
}

/* Error */
.login-error {
    font-family: 'Sora', sans-serif;
    font-size: 0.8rem;
    color: #f43f5e;
    text-align: center;
    padding: 0.5rem 0.75rem;
    background: rgba(244,63,94,0.08);
    border: 1px solid rgba(244,63,94,0.2);
    border-radius: 8px;
}

/* Button */
.login-btn {
    margin-top: 0.375rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    background: #00d4ff;
    border: none;
    border-radius: 10px;
    color: #070a12;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    box-shadow: 0 0 16px rgba(0,212,255,0.35), 0 4px 12px rgba(0,0,0,0.4);
}

.login-btn:hover {
    background: #40e0ff;
    box-shadow: 0 0 28px rgba(0,212,255,0.55), 0 4px 16px rgba(0,0,0,0.5);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 12px rgba(0,212,255,0.3);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-btn-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.login-btn:hover .login-btn-arrow {
    transform: translateX(3px);
}

/* ── 24. Logout Button ──────────────────────────────────────── */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(244,63,94,0.2);
    border-radius: 8px;
    color: rgba(244,63,94,0.65);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.logout-btn:hover {
    background: rgba(244,63,94,0.08);
    color: #f43f5e;
    border-color: rgba(244,63,94,0.4);
}

.logout-btn .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
