:root {
    --bg-main: #0b1120;
    --bg-secondary: #0f172a;
    --bg-glass: rgba(30, 41, 59, 0.4);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --accent-glow: #0ea5e9;
    --accent-hover: #38bdf8;
    --accent-danger: #ef4444;
    --accent-danger-hover: #f87171;
    --accent-success: #10b981;
    --panel-radius: 16px;
    --btn-radius: 8px;
    --font-fam: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-fam);
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.03), transparent 25%);
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    margin-bottom: 3rem;
    gap: 12px;
}

.logo-container img {
    height: 38px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.accent {
    color: var(--accent-glow);
}

.nav-menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--accent-glow);
}

.system-status {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
}

.status-indicator.online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-success);
    box-shadow: 0 0 10px var(--accent-success);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.avatar {
    width: 45px;
    height: 45px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent-glow);
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 55fr 45fr;
    gap: 1.5rem;
    align-items: start;
}

.master-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-column {
    display: flex;
    flex-direction: column;
}

.full-width {
    grid-column: 1 / -1;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--panel-radius);
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.glass-panel h2 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.panel-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.panel-header-flex h2 {
    margin-bottom: 0;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--btn-radius);
    padding: 0.8rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--accent-glow);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

/* Modes Cards (Interactive Data Mining Triggers) */
.mode-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mode-card {
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--btn-radius);
    transition: all 0.3s ease;
}

.mode-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.card-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.card-icon {
    font-size: 1.5rem;
    color: var(--accent-glow);
    flex-shrink: 0;
}

.card-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.card-actions .btn {
    padding: 0.5rem 0.8rem;
    border-radius: var(--btn-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.card-content .title {
    font-weight: 600;
    font-size: 1.05rem;
}

.card-content .desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Buttons */
.action-controls {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--btn-radius);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex: 1;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.primary-btn {
    background: var(--accent-glow);
    color: #fff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.primary-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.danger-btn {
    background: var(--accent-danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.danger-btn:hover:not(:disabled) {
    background: var(--accent-danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.secondary-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.small-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    flex: none;
}

/* Status Display */
.status-display {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.status-box {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--btn-radius);
    padding: 1rem;
    text-align: center;
}

.status-box .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-box .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-glow);
}

.status-box .time-value {
    font-variant-numeric: tabular-nums;
}

/* Progress */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0ea5e9, #10b981);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

/* Live Logs */
.live-logs {
    background: #050810;
    border: 1px solid var(--border-glass);
    border-radius: var(--btn-radius);
    padding: 1rem;
    height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.85rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-entry.error {
    color: #f87171;
}

.log-entry.success {
    color: #34d399;
}

.log-entry.info {
    color: #38bdf8;
}

/* Results Feed Cards */
.results-feed {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.rc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    padding: 0.5rem 0.8rem;
    background: rgba(15, 23, 42, 0.4);
}

.rc-header h3 {
    margin: 0;
    font-size: 1rem;
}

.rc-header a {
    color: var(--accent-glow);
    text-decoration: none;
    word-break: break-all;
}

.rc-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rc-body {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 0.8rem;
    padding: 0.8rem;
}

.rc-section h4 {
    margin: 0 0 0.2rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rc-text-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    padding: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.3;
    max-height: 800px;
    overflow-y: auto;
    color: #e2e8f0;
}

.rc-text-box.small {
    font-size: 0.8rem;
    max-height: 300px;
}

.rc-side {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.done {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.fail {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.mini-score {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #0ea5e920;
    color: #38bdf8;
    border: 1px solid #0ea5e940;
    font-weight: bold;
    font-size: 0.8rem;
}