/* CSS Variables - Ryan Colors for Light/Dark Mode */
:root {
    --ryan-blue: #2563EB;
    --ryan-green: #059669;
    --ryan-error: #DC2626;
    --bg-primary: white;
    --bg-secondary: #F8FAFC;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --navbar-height: 64px;
    --sidebar-width: 240px;
}

[data-theme="dark"] {
    --ryan-blue: #3B82F6;
    --ryan-green: #10B981;
    --ryan-error: #EF4444;
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --border-color: #334155;
}

/* Base Reset Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-size: 16px;
}

body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Top Bar Styles */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
}

.topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.topbar-logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--ryan-blue);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-link {
    text-decoration: none;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ryan-blue);
    cursor: pointer;
}

.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.sidebar-nav-item,
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border-right: 3px solid transparent;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar-nav-item:hover,
.nav-item:hover {
    background-color: var(--bg-secondary);
    color: var(--ryan-blue);
}

.sidebar-nav-item.active,
.nav-item.active {
    color: var(--ryan-blue);
    background-color: var(--bg-secondary);
    border-right-color: var(--ryan-blue);
    font-weight: 500;
}

.sidebar-nav-item-icon,
.nav-icon {
    font-size: 1.25rem;
}

.nav-text {
    font-size: 0.875rem;
}

/* Main Content Area Styles */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--navbar-height);
    transition: background 0.3s;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-area {
    padding: 24px;
    padding-top: calc(var(--navbar-height) + 24px);
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--border-color);
}

.theme-icon {
    display: inline-block;
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: hidden;
}

.tab-nav-item {
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.tab-nav-item.active {
    color: var(--ryan-blue);
    border-bottom-color: var(--ryan-blue);
}

.tab-nav-item:focus {
    outline: none;
}

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

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-panel {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Utility Classes */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-description {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Scrollbar Styles */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Executions Table Styles */
.executions-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
}

.executions-table th,
.executions-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.executions-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.executions-table tbody tr {
    transition: background-color 0.2s ease;
}

.executions-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

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

/* Status Badge Styles */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-success {
    background-color: #D1FAE5;
    color: var(--ryan-green);
}

[data-theme="dark"] .status-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--ryan-green);
}

.status-failed {
    background-color: #FEE2E2;
    color: var(--ryan-error);
}

[data-theme="dark"] .status-failed {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--ryan-error);
}

.status-running {
    background-color: #DBEAFE;
    color: var(--ryan-blue);
}

[data-theme="dark"] .status-running {
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--ryan-blue);
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--ryan-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-close:hover {
    color: var(--text-primary);
}

/* Loading & Empty States */
.loading,
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: var(--bg-primary);
    border-radius: 8px;
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.log-content {
    background-color: var(--bg-secondary);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    :root {
        --sidebar-width: 240px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .executions-table {
        font-size: 12px;
    }

    .executions-table th,
    .executions-table td {
        padding: 12px 8px;
    }

    .info-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .workflow-name-input {
        max-width: 100%;
    }
}

/* Workflow Overview Tab Styles */
.content-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Workflow Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.info-value-with-copy {
    display: flex;
    gap: 8px;
    align-items: center;
}

.info-value-readonly {
    flex: 1;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.copy-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background-color: var(--ryan-blue);
    border-color: var(--ryan-blue);
    color: white;
}

.copy-btn svg {
    display: block;
}

/* Type Badge */
.type-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
}

.type-badge.scheduler {
    background-color: #DBEAFE;
    color: var(--ryan-blue);
}

.type-badge.webhook {
    background-color: #D1FAE5;
    color: var(--ryan-green);
}

[data-theme="dark"] .type-badge.scheduler {
    background-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .type-badge.webhook {
    background-color: rgba(16, 185, 129, 0.2);
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--ryan-green);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.status-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.stat-card h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 12px;
}

.stat-details {
    font-size: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-separator {
    color: var(--text-secondary);
}

/* Table Container */
.table-container {
    overflow-x: auto;
}

.execution-table {
    width: 100%;
    border-collapse: collapse;
}

.execution-table thead {
    background-color: var(--bg-secondary);
}

.execution-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.execution-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

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

.execution-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* Top Bar (for workflow.html) */
.top-bar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -24px -24px 24px -24px;
}

.workflow-header {
    flex: 1;
}

.workflow-name-input {
    background-color: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    width: 100%;
    max-width: 500px;
    transition: all 0.2s ease;
}

.workflow-name-input:hover {
    border-color: var(--border-color);
    background-color: var(--bg-secondary);
}

.workflow-name-input:focus {
    outline: none;
    border-color: var(--ryan-blue);
    background-color: var(--bg-primary);
}

.theme-toggle {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--ryan-blue);
    border-color: var(--ryan-blue);
    color: white;
}

.theme-icon {
    display: block;
}

/* Tab Navigation (for workflow.html buttons) */
.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.tab-button.active {
    color: var(--ryan-blue);
    border-bottom-color: var(--ryan-blue);
}

.tab-content-container {
    margin-top: 24px;
}

/* JSON Viewer Styles */
.json-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.json-viewer {
    max-height: 600px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
}

.json-viewer pre {
    margin: 0;
    color: var(--text-primary);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.json-viewer code {
    color: var(--text-primary);
}

/* Integration Styles */
.integration-container,
.content-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.integration-status {
    margin-bottom: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-dot.status-connected {
    background-color: var(--ryan-green);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

.status-dot.status-disconnected {
    background-color: var(--ryan-error);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.status-text {
    font-weight: 500;
    color: var(--text-primary);
}

.integration-actions {
    margin-bottom: 2rem;
}

.integration-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.integration-info h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.integration-info ul,
.integration-info ol {
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 1.5rem;
}

.integration-info li {
    margin-bottom: 0.5rem;
}

/* Form Styles */
.integration-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--ryan-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.375rem;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: var(--ryan-blue);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--ryan-error);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-danger-outline {
    background: transparent;
    color: var(--ryan-error);
    border: 2px solid var(--ryan-error);
}

.btn-danger-outline:hover {
    background: var(--ryan-error);
    color: white;
}

/* Danger Zone Styles */
.danger-zone-container {
    border-color: var(--ryan-error) !important;
    border-width: 2px !important;
}

.danger-zone-header h2 {
    color: var(--ryan-error);
    margin-bottom: 0.5rem;
}

.danger-zone-warning {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.danger-zone-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.danger-zone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    gap: 2rem;
}

.danger-zone-item-info h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.danger-zone-item-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Data Tables Styles */
#tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.table-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.table-card:hover {
    border-color: var(--ryan-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.table-card h3 {
    margin: 0 0 12px 0;
    color: var(--ryan-blue);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 12px;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.viewer-actions {
    display: flex;
    gap: 12px;
}

.table-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.table-stats .stat {
    display: flex;
    flex-direction: column;
}

.table-stats .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-stats .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--ryan-blue);
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

[data-theme="dark"] .error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--ryan-error);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.api-key-badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Responsive adjustments for new components */
@media (max-width: 768px) {
    .danger-zone-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .json-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .workflow-name-input {
        font-size: 1.25rem;
    }

    #tables-grid {
        grid-template-columns: 1fr;
    }

    .viewer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ===============================================
   WORKFLOW FLOW DIAGRAM STYLES
   =============================================== */

.flow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.flow-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.flow-controls {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--ryan-blue);
    color: white;
    border-color: var(--ryan-blue);
}

.flow-container {
    width: 100%;
    height: 600px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.flow-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
}

.flow-canvas:active {
    cursor: grabbing;
}

/* Node Styles */
.flow-node {
    cursor: pointer;
    transition: all 0.2s;
}

.flow-node:hover .node-rect {
    stroke: var(--ryan-blue);
    stroke-width: 2;
}

.node-rect {
    fill: var(--bg-primary);
    stroke: var(--border-color);
    stroke-width: 1;
    rx: 8;
}

.node-type-conditional .node-rect {
    fill: #FEF3C7;
}

[data-theme="dark"] .node-type-conditional .node-rect {
    fill: #713F12;
}

.node-type-code .node-rect {
    fill: #DBEAFE;
}

[data-theme="dark"] .node-type-code .node-rect {
    fill: #1E3A8A;
}

.node-type-http_post .node-rect,
.node-type-http_get .node-rect {
    fill: #D1FAE5;
}

[data-theme="dark"] .node-type-http_post .node-rect,
[data-theme="dark"] .node-type-http_get .node-rect {
    fill: #064E3B;
}

.node-type-data_table .node-rect {
    fill: #E0E7FF;
}

[data-theme="dark"] .node-type-data_table .node-rect {
    fill: #312E81;
}

.node-type-telegram_send_message .node-rect,
.node-type-telegram_send_photo .node-rect,
.node-type-telegram_send_voice .node-rect {
    fill: #DBEAFE;
}

[data-theme="dark"] .node-type-telegram_send_message .node-rect,
[data-theme="dark"] .node-type-telegram_send_photo .node-rect,
[data-theme="dark"] .node-type-telegram_send_voice .node-rect {
    fill: #1E3A8A;
}

.node-type-workspace_get_feature .node-rect,
.node-type-workspace_update_feature .node-rect,
.node-type-workspace_get_roadmap .node-rect {
    fill: #FCE7F3;
}

[data-theme="dark"] .node-type-workspace_get_feature .node-rect,
[data-theme="dark"] .node-type-workspace_update_feature .node-rect,
[data-theme="dark"] .node-type-workspace_get_roadmap .node-rect {
    fill: #831843;
}

.node-label {
    fill: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

.node-type-label {
    fill: var(--text-secondary);
    font-size: 10px;
    pointer-events: none;
}

/* Edge Styles */
.flow-edge {
    fill: none;
    stroke: #94A3B8;
    stroke-width: 2;
    marker-end: url(#arrowhead);
}

.flow-edge-success {
    stroke: #10B981;
    marker-end: url(#arrowhead-success);
}

.flow-edge-error {
    stroke: #EF4444;
    marker-end: url(#arrowhead-error);
}

.edge-label {
    fill: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
}

.edge-label-bg {
    fill: var(--bg-primary);
    opacity: 0.9;
}
