:root {
    --bg-gradient: linear-gradient(135deg, #0d0f1a 0%, #151a30 50%, #0d0f1a 100%);
    --panel-bg: rgba(22, 28, 45, 0.45);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* App Container Layout */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    width: 100vw;
    height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    background: rgba(10, 12, 22, 0.6);
    border-right: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    height: 100%;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 36px;
    padding-left: 8px;
}

.logo-accent {
    color: var(--accent-blue);
}

.logo-subtitle {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-top: -2px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    transition: var(--transition-fast);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.menu-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.menu-icon {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--panel-border);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator-dot.idle {
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

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

.status-indicator-dot.failed {
    background-color: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

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

/* Workspace Layout */
.workspace {
    display: flex;
    flex-direction: column;
    padding: 32px 40px;
    overflow-y: auto;
    height: 100vh;
}

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

.header-info h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.header-sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 16px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.profile-details {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Tab Management */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease;
}

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

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

/* Metrics Row */
.status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-fast);
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.metric-icon.sftp {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.metric-icon.nextcloud {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.metric-icon.progress-icon {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.metric-icon svg {
    width: 24px;
    height: 24px;
}

.metric-details {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-details h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Automation Content Board */
.live-board-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}

.progress-panel h2, .results-panel h2, .console-panel h2, .upload-container h2, .settings-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    margin-bottom: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.steps-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding-left: 8px;
}

.steps-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.step-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1f2937;
    border: 2px solid #374151;
    transition: var(--transition-fast);
}

.step-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.step-item.active .step-dot {
    background: var(--accent-orange);
    border-color: #ffedd5;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

.step-item.active .step-label {
    color: var(--text-primary);
    font-weight: 500;
}

.step-item.completed .step-dot {
    background: var(--accent-green);
    border-color: #d1fae5;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.step-item.completed .step-label {
    color: var(--text-secondary);
    text-decoration: line-through;
}

/* Results panel */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    min-height: 200px;
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
    gap: 12px;
}

.empty-state svg {
    opacity: 0.25;
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 300px;
    line-height: 1.4;
}

/* Dynamic Agent Card */
.agent-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
}

.agent-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

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

.agent-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.agent-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

.agent-status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.agent-status-badge.processing {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.agent-score-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

.score-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.score-circle.completed {
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.agent-footer-link {
    font-size: 0.8rem;
    color: var(--accent-blue);
    text-decoration: none;
    text-align: center;
    display: block;
    margin-top: 4px;
}

/* Console Panel */
.console-panel {
    display: flex;
    flex-direction: column;
    height: 240px;
    padding: 16px 20px;
}

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

.console-header h2 {
    margin-bottom: 0 !important;
}

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
}

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

.console-body {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.log-line {
    word-break: break-all;
}

.log-line.text-info { color: var(--text-secondary); }
.log-line.text-success { color: var(--accent-green); }
.log-line.text-warning { color: var(--accent-orange); }
.log-line.text-error { color: var(--accent-red); }
.log-line.text-system { color: var(--accent-blue); }

/* File Upload UI */
.upload-container {
    max-width: 600px;
    margin: 40px auto;
}

.upload-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 16px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 16px;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.drop-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.drop-text {
    font-size: 1.05rem;
    font-weight: 500;
}

.drop-or {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.file-label-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.file-label-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.selected-file-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    color: var(--accent-blue);
}

.file-name-size {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.remove-file-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.remove-file-btn:hover {
    color: var(--accent-red);
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 24px;
    transition: var(--transition-fast);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

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

/* Month Input Styling */
.month-input-group {
    margin-top: 20px;
}

.month-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.optional-badge {
    font-size: 0.7rem;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 6px;
    padding: 2px 8px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.month-input-group input[type="text"] {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 10px 14px;
    color: white;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    outline: none;
    width: 100%;
    transition: var(--transition-fast);
    letter-spacing: 0.1em;
}

.month-input-group input[type="text"]:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}

.month-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.7;
}

/* Settings Form UI */
.settings-card {
    max-width: 760px;
    margin: 0 auto;
}

.settings-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.form-section {
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"] {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 10px 14px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-actions {
    margin-top: 16px;
}

.panel-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-header-inline h2 {
    margin-bottom: 0 !important;
}

.stop-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.stop-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.2);
}

