@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    /* Premium Color Palette */
    --accent-blue: #00D2FF;
    --accent-purple: #9D50BB;
    --gradient-primary: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    --gradient-vibrant: linear-gradient(90deg, #FF0080 0%, #7928CA 100%);

    --bg-deep: #05070A;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-heavy: rgba(255, 255, 255, 0.07);
    --border-glass: rgba(255, 255, 255, 0.1);

    --text-main: #FFFFFF;
    --text-dim: #A0AEC0;
    --text-muted: #718096;

    --success: #00F2FE;
    --warning: #F6AD55;
    --danger: #F56565;
    --smartlead: #805AD5;

    /* Spacing & Scaling */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Base Body Styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', 'IBM Plex Sans KR', sans-serif;
    background: var(--bg-deep);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 210, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(157, 80, 187, 0.05) 0%, transparent 40%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Glassmorphism Reusable Style */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
}

/* Header Section */
.header {
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

/* Pipeline Control Bar */
.pipeline-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-glass-heavy);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s ease-out;
}

.pipeline-control-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pipeline-label {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.pipeline-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.pipeline-status-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pipeline-status-indicator.waiting {
    background: rgba(160, 174, 192, 0.15);
    color: var(--text-dim);
}

.pipeline-status-indicator.waiting .status-dot {
    background: var(--text-dim);
}

.pipeline-status-indicator.running {
    background: rgba(0, 210, 255, 0.15);
    color: var(--accent-blue);
}

.pipeline-status-indicator.running .status-dot {
    background: var(--accent-blue);
    animation: pulse-dot 1.5s infinite;
    box-shadow: 0 0 8px var(--accent-blue);
}

.pipeline-status-indicator.completed {
    background: rgba(0, 242, 254, 0.15);
    color: var(--success);
}

.pipeline-status-indicator.completed .status-dot {
    background: var(--success);
}

.pipeline-control-right {
    display: flex;
    gap: 0.8rem;
}

.btn-pipeline-start {
    background: linear-gradient(135deg, #00D2FF 0%, #00F2FE 100%);
    color: var(--bg-deep);
    padding: 0.7rem 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-pipeline-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 210, 255, 0.6);
}

.btn-pipeline-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pipeline-start .btn-icon {
    font-size: 0.9rem;
}

.btn-pipeline-stop {
    background: linear-gradient(135deg, #FF4B2B, #FF416C);
    color: white;
    padding: 0.7rem 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(255, 75, 43, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-pipeline-stop:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 75, 43, 0.6);
}

.btn-pipeline-stop:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pipeline-stop .btn-icon {
    font-size: 0.7rem;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* Navigation Tabs */
.tab-nav {
    display: flex;
    background: var(--bg-glass-heavy);
    padding: 6px;
    border-radius: var(--radius-xl);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-glass);
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-dim);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-xl);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--text-main);
    color: var(--bg-deep);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Tab Content Visibility */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section Common */
section {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

section:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-main);
}

/* Status Cards Grid */
.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
}

.card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.card-icon {
    font-size: 2.2rem;
    background: var(--bg-glass-heavy);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.card-content .card-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.card-content .card-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-pending .card-value {
    color: #FFA502;
}

.card-completed .card-value {
    color: var(--success);
}

.card-today .card-value {
    color: var(--accent-blue);
}

/* Table Styling */
.accounts-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.accounts-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-glass);
}

.accounts-table td {
    padding: 1.1rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.95rem;
}

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

/* Buttons */
.btn {
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: none;
    color: white;
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 210, 255, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #FF4B2B, #FF416C);
}

.btn-large {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
}

/* Control & Progress */
.progress-bar {
    height: 10px;
    background: var(--bg-glass-heavy);
    border-radius: 5px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-vibrant);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.4);
}

/* Logs */
.logs-container {
    background: #000000;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
    height: 250px;
    overflow-y: auto;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.85rem;
}

.log-entry {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}

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

.log-entry.error {
    color: var(--danger);
    text-shadow: 0 0 8px rgba(245, 101, 101, 0.3);
}

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

/* Animation Keyframes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* ====================================
   Dashboard Styles
   ==================================== */

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Dashboard Cards Grid */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.dashboard-card .card-icon {
    font-size: 1.2rem;
}

.dashboard-card .card-title {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

.dashboard-card .card-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.dashboard-card .card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Card Variants */
.dashboard-card.card-highlight .card-value {
    color: var(--success);
}

.dashboard-card.card-success .card-value {
    color: var(--accent-blue);
}

.dashboard-card.card-muted .card-value {
    color: var(--text-muted);
}

/* Funnel Section */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.funnel-bar {
    position: relative;
    height: 40px;
    background: var(--bg-glass-heavy);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.funnel-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.5s ease;
    border-radius: var(--radius-md);
}

.funnel-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    z-index: 1;
}

/* Error Section */
.error-section {
    background: rgba(245, 101, 101, 0.1);
    border-color: rgba(245, 101, 101, 0.3);
}

.error-count {
    font-size: 1.2rem;
    color: var(--danger);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.waiting {
    background: rgba(160, 174, 192, 0.2);
    color: var(--text-dim);
}

.status-badge.running {
    background: rgba(0, 210, 255, 0.2);
    color: var(--accent-blue);
    animation: pulse 2s infinite;
}

.status-badge.completed {
    background: rgba(0, 242, 254, 0.2);
    color: var(--success);
}

.status-badge.paused {
    background: rgba(246, 173, 85, 0.2);
    color: var(--warning);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Log Entry with Stage Colors */
.log-entry[data-stage="scrape"] { color: #F6AD55; }
.log-entry[data-stage="extract"] { color: #63B3ED; }
.log-entry[data-stage="research"] { color: #9F7AEA; }
.log-entry[data-stage="generate"] { color: #68D391; }
.log-entry[data-stage="upload"] { color: #FC8181; }
.log-entry[data-stage="orchestrator"] { color: var(--accent-blue); }

.log-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* ====================================
   Modal Styles
   ==================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    animation: fadeInDown 0.3s ease-out;
}

.modal-large {
    max-width: 900px;
    max-height: 85vh;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.modal-header .badge {
    background: var(--gradient-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bg-deep);
}

.modal-header .close-modal,
.modal-header .close-detail-modal {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
}

.modal-header .close-modal:hover,
.modal-header .close-detail-modal:hover {
    color: var(--text-main);
}

.modal-body {
    min-height: 200px;
}

.modal-footer {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* Preview Modal Styles */
.preview-field {
    margin-bottom: 1.5rem;
}

.preview-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-text {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
}

.preview-text.body-text {
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* ====================================
   Detail Table Styles
   ==================================== */

.detail-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px;
}

.detail-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.detail-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.9rem;
    color: var(--text-dim);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-table td.wrap-text {
    white-space: normal;
    word-break: break-word;
}

.detail-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
}

.detail-table td a {
    color: var(--accent-blue);
    text-decoration: none;
}

.detail-table td a:hover {
    text-decoration: underline;
}

/* B2B Suitable Badge */
.detail-table .badge-suitable {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.detail-table .badge-suitable.yes {
    background: rgba(0, 242, 254, 0.2);
    color: var(--success);
}

.detail-table .badge-suitable.no {
    background: rgba(245, 101, 101, 0.2);
    color: var(--danger);
}

/* ====================================
   Pagination Styles
   ==================================== */

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#detail-page-info {
    color: var(--text-dim);
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}

/* ====================================
   Loading Spinner Styles
   ==================================== */

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
    color: var(--text-dim);
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ====================================
   Empty State Styles
   ==================================== */

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1rem;
    text-align: center;
}

/* ====================================
   Clickable Card Styles
   ==================================== */

.dashboard-card.clickable {
    cursor: pointer;
    position: relative;
}

.dashboard-card.clickable::after {
    content: '';
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-top: 2px solid var(--text-muted);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.dashboard-card.clickable:hover::after {
    opacity: 1;
    transform: rotate(45deg) translate(2px, -2px);
}

.dashboard-card.clickable:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.15);
}

.dashboard-card.clickable:active {
    transform: translateY(-2px);
}

/* ====================================
   Pipeline Workflow Styles (n8n-like)
   ==================================== */

.pipeline-workflow-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.pipeline-workflow-section h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pipeline-canvas {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-x: auto;
    padding: 1rem 0;
}

.pipeline-row {
    display: flex;
    align-items: center;
    gap: 0;
    justify-content: flex-start;
}

.pipeline-row.row-offset {
    justify-content: flex-end;
    padding-right: calc(160px + 50px);
}

/* Pipeline Node */
.pipeline-node {
    position: relative;
    width: 160px;
    min-height: 120px;
    background: var(--bg-glass-heavy);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pipeline-node:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.15);
}

.pipeline-node .node-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.pipeline-node .node-content {
    flex: 1;
}

.pipeline-node .node-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.pipeline-node .node-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.pipeline-node .node-stats {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pipeline-node .stat-processed {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
}

.pipeline-node .stat-current {
    font-size: 0.7rem;
    color: var(--accent-blue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}

/* Node Status Badge */
.pipeline-node .node-status-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(160, 174, 192, 0.2);
    color: var(--text-muted);
}

/* Node State: Waiting */
.pipeline-node.node-waiting {
    border-color: rgba(160, 174, 192, 0.3);
    opacity: 0.7;
}

.pipeline-node.node-waiting .node-status-badge {
    background: rgba(160, 174, 192, 0.2);
    color: var(--text-muted);
}

/* Node State: Running */
.pipeline-node.node-running {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.4);
    animation: node-pulse 2s infinite;
}

.pipeline-node.node-running .node-status-badge {
    background: rgba(0, 210, 255, 0.2);
    color: var(--accent-blue);
}

/* Node State: Completed */
.pipeline-node.node-completed {
    border-color: var(--success);
}

.pipeline-node.node-completed .node-status-badge {
    background: rgba(0, 242, 254, 0.2);
    color: var(--success);
}

/* Node State: Error */
.pipeline-node.node-error {
    border-color: var(--danger);
}

.pipeline-node.node-error .node-status-badge {
    background: rgba(245, 101, 101, 0.2);
    color: var(--danger);
}

/* Node Pulse Animation */
@keyframes node-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 210, 255, 0);
    }
}

/* Pipeline Connectors */
.pipeline-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pipeline-connector.horizontal {
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--border-glass) 20%,
        var(--border-glass) 80%,
        transparent 100%);
}

.pipeline-connector.horizontal .connector-arrow {
    position: absolute;
    right: 0;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--border-glass);
}

/* Vertical Connector Wrapper */
.pipeline-vertical-connector-wrapper {
    display: flex;
    justify-content: flex-end;
    padding-right: calc(160px / 2 + 160px + 50px + 160px / 2 + 50px);
    margin: -5px 0;
}

.pipeline-connector.vertical {
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg,
        transparent 0%,
        var(--border-glass) 20%,
        var(--border-glass) 80%,
        transparent 100%);
    position: relative;
}

.pipeline-connector.vertical .connector-arrow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--border-glass);
}

/* Connector Running State */
.pipeline-connector.connector-running.horizontal {
    background: linear-gradient(90deg,
        transparent,
        var(--accent-blue) 20%,
        var(--accent-blue) 80%,
        transparent);
    background-size: 200% 100%;
    animation: flow-horizontal 1.5s linear infinite;
}

.pipeline-connector.connector-running.horizontal .connector-arrow {
    border-left-color: var(--accent-blue);
}

.pipeline-connector.connector-running.vertical {
    background: linear-gradient(180deg,
        transparent,
        var(--accent-blue) 20%,
        var(--accent-blue) 80%,
        transparent);
    background-size: 100% 200%;
    animation: flow-vertical 1.5s linear infinite;
}

.pipeline-connector.connector-running.vertical .connector-arrow {
    border-top-color: var(--accent-blue);
}

/* Connector Completed State */
.pipeline-connector.connector-completed.horizontal {
    background: linear-gradient(90deg,
        transparent 0%,
        var(--success) 20%,
        var(--success) 80%,
        transparent 100%);
}

.pipeline-connector.connector-completed.horizontal .connector-arrow {
    border-left-color: var(--success);
}

.pipeline-connector.connector-completed.vertical {
    background: linear-gradient(180deg,
        transparent 0%,
        var(--success) 20%,
        var(--success) 80%,
        transparent 100%);
}

.pipeline-connector.connector-completed.vertical .connector-arrow {
    border-top-color: var(--success);
}

/* Flow Animations */
@keyframes flow-horizontal {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

@keyframes flow-vertical {
    0% {
        background-position: 0 100%;
    }
    100% {
        background-position: 0 -100%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .tab-nav {
        flex-direction: column;
        border-radius: var(--radius-lg);
    }

    .status-cards {
        grid-template-columns: 1fr;
    }

    .pipeline-stages {
        justify-content: center;
    }

    .stage-arrow {
        display: none;
    }

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

    .dashboard-card .card-value {
        font-size: 2rem;
    }

    .pipeline-control-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .pipeline-control-left {
        width: 100%;
        justify-content: center;
    }

    .pipeline-control-right {
        width: 100%;
        justify-content: center;
    }

    .btn-pipeline-start,
    .btn-pipeline-stop {
        flex: 1;
        justify-content: center;
    }

    /* Pipeline Workflow Mobile */
    .pipeline-canvas {
        align-items: center;
    }

    .pipeline-row {
        flex-direction: column;
        gap: 0;
    }

    .pipeline-row.row-offset {
        justify-content: center;
        padding-right: 0;
    }

    .pipeline-node {
        width: 100%;
        max-width: 200px;
        min-height: 100px;
    }

    .pipeline-connector.horizontal {
        width: 2px;
        height: 30px;
        background: linear-gradient(180deg,
            transparent 0%,
            var(--border-glass) 20%,
            var(--border-glass) 80%,
            transparent 100%);
    }

    .pipeline-connector.horizontal .connector-arrow {
        right: auto;
        bottom: 0;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        border-top: 8px solid var(--border-glass);
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: none;
    }

    .pipeline-connector.connector-running.horizontal {
        background: linear-gradient(180deg,
            transparent,
            var(--accent-blue) 20%,
            var(--accent-blue) 80%,
            transparent);
        background-size: 100% 200%;
        animation: flow-vertical 1.5s linear infinite;
    }

    .pipeline-connector.connector-running.horizontal .connector-arrow {
        border-top-color: var(--accent-blue);
        border-left-color: transparent;
    }

    .pipeline-connector.connector-completed.horizontal {
        background: linear-gradient(180deg,
            transparent 0%,
            var(--success) 20%,
            var(--success) 80%,
            transparent 100%);
    }

    .pipeline-connector.connector-completed.horizontal .connector-arrow {
        border-top-color: var(--success);
        border-left-color: transparent;
    }

    .pipeline-vertical-connector-wrapper {
        justify-content: center;
        padding-right: 0;
    }

    .pipeline-connector.vertical {
        height: 30px;
    }

    /* Modal Responsive */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
    }

    .modal-large {
        max-width: 100%;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .detail-table-container {
        margin: 0 -1rem;
        border-radius: 0;
    }

    .detail-table {
        min-width: 500px;
    }

    .detail-table th,
    .detail-table td {
        padding: 0.7rem 0.8rem;
        font-size: 0.8rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pagination button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}