/* =============================================================================
   SHELLDER GUI - CSS STYLES
   A modern, dark-themed dashboard for Aegis AIO
   ============================================================================= */

:root {
    /* Color Palette - Deep Ocean Theme */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-card: #161d2e;
    --bg-hover: #1e2943;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.3);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #1e293b;
    --border-light: rgba(255, 255, 255, 0.05);
    
    /* Typography */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

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

html, body {
    height: 100%;
    font-family: var(--font-main);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app {
    display: flex;
    min-height: 100vh;
}

/* =============================================================================
   SIDEBAR
   ============================================================================= */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo-name {
    font-size: 22px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-version {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.nav-scroll::-webkit-scrollbar {
    width: 6px;
}

.nav-scroll::-webkit-scrollbar-track {
    background: transparent;
}

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

.nav-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.nav-section {
    padding: 16px 12px;
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    margin-bottom: 4px;
}

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

.nav-item.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition-normal);
}

.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

.status-dot.error {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger-glow);
}

/* =============================================================================
   MAIN CONTENT
   ============================================================================= */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-primary);
}

.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

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

.last-update {
    font-size: 13px;
    color: var(--text-muted);
}

/* Pages */
.page {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* =============================================================================
   CARDS
   ============================================================================= */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.card.full-height {
    min-height: calc(100vh - var(--header-height) - 64px);
}

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.card-body {
    padding: 24px;
}

/* =============================================================================
   STATS GRID
   ============================================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stats-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
    .stats-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition-fast);
    position: relative;
    overflow: visible;  /* Changed to allow dropdowns */
}

/* Cards with dropdowns need higher z-index when dropdown is open */
#configVarsCard {
    z-index: 10;
}

.stat-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.stat-card.clickable::after {
    content: '📊';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.stat-card.clickable:hover::after {
    opacity: 0.6;
}

/* Sparkline mini-chart */
.stat-sparkline {
    height: 24px;
    margin-top: 8px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.stat-sparkline .bar {
    flex: 1;
    min-width: 3px;
    max-width: 8px;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
    opacity: 0.7;
    transition: height 0.3s ease, opacity 0.2s;
}

.stat-sparkline .bar:last-child {
    opacity: 1;
    background: var(--accent-secondary);
}

.stat-sparkline:hover .bar {
    opacity: 1;
}

/* Color coding for sparkline bars based on value */
.stat-sparkline .bar.low { background: var(--success); }
.stat-sparkline .bar.medium { background: var(--warning); }
.stat-sparkline .bar.high { background: var(--danger); }

/* Metric Detail Modal */
.metric-detail-modal {
    min-height: 300px;
}

.metric-time-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.metric-time-controls .btn {
    flex: 1;
}

.metric-time-controls .btn.active {
    background: var(--accent-primary);
    color: white;
}

.metric-chart {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    min-height: 150px;
}

/* Chart with proper X and Y axes */
.chart-wrapper {
    display: flex;
    height: 180px;
    gap: 8px;
}

.chart-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    padding: 0 4px 20px 0;
    min-width: 40px;
}

.chart-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chart-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 1px; /* Small gap between bars */
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 4px 4px 0 4px;
    min-height: 150px;
    /* Ensure bars fill the entire width */
    justify-content: stretch;
    overflow: hidden; /* Prevent scrollbar - bars will shrink to fit */
}

.chart-bar {
    flex: 1 1 0; /* Allow shrinking below content size */
    min-width: 1px; /* Minimum visibility */
    /* No max-width - let bars expand to fill space when few data points */
    border-radius: 2px 2px 0 0;
    transition: opacity 0.2s;
    cursor: crosshair;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-bar.low { background: var(--success); }
.chart-bar.medium { background: var(--warning); }
.chart-bar.high { background: var(--danger); }

.chart-x-axis {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px 0 4px;
    font-size: 10px;
    color: var(--text-muted);
}

/* Legacy .chart-container and .chart-axis for backwards compat */
.chart-container {
    display: flex;
    flex-direction: column;
    height: 150px;
}

.chart-axis {
    display: flex;
    justify-content: space-between;
    padding-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.metric-stats {
    margin-top: 16px;
}

.metric-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.metric-stat {
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.metric-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.metric-stat-info {
    text-align: center;
    color: var(--text-muted);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.running {
    background: rgba(16, 185, 129, 0.15);
}

.stat-icon.stopped {
    background: rgba(239, 68, 68, 0.15);
}

.stat-icon.memory {
    background: rgba(59, 130, 246, 0.15);
}

.stat-icon.disk {
    background: rgba(245, 158, 11, 0.15);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sync status light for config variables */
.sync-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sync-light.checking {
    background: #6b7280;
    animation: pulse-light 1.5s infinite;
}

.sync-light.synced {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.sync-light.mismatch {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulse-error 1.5s infinite;
}

.sync-light.partial {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

@keyframes pulse-light {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Stat Card Dropdown */
.stat-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 100;
    margin-top: 8px;
    min-width: 280px;
    max-height: 400px;
    overflow: hidden;
}

.stat-dropdown.show {
    display: block;
    animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-dropdown .dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.stat-dropdown .dropdown-content {
    padding: 12px;
    max-height: 280px;
    overflow-y: auto;
}

.stat-dropdown .dropdown-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    text-align: center;
}

.stat-dropdown .dropdown-footer .btn {
    width: 100%;
}

/* Dropdown items */
.dropdown-category {
    margin-bottom: 12px;
}

.dropdown-category:last-child {
    margin-bottom: 0;
}

.dropdown-category-title {
    font-size: 0.8em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-var-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-var-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

.dropdown-var-item .var-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dropdown-var-item .var-status.ok { background: #10b981; }
.dropdown-var-item .var-status.missing { background: #f59e0b; }
.dropdown-var-item .var-status.mismatch { background: #ef4444; }
.dropdown-var-item .var-status.empty { background: #6b7280; }

.dropdown-var-item .var-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-var-item .var-value {
    font-family: var(--font-mono);
    font-size: 0.8em;
    color: var(--text-secondary);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-summary-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.8em;
}

.dropdown-summary-item.ok { border-left: 2px solid #10b981; }
.dropdown-summary-item.warning { border-left: 2px solid #f59e0b; }
.dropdown-summary-item.error { border-left: 2px solid #ef4444; }

.loading-small {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* =============================================================================
   DASHBOARD GRID
   ============================================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-main);
    font-size: 14px;
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 24px;
}

/* Info List */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    color: var(--text-muted);
    font-size: 14px;
}

.info-value {
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 13px;
}

/* =============================================================================
   CONTAINER LIST
   ============================================================================= */

.container-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.container-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.container-item:hover {
    border-color: var(--accent-primary);
}

.container-item.has-update {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.container-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

.container-stats .stat-label {
    color: var(--text-muted);
    font-weight: 500;
}

.update-badge {
    font-size: 12px;
    margin-left: 6px;
    animation: pulse 2s ease-in-out infinite;
}

.update-count {
    margin-left: 10px;
    padding: 2px 8px;
    background: var(--warning);
    color: #000;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.container-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.container-status.running {
    background: var(--success);
    box-shadow: 0 0 10px var(--success-glow);
}

.container-status.stopped,
.container-status.exited {
    background: var(--danger);
}

.container-name {
    font-weight: 500;
    flex: 1;
}

.container-state {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Container Detail List */
.container-detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.container-detail {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.container-detail .container-info {
    flex: 1;
}

.container-detail .container-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.container-detail .container-status-text {
    font-size: 13px;
    color: var(--text-muted);
}

.container-detail.has-update {
    border-color: var(--warning);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, rgba(245, 158, 11, 0.08) 100%);
}

.container-image {
    margin-left: 8px;
    padding: 2px 6px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 11px;
}

.update-available {
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--warning);
    color: #000;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}

.container-actions {
    display: flex;
    gap: 8px;
}

/* =============================================================================
   SYSTEM SERVICES GRID
   ============================================================================= */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.service-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.service-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.service-info {
    flex: 1;
    min-width: 0;
}

.service-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.service-desc {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-version {
    font-size: 10px;
    color: var(--accent-secondary);
    font-family: var(--font-mono);
}

.service-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-status.running {
    background: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

.service-status.stopped {
    background: var(--danger);
    animation: pulse 2s ease-in-out infinite;
}

.service-status.installed {
    background: var(--warning);
}

.service-status.not_found {
    background: var(--text-muted);
    opacity: 0.5;
}

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success);
    color: #000;
}

.badge-warning {
    background: var(--warning);
    color: #000;
}

.badge-danger {
    background: var(--danger);
    color: #fff;
}

.badge-info {
    background: var(--accent-secondary);
    color: #000;
}

/* =============================================================================
   SCRIPTS GRID
   ============================================================================= */

.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.script-card {
    padding: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.script-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.script-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.script-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.script-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.terminal-hint {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.hint-icon {
    font-size: 24px;
}

.hint-text code {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent-secondary);
}

/* =============================================================================
   LOG VIEWER
   ============================================================================= */

.log-viewer {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
    overflow-x: auto;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* =============================================================================
   ENHANCED LOGS PAGE
   ============================================================================= */

/* Log Source Tabs */
.logs-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.log-tab {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.log-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.log-tab.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Log Controls */
.logs-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.logs-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logs-controls-left select {
    min-width: 140px;
}

.logs-controls-left input[type="text"] {
    min-width: 200px;
}

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

/* Log Header Stats */
.log-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Log Body */
.log-body {
    padding: 0 !important;
}

.log-body .log-viewer {
    margin: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: calc(100vh - 450px);
}

/* Log Cards Section */
.log-cards-section {
    margin-top: 16px;
}

.log-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.log-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.log-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.log-card-icon {
    font-size: 20px;
}

.log-card-info {
    flex: 1;
}

.log-card-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.log-card-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.log-card-status.running {
    color: var(--success);
}

.log-card-status.stopped {
    color: var(--text-tertiary);
}

/* Custom Log Panel */
.custom-log-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.custom-log-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.custom-log-section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.custom-log-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-primary);
}

/* Container Checkboxes */
.container-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.container-checkboxes .checkbox-label {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.container-checkboxes .checkbox-label:hover {
    background: var(--bg-hover);
}

/* Timezone Display */
.timezone-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.current-time-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.current-time-display strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
}

.timezone-info {
    font-size: 11px;
    color: var(--text-tertiary);
}

.server-time-note {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(var(--info-rgb), 0.1);
    border-left: 3px solid var(--info);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Time Range Inputs */
.time-range-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.time-range-inputs .form-group {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.time-range-inputs label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.time-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Search Filters */
.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}

.search-filters .form-group {
    margin: 0;
}

.search-filters label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* Exclude Filters */
.exclude-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.exclude-filters .checkbox-label {
    font-size: 13px;
}

/* Level Filters */
.level-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.level-filters .checkbox-label {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.level-filters .checkbox-label:hover {
    border-color: var(--accent-primary);
}

.level-filters .level-error {
    border-left: 3px solid var(--danger);
}

.level-filters .level-warn {
    border-left: 3px solid var(--warning);
}

.level-filters .level-info {
    border-left: 3px solid var(--info);
}

.level-filters .level-debug {
    border-left: 3px solid var(--text-tertiary);
}

/* Custom Log Actions */
.custom-log-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.custom-log-actions select {
    min-width: 160px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .time-range-inputs {
        flex-direction: column;
    }
    
    .time-range-inputs .form-group {
        min-width: 100%;
    }
    
    .time-presets {
        width: 100%;
        justify-content: center;
    }
    
    .search-filters {
        grid-template-columns: 1fr;
    }
    
    .level-filters {
        justify-content: center;
    }
    
    .custom-log-actions {
        flex-direction: column;
    }
    
    .custom-log-actions button,
    .custom-log-actions select {
        width: 100%;
    }
}

/* =============================================================================
   GIT STATUS
   ============================================================================= */

.git-status {
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.git-status pre {
    font-family: var(--font-mono);
    font-size: 14px;
    white-space: pre-wrap;
}

.update-actions {
    margin-bottom: 20px;
}

.update-output {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.update-output pre {
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: pre-wrap;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: var(--danger);
}

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

.btn-secondary {
    background: rgba(100, 116, 139, 0.2);
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: rgba(100, 116, 139, 0.4);
    color: var(--text-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-success {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
    color: var(--success);
}

.btn-success:hover {
    background: var(--success);
    color: white;
}

/* =============================================================================
   FORM ELEMENTS
   ============================================================================= */

select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 13px;
    cursor: pointer;
}

select:hover {
    border-color: var(--accent-primary);
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* =============================================================================
   MODAL
   ============================================================================= */

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

.modal.active {
    display: flex !important;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}

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

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 50vh;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast.warning {
    border-color: var(--warning);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* =============================================================================
   XILRIWS PANEL
   ============================================================================= */

.xilriws-panel {
    padding: 8px 0;
}

.xilriws-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-style: italic;
}

.xilriws-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.xilriws-stat {
    text-align: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.xilriws-stat.primary {
    grid-column: span 1;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-hover));
    border: 1px solid var(--border-color);
}

.xilriws-stat .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.xilriws-stat .stat-value.excellent { color: var(--success); }
.xilriws-stat .stat-value.good { color: #22c55e; }
.xilriws-stat .stat-value.warning { color: var(--warning); }
.xilriws-stat .stat-value.critical { color: var(--danger); }
.xilriws-stat .stat-value.success { color: var(--success); }
.xilriws-stat .stat-value.error { color: var(--danger); }

.xilriws-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.xilriws-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 12px;
}

.xilriws-errors .error-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger);
    margin-bottom: 8px;
}

.error-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.error-item {
    background: rgba(239, 68, 68, 0.15);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.error-item .count {
    font-weight: 700;
    color: var(--danger);
    margin-right: 4px;
}

@media (max-width: 768px) {
    .xilriws-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================================================
   XILRIWS PAGE STYLES
   ============================================================================= */

.xilriws-stats-grid {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1200px) {
    .xilriws-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .xilriws-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card.large .stat-value {
    font-size: 2.5rem;
}

/* Success rate coloring */
.stat-info.excellent .stat-value { color: #22c55e; }
.stat-info.good .stat-value { color: #84cc16; }
.stat-info.warning .stat-value { color: #eab308; }
.stat-info.critical .stat-value { color: #ef4444; }

/* Xilriws specific grid */
.xilriws-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1000px) {
    .xilriws-grid {
        grid-template-columns: 1fr;
    }
}

/* Error breakdown improvements */
.error-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.error-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px;
}

.error-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.error-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.error-row:last-child {
    margin-bottom: 0;
}

.error-type {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-count {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--danger);
    min-width: 40px;
    text-align: right;
}

.error-count:not(:empty):after {
    content: '';
}

/* Proxy stats table */
.proxy-stats-container {
    max-height: 350px;
    overflow-y: auto;
}

.proxy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.proxy-table th {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
}

.proxy-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.proxy-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.proxy-table .proxy-addr {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.proxy-table .success {
    color: var(--success);
    font-weight: 500;
}

.proxy-table .fail {
    color: var(--danger);
    font-weight: 500;
}

.proxy-table .rate-good { color: #22c55e; }

/* Proxy Details Modal */
.proxy-details {
    padding: 0;
}

.proxy-details-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.proxy-details-header h3 {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    word-break: break-all;
    font-family: var(--font-mono);
}

.proxy-meta {
    display: flex;
    gap: 24px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.proxy-meta div {
    display: flex;
    gap: 8px;
}

.proxy-stats-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.proxy-stats-section {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.proxy-stats-section h4 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.stats-grid-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

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

.stat-value.warning {
    color: var(--warning);
}

.stat-value.danger {
    color: var(--danger);
}

.clickable-row {
    transition: background-color var(--transition-fast);
}

.clickable-row:hover {
    background-color: var(--bg-hover) !important;
}
.proxy-table .rate-ok { color: #eab308; }
.proxy-table .rate-bad { color: #ef4444; }

/* Sortable table headers */
.proxy-table.sortable th.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.proxy-table.sortable th.sortable-header:hover {
    background: var(--bg-tertiary);
}

.proxy-table .sort-icon {
    margin-left: 4px;
    opacity: 0.4;
    font-size: 0.7rem;
}

.proxy-table .sort-icon.active {
    opacity: 1;
    color: var(--accent-primary);
}

.proxy-table .issues {
    font-size: 0.8rem;
}

.proxy-table .proxy-problematic {
    background: rgba(239, 68, 68, 0.1);
}

.proxy-table .proxy-problematic:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Current proxy badge */
#currentProxyBadge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    color: var(--text-secondary);
}

/* Recent errors list */
.recent-errors-list {
    max-height: 250px;
    overflow-y: auto;
}

.error-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.error-entry:hover {
    background: var(--bg-tertiary);
}

.error-entry.critical {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
}

.error-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.error-icon {
    flex-shrink: 0;
}

.error-message {
    flex: 1;
    color: var(--text-secondary);
    word-break: break-word;
}

.error-proxy {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Error count badge */
.error-badge {
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* =============================================================================
   CHROME TEMP FILE MANAGER
   ============================================================================= */

.chrome-temp-manager {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chrome-temp-status {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.chrome-temp-stat {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.chrome-temp-stat .stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.chrome-temp-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.chrome-temp-stat .stat-value.warning {
    color: var(--warning);
}

.chrome-temp-stat .stat-value.danger {
    color: var(--danger);
}

.chrome-temp-stat .stat-value.success {
    color: var(--success);
}

/* Age Distribution Bar */
.chrome-temp-age-dist {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.age-bar {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-primary);
    margin-bottom: 12px;
}

.age-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.age-segment.age-day {
    background: var(--success);
}

.age-segment.age-week {
    background: #22d3ee;
}

.age-segment.age-month {
    background: var(--warning);
}

.age-segment.age-older {
    background: var(--danger);
}

.age-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-item .dot.age-day { background: var(--success); }
.legend-item .dot.age-week { background: #22d3ee; }
.legend-item .dot.age-month { background: var(--warning); }
.legend-item .dot.age-older { background: var(--danger); }

/* Settings Section */
.chrome-temp-settings {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.chrome-temp-settings h4 {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-item:first-child {
    flex-direction: row;
    align-items: center;
    grid-column: span 2;
    gap: 12px;
}

.setting-item label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.setting-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.setting-input {
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    width: 100%;
}

.setting-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.setting-help {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

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

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider {
    background: var(--success);
    border-color: var(--success);
}

.toggle-switch input:checked + .slider:before {
    background: white;
    transform: translateX(22px);
}

/* Actions */
.chrome-temp-actions {
    display: flex;
    gap: 12px;
}

.chrome-temp-actions .btn {
    flex: 1;
}

/* Status Message */
.chrome-temp-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: none;
}

.chrome-temp-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.chrome-temp-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.chrome-temp-message.info {
    display: block;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .chrome-temp-status {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .setting-item:first-child {
        grid-column: span 1;
    }
    
    .chrome-temp-actions {
        flex-direction: column;
    }
}

/* Log filter dropdown */
.log-filter {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.log-filter:focus {
    outline: none;
    border-color: var(--primary);
}

/* Cookie status warning icon */
.stat-icon.warning {
    color: #eab308;
}

.stat-card .stat-icon.danger {
    color: var(--danger);
}

/* No data placeholder */
.no-data {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
}

.proxy-info .proxy-sample {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.sample-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.proxy-line {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 2px 0;
    word-break: break-all;
}

.live-log {
    background: #0d1117;
    max-height: 400px;
    overflow-y: auto;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-label input {
    cursor: pointer;
}

/* =============================================================================
   STATISTICS PAGE STYLES
   ============================================================================= */

.stats-chart-container {
    width: 100%;
    height: 220px;
    padding: 10px 0;
}

.stats-chart-container canvas {
    width: 100% !important;
}

.stats-table-container {
    max-height: 300px;
    overflow-y: auto;
}

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

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

.stats-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

.stats-table td {
    font-size: 0.9rem;
}

.stats-table td.code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.stats-table tbody tr:hover {
    background: var(--bg-hover);
}

.event-list {
    max-height: 300px;
    overflow-y: auto;
}

.event-item {
    padding: 10px 12px;
    border-left: 3px solid var(--border-color);
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.event-item.info { border-left-color: var(--accent-primary); }
.event-item.warn, .event-item.warning { border-left-color: var(--warning); }
.event-item.error, .event-item.fatal { border-left-color: var(--danger); }
.event-item.success { border-left-color: var(--success); }

.event-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.event-type {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 4px 0;
}

.event-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.container-history {
    overflow-x: auto;
}

/* =============================================================================
   FILE BROWSER STYLES
   ============================================================================= */

.file-path-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.path-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.current-path {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-secondary);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.file-item.directory {
    border-left: 3px solid var(--accent-primary);
}

.file-item.file {
    border-left: 3px solid var(--text-muted);
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.file-item.directory .file-name {
    font-weight: 500;
}

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

.file-viewer {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.file-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.file-viewer-header span {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-secondary);
}

.file-content {
    flex: 1;
    margin: 0;
    padding: 20px;
    overflow: auto;
    background: #0d1117;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* =============================================================================
   LOG CONTROLS
   ============================================================================= */

.log-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

#modalLogContent {
    max-height: 400px;
    overflow-y: auto;
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

/* =============================================================================
   STACK DATA PAGE
   ============================================================================= */

.stack-connection {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.stack-connection.connected {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.connection-success, .connection-error {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.connection-success {
    color: var(--success);
}

.connection-error {
    color: var(--danger);
    flex-direction: column;
    align-items: flex-start;
}

.connection-error small {
    color: var(--text-muted);
    font-size: 0.85em;
}

.stack-stats-grid {
    margin-bottom: 24px;
}

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

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.stat-name {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.stat-val {
    font-weight: 600;
    font-family: var(--font-mono);
}

.stat-val.success { color: var(--success); }
.stat-val.warning { color: var(--warning); }
.stat-val.danger { color: var(--danger); }

.instances-list, .provider-breakdown, .gym-teams, .mode-breakdown {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.instances-list h4, .provider-breakdown h4, .gym-teams h4, .mode-breakdown h4 {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.instance-row, .provider-row, .team-row, .mode-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    font-size: 0.9em;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.instance-name, .provider-row span:first-child, .mode-row span:first-child {
    color: var(--text-primary);
}

.instance-type {
    color: var(--accent-secondary);
    font-size: 0.85em;
}

.team-row.mystic { border-left: 3px solid #3b82f6; }
.team-row.valor { border-left: 3px solid #ef4444; }
.team-row.instinct { border-left: 3px solid #f59e0b; }
.team-row.neutral { border-left: 3px solid var(--text-muted); }

.card.full-width {
    grid-column: 1 / -1;
}

.device-count {
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.device-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.device-card:hover {
    border-color: var(--accent-primary);
}

.device-card.online {
    border-left: 3px solid var(--success);
}

.device-card.offline {
    border-left: 3px solid var(--danger);
    opacity: 0.7;
}

.device-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.device-status {
    font-size: 10px;
}

.device-status.online { color: var(--success); }
.device-status.offline { color: var(--danger); }

.device-uuid {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--text-primary);
    word-break: break-all;
}

.device-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.device-info .device-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    background: none;
    padding: 0;
}

.device-info .device-row span:first-child {
    color: var(--text-muted);
}

.device-info .device-row span:last-child {
    color: var(--text-secondary);
}

.no-data, .error-msg {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
}

.error-msg {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

/* =============================================================================
   DEVICES PAGE
   ============================================================================= */

.device-stats-grid {
    margin-bottom: 24px;
}

.devices-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.devices-list-card {
    min-height: 400px;
}

.crashes-card {
    min-height: 400px;
    max-height: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crashes-card .card-body {
    overflow-y: auto;
}

.search-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 0.9em;
    width: 180px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

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

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

.devices-table th {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.devices-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.devices-table tr:hover {
    background: var(--bg-hover);
}

.devices-table tr.online .status-indicator {
    color: var(--success);
}

.devices-table tr.offline {
    opacity: 0.7;
}

.devices-table tr.offline .status-indicator {
    color: var(--danger);
}

.device-name {
    cursor: pointer;
    font-weight: 500;
}

.device-name:hover {
    color: var(--accent-primary);
}

.device-origin {
    display: block;
    color: var(--text-muted);
    font-size: 0.8em;
}

.crash-count.danger {
    color: var(--danger);
    font-weight: 600;
}

.uptime.success { color: var(--success); }
.uptime.warning { color: var(--warning); }
.uptime.danger { color: var(--danger); }

/* Crash List */
.crash-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crash-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    border-left: 3px solid var(--danger);
    transition: var(--transition-fast);
}

.crash-item:hover {
    background: var(--bg-hover);
    border-left-color: var(--accent-primary);
}

.crash-item.resolved {
    opacity: 0.6;
    border-left-color: var(--success);
}

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

.crash-type {
    font-size: 0.85em;
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    color: var(--danger);
}

.crash-type.disconnect { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.crash-type.timeout { background: rgba(59, 130, 246, 0.2); color: var(--accent-secondary); }

.crash-time {
    font-size: 0.8em;
    color: var(--text-muted);
}

.crash-device {
    font-weight: 500;
    margin-bottom: 4px;
}

.crash-message {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crash-source {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    font-size: 0.8em;
}

.log-source {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-secondary);
}

.log-line {
    color: var(--text-muted);
}

.startup-badge {
    background: var(--warning);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Log Context Modal - Active state additional styles */
.modal.active {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1em;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: var(--text-muted);
}

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

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

/* Password Popout Panel Styles */
.wizard-popout-panel {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 8px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.popout-header h3 {
    margin: 0;
    font-size: 1em;
    color: var(--text-primary);
}

.popout-status {
    padding: 10px 16px;
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-color);
}

.popout-status.warning {
    background: rgba(251, 191, 36, 0.1);
    color: var(--warning);
}

.popout-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.popout-status.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-secondary);
}

.popout-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.popout-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.popout-actions {
    display: flex;
    gap: 8px;
}

.show-passwords-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: var(--text-secondary);
    cursor: pointer;
}

.password-fields-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =============================================================================
   MARIADB SETUP PANEL STYLES
   ============================================================================= */

.mariadb-status-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 15px;
}

.status-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.status-row:last-child {
    margin-bottom: 0;
}

.status-label {
    font-weight: 500;
    min-width: 100px;
    color: var(--text-secondary);
}

.status-value {
    flex: 1;
}

.status-value.status-ok {
    color: var(--success);
}

.status-value.status-warn {
    color: var(--warning);
}

.db-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.db-status-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-primary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

.databases-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.checkbox-item:hover {
    background: var(--bg-hover);
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.checkbox-item input[type="checkbox"]:disabled {
    opacity: 0.6;
}

.exists-badge {
    font-size: 0.7em;
    background: var(--success);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

.optimization-section {
    border-left: 3px solid var(--primary);
}

/* =============================================================================
   CONFIG VARIABLES STATUS PANEL
   ============================================================================= */

.config-vars-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.config-vars-summary .summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

.config-vars-summary .summary-item.success { border-left: 3px solid var(--success); }
.config-vars-summary .summary-item.warning { border-left: 3px solid var(--warning); }
.config-vars-summary .summary-item.error { border-left: 3px solid var(--danger); }
.config-vars-summary .summary-item.synced { border-left: 3px solid #3b82f6; }

.config-vars-summary .summary-icon { font-size: 1.1em; }
.config-vars-summary .summary-label { color: var(--text-secondary); font-size: 0.85em; }

.config-vars-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.config-vars-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-vars-legend .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.config-vars-legend .status-dot.synced { background: #10b981; }
.config-vars-legend .status-dot.mismatch { background: #ef4444; }
.config-vars-legend .status-dot.empty { background: #6b7280; }

.config-vars-categories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.config-var-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.config-var-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.config-var-category-header:hover {
    background: var(--bg-hover);
}

.config-var-category-header h4 {
    margin: 0;
    font-size: 0.95em;
    color: var(--text-primary);
}

.config-var-category-header .category-stats {
    display: flex;
    gap: 10px;
    font-size: 0.8em;
}

.config-var-category-header .stat {
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}

.config-var-category-header .stat.ok { color: var(--success); }
.config-var-category-header .stat.warn { color: var(--warning); }
.config-var-category-header .stat.error { color: var(--danger); }

.config-var-category-body {
    padding: 12px;
}

.config-var-item {
    display: grid;
    grid-template-columns: 20px 180px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.config-var-item:last-child {
    margin-bottom: 0;
}

.config-var-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.config-var-status.synced { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.config-var-status.mismatch { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); animation: pulse-error 1.5s infinite; }
.config-var-status.empty { background: #6b7280; }
.config-var-status.ok { background: #10b981; }
.config-var-status.set { background: #3b82f6; }
.config-var-status.missing { background: #f59e0b; }

@keyframes pulse-error {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.config-var-label {
    font-weight: 500;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-var-label .shared-badge {
    font-size: 0.75em;
    padding: 2px 5px;
    background: #3b82f620;
    color: #3b82f6;
    border-radius: 3px;
}

.config-var-value {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.config-var-value.secret { color: var(--text-tertiary); }
.config-var-value.empty { font-style: italic; color: var(--warning); }

.config-var-source {
    font-size: 0.75em;
    padding: 3px 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.config-var-sync-details {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

.config-var-sync-details .sync-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.config-var-sync-details .sync-row:last-child {
    border-bottom: none;
}

.config-var-sync-details .sync-file {
    color: var(--text-secondary);
}

.config-var-sync-details .sync-value {
    font-family: var(--font-mono);
}

.config-var-sync-details .sync-value.match { color: var(--success); }
.config-var-sync-details .sync-value.mismatch { color: var(--danger); font-weight: bold; }

/* =============================================================================
   COMPREHENSIVE SECRETS PANEL - for managing all passwords/tokens
   ============================================================================= */

.secrets-legend {
    background: var(--bg-tertiary);
    padding: 10px 15px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border-left: 3px solid var(--primary);
}

.secrets-legend small {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.secrets-category {
    margin-bottom: 20px;
}

.secrets-category h4 {
    margin: 0 0 12px 0;
    padding: 8px 12px;
    background: linear-gradient(90deg, var(--bg-tertiary), transparent);
    border-radius: var(--radius-md);
    font-size: 0.95em;
    color: var(--text-primary);
}

.secrets-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-field-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.password-field-item:hover {
    border-color: var(--primary);
}

.password-field-item .field-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.password-field-item .field-label {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-primary);
}

.password-field-item .field-desc {
    font-size: 0.75em;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.password-field-item .target-count {
    font-size: 0.7em;
    color: var(--primary);
    margin-top: 2px;
}

.password-field-item .field-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.password-field-item select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    color: var(--text-primary);
    font-size: 0.85em;
    min-width: 90px;
}

.password-field-item input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    width: 220px;
}

.password-field-item input:focus {
    outline: none;
    border-color: var(--primary);
}

.password-field-item input:disabled {
    opacity: 0.5;
}

.password-field-item input.has-value {
    border-color: var(--success);
}

.password-field-item input.is-weak {
    border-color: var(--warning);
}

.password-field-item .field-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.password-field-item .btn-xs {
    padding: 4px 8px;
    font-size: 0.8em;
}

.password-field-item .status-icon {
    font-size: 1em;
    width: 20px;
    text-align: center;
}

.password-field-item .current-value-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    min-width: 150px;
    max-width: 220px;
}

.password-field-item .current-value-display:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.password-field-item .masked-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.password-field-item .show-btn {
    padding: 2px 6px !important;
    font-size: 10px !important;
    opacity: 0.7;
    flex-shrink: 0;
}

.password-field-item .show-btn:hover {
    opacity: 1;
}

.password-field-item .target-count {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive layout for smaller screens */
@media (max-width: 768px) {
    .password-field-item {
        grid-template-columns: 1fr;
    }
    
    .password-field-item .field-controls {
        flex-wrap: wrap;
    }
    
    .password-field-item input {
        width: 100%;
    }
}

.log-context-info {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.log-context-info span {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.log-context-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

#logContextRange {
    color: var(--text-muted);
    font-size: 0.9em;
}

#logContextContent {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.crash-highlight {
    background: rgba(239, 68, 68, 0.3);
    display: inline-block;
    width: 100%;
    margin: 0 -16px;
    padding: 2px 16px;
}

/* Device Detail Modal */
.device-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.device-detail-header h2 {
    margin: 0;
    font-family: var(--font-mono);
}

.device-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.detail-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.9em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9em;
}

.detail-row span:first-child {
    color: var(--text-muted);
}

.recent-crashes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crash-mini {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85em;
}

.crash-mini:hover {
    background: var(--bg-hover);
}

.crash-mini .crash-type {
    font-size: 0.8em;
}

.crash-mini .crash-message {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crash-mini .crash-time {
    white-space: nowrap;
}

/* Text colors */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }

/* =============================================================================
   LIVE ACTIVITY MONITOR
   ============================================================================= */

.activity-card {
    margin-top: 20px;
}

.activity-card.full-width {
    grid-column: 1 / -1;
}

.monitor-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 20px;
}

.activity-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    min-height: 300px;
}

/* Container Health Panel */
.container-health {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.health-header {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.health-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--success);
}

.health-item.unhealthy {
    border-left-color: var(--danger);
    opacity: 0.8;
}

.health-name {
    flex: 1;
    font-size: 0.9em;
}

.health-status {
    font-size: 0.8em;
}

.health-mem {
    font-size: 0.8em;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.health-mem.high {
    color: var(--warning);
}

.health-restarts {
    font-size: 0.75em;
    color: var(--warning);
    font-family: var(--font-mono);
}

/* Activity Stream */
.activity-stream {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-y: auto;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stream-hint {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

.activity-event {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
    animation: slideIn 0.3s ease;
}

.activity-event.new {
    animation: highlightNew 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes highlightNew {
    0% { background: var(--accent-glow); }
    100% { background: var(--bg-secondary); }
}

.activity-event.success {
    border-left-color: var(--success);
}

.activity-event.warning {
    border-left-color: var(--warning);
}

.activity-event.error {
    border-left-color: var(--danger);
}

.activity-event.critical {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.activity-event.info {
    border-left-color: var(--accent-secondary);
}

.event-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.event-icon {
    font-size: 1em;
}

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

.event-container {
    font-size: 0.8em;
    padding: 2px 6px;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--accent-secondary);
}

.event-time {
    margin-left: auto;
    font-size: 0.8em;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.event-device {
    margin-top: 4px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.event-message {
    margin-top: 6px;
    font-size: 0.8em;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 8px;
    background: var(--bg-primary);
    border-radius: 4px;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 1200px) {
    .devices-layout {
        grid-template-columns: 1fr;
    }
    
    .device-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .activity-layout {
        grid-template-columns: 1fr;
    }
    
    .container-health {
        order: 2;
    }
}

@media (max-width: 1200px) {
    .devices-layout {
        grid-template-columns: 1fr;
    }
    
    .device-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .device-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    
    .logo-text, .nav-item span:not(.nav-icon), .nav-label, .sidebar-footer span {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header {
        padding: 0 16px;
    }
    
    .page {
        padding: 16px;
    }
}

/* =============================================================================
   CONTROL BAR (Container/Service Controls)
   ============================================================================= */

.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.control-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-bar-right {
    display: flex;
    gap: 8px;
}

.control-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.container-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    font-size: 13px;
    font-weight: 500;
}

.container-status-badge.running {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.container-status-badge.stopped {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.container-status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.container-status-badge .status-dot.running {
    background: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

.container-status-badge .status-dot.stopped {
    background: var(--danger);
}

/* =============================================================================
   PROXY MANAGER
   ============================================================================= */

.proxy-manager {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.proxy-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.proxy-info code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.proxy-editor {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
}

.proxy-editor:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.proxy-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =============================================================================
   NGINX & SITES MANAGER
   ============================================================================= */

/* =============================================================================
   NGINX SETUP WIZARD
   ============================================================================= */

.nginx-setup-wizard {
    margin-bottom: 24px;
}

.setup-wizard-status {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.wizard-step:hover {
    border-color: var(--accent-primary);
}

.wizard-step .step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 60px;
}

.wizard-step .step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-secondary);
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.wizard-step .step-status {
    font-size: 16px;
}

.wizard-step .step-status.checking {
    animation: pulse 1.5s ease-in-out infinite;
}

.wizard-step .step-status.success {
    color: var(--success);
}

.wizard-step .step-status.warning {
    color: var(--warning);
}

.wizard-step .step-status.error {
    color: var(--danger);
}

.wizard-step .step-content {
    flex: 1;
}

.wizard-step .step-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.wizard-step .step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.wizard-step .step-action {
    min-width: 100px;
    text-align: right;
}

.wizard-step .step-action button:disabled {
    background: var(--success);
    color: white;
    opacity: 0.7;
    cursor: default;
}

.setup-wizard-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.setup-wizard-output {
    margin-top: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.setup-wizard-output .output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.setup-wizard-output pre {
    margin: 0;
    padding: 12px;
    max-height: 300px;
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

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

.sites-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.site-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.site-item.enabled {
    border-left: 3px solid var(--success);
}

.site-item.disabled {
    opacity: 0.7;
}

.site-item.backend-only {
    border-left: 3px solid var(--warning) !important;
    background: rgba(255, 193, 7, 0.05);
}

.site-icon {
    font-size: 1.2rem;
}

.site-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-name {
    font-family: var(--font-mono);
    font-size: 13px;
}

.site-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.site-desc.text-warning {
    color: var(--warning);
}

.site-warning {
    margin-left: 4px;
    cursor: help;
}

.site-actions {
    display: flex;
    gap: 6px;
}

.config-editor {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
}

.config-editor:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.nginx-setup-form {
    display: grid;
    gap: 16px;
}

.setup-step {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.setup-step h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.services-list {
    margin-top: 16px;
    width: 100%;
}

/* Nginx Quick Setup Services Step - overrides generic setup-step flex */
.nginx-services-step {
    display: block !important;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.nginx-services-step h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.nginx-services-step p {
    margin: 0 0 12px 0;
}

.services-config-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
}

.service-config-item {
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.service-config-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.service-config-item.disabled {
    opacity: 0.5;
}

.service-config-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.service-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

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

.service-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.service-desc {
    color: var(--text-muted);
    font-size: 12px;
    width: 100%;
    margin-top: 4px;
}

.service-port-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.service-port-group label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.service-port-input {
    width: 80px;
    padding: 4px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    text-align: center;
}

.service-port-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.service-config-details {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.service-config-details:empty {
    display: none;
}

.service-domain-select,
.service-structure-select {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 8px;
}

.service-domain-select:focus,
.service-structure-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.service-structure-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.service-structure-row > div {
    flex: 1;
}

.service-structure-row label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-inline label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input-sm {
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
}

.form-input-sm:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

/* Domain tags for multiple domains */
.domain-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--accent-color);
    color: white;
    border-radius: 20px;
    font-size: 13px;
}

.domain-tag .remove-domain {
    cursor: pointer;
    opacity: 0.7;
    font-size: 14px;
    line-height: 1;
}

.domain-tag .remove-domain:hover {
    opacity: 1;
}

.add-domain-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.add-domain-group input {
    flex: 1;
}

.service-preview {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.service-preview code {
    color: var(--accent-color);
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-input {
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

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

.setup-output {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.setup-output pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

/* =============================================================================
   SITE AVAILABILITY CHECK - 3-LEVEL COMPREHENSIVE
   ============================================================================= */

.site-availability-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-check-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    border-left: 3px solid var(--border-color);
    transition: all var(--transition-fast);
}

.site-check-item:hover {
    background: var(--bg-hover);
}

/* Status-based border colors */
.site-check-item.site-status-healthy {
    border-left-color: var(--success);
}

.site-check-item.site-status-running {
    border-left-color: #22c55e;
}

.site-check-item.site-status-partial {
    border-left-color: var(--warning);
}

.site-check-item.site-status-backend-down {
    border-left-color: var(--danger);
}

.site-check-item.site-status-unreachable {
    border-left-color: #f97316;
}

.site-check-item.site-status-offline {
    border-left-color: #6b7280;
}

.site-check-item.site-status-error {
    border-left-color: var(--danger);
}

.site-check-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-check-icon {
    font-size: 1rem;
    min-width: 24px;
    text-align: center;
}

.site-check-name {
    font-weight: 600;
    color: var(--text-primary);
}

.site-domain {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-primary);
    text-decoration: none;
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 3px;
    margin-left: auto;
}

.site-domain:hover {
    color: var(--accent-secondary);
    background: rgba(59, 130, 246, 0.2);
}

.site-port {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

/* 3-Level Check Indicators */
.site-check-levels {
    display: flex;
    gap: 12px;
    padding-left: 34px;
}

.check-indicator {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: help;
}

.check-indicator.check-ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.check-indicator.check-fail {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.check-indicator.check-na {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-muted);
}

.site-check-error {
    font-size: 11px;
    color: var(--danger);
    padding-left: 34px;
    font-style: italic;
}

/* Legend */
.site-check-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 10px;
    color: var(--text-muted);
}

.site-check-legend span {
    cursor: help;
}

/* Button variants */
.btn-success {
    background: var(--success);
    color: #000;
}

.btn-success:hover {
    background: #0ea472;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-warning:hover {
    background: #e09009;
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

/* =============================================================================
   AI DEBUG PANEL
   ============================================================================= */

.debug-panel-card {
    border: 2px solid var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(99, 102, 241, 0.1) 100%);
}

.debug-panel-card .card-header {
    border-bottom: 1px solid var(--accent-primary);
}

.debug-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.debug-status {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-family: var(--font-mono);
}

.debug-log-container {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.debug-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
}

.debug-autoscroll {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
}

.debug-autoscroll input {
    cursor: pointer;
}

.debug-log-output {
    height: 300px;
    overflow-y: auto;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
}

.debug-log-line {
    padding: 2px 6px;
    border-radius: 3px;
    white-space: pre-wrap;
    word-break: break-all;
}

.debug-log-line.error,
.debug-log-line.fatal {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.debug-log-line.warn {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.debug-log-line.info {
    color: var(--success);
}

.debug-log-line.debug {
    color: var(--accent-primary);
}

.debug-log-line.trace {
    color: var(--text-muted);
}

/* =============================================================================
   AI DEBUG MASTER TOGGLE
   ============================================================================= */

.ai-debug-master-card {
    border: 2px solid var(--border-color);
    transition: all var(--transition-normal);
}

.ai-debug-master-card.enabled {
    border-color: var(--warning);
    box-shadow: 0 0 20px var(--warning-glow);
}

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

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

.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(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: all var(--transition-normal);
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: all var(--transition-normal);
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--warning);
    border-color: var(--warning);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: var(--bg-primary);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 4px var(--accent-primary);
}

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

.toggle-label.enabled {
    color: var(--warning);
}

/* Warning Banner */
.warning-banner {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.warning-banner.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid var(--danger);
}

.warning-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.warning-content {
    flex: 1;
}

.warning-content strong {
    color: var(--danger);
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

.warning-content p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 8px 0;
    line-height: 1.5;
}

.warning-content ul {
    margin: 8px 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.warning-content ul li {
    margin: 4px 0;
}

.warning-content .warning-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 12px;
}

/* AI Debug Status Panel */
.ai-debug-status {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.status-row:last-child {
    border-bottom: none;
}

.status-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--bg-primary);
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.off {
    background: var(--text-muted);
}

.status-dot.on {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-badge.secured .status-text {
    color: var(--success);
}

.status-badge.enabled .status-text {
    color: var(--warning);
}

/* AI Debug Options Grid */
.ai-debug-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.toggle-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--warning);
}

.option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.option-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.option-desc {
    color: var(--text-muted);
    font-size: 11px;
}

/* AI Instructions Box */
.ai-instructions-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.ai-instructions-box p {
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.ai-instructions-box code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.ai-instructions-box .btn {
    margin-top: 12px;
}

/* =============================================================================
   SYSTEM RESOURCES PANEL (Combined Disk + Memory)
   ============================================================================= */

.alert-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    animation: pulse-alert 2s infinite;
}

.alert-banner.alert-critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0.1) 100%);
    border: 2px solid var(--danger);
}

.alert-banner.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid var(--warning);
}

@keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.alert-icon {
    font-size: 24px;
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.alert-message {
    font-weight: 600;
    font-size: 14px;
}

@keyframes pulse-card {
    0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
}

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

/* System Resources Card */
.system-resources-card {
    border: 1px solid var(--border-color);
}

.system-resources-card .card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.system-resources-card .badge {
    font-size: 11px;
    padding: 3px 8px;
}

/* Resource Tabs */
.resource-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-primary);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.resource-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

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

.resource-tab.active {
    background: var(--accent-primary);
    color: white;
}

/* Resource Content */
.resource-content {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Resource Bars */
.resource-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.resource-bar-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resource-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.resource-bar-label span:last-child {
    font-weight: 600;
    font-family: var(--font-mono);
}

.resource-bar-container {
    height: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.resource-bar-container.swap {
    height: 10px;
}

.resource-bar {
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease, background 0.3s ease;
}

.resource-bar.disk {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.resource-bar.disk.warning {
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.resource-bar.disk.critical {
    background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

.resource-bar.memory {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
}

.resource-bar.memory.warning {
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.resource-bar.memory.critical {
    background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

.resource-bar.swap {
    background: linear-gradient(90deg, #06b6d4 0%, #22d3ee 100%);
}

.resource-bar-stats {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.resource-free {
    color: var(--text-muted);
}

/* Resource Warning */
.resource-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--warning);
}

/* Resource Actions */
.resource-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.resource-actions .btn {
    font-size: 11px;
    padding: 5px 10px;
}

/* Resource Cache Info */
.resource-cache-info {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.resource-cache-info strong {
    color: var(--accent-primary);
}

/* Resource Scan Results */
.resource-scan-results {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

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

.disk-scan-title {
    font-weight: 600;
    font-size: 13px;
}

.disk-scan-total {
    font-size: 11px;
    color: var(--warning);
    font-weight: 500;
}

/* Bloat/File Items */
.bloat-item, .large-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 12px;
}

.bloat-item:hover, .large-file-item:hover {
    background: var(--bg-hover);
}

.bloat-info, .file-info {
    flex: 1;
    min-width: 0;
}

.bloat-name, .file-path {
    font-weight: 500;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bloat-description, .file-modified {
    font-size: 10px;
    color: var(--text-muted);
}

.bloat-size, .file-size {
    font-weight: 600;
    font-size: 12px;
    color: var(--warning);
    margin: 0 8px;
    white-space: nowrap;
}

.bloat-severity {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
}

.bloat-severity.high { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.bloat-severity.medium { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.bloat-severity.low { background: rgba(59, 130, 246, 0.2); color: var(--accent-primary); }

.btn-cleanup, .btn-delete {
    border: none;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-cleanup { background: var(--warning); color: #000; }
.btn-cleanup:hover { background: #fbbf24; }
.btn-delete { background: var(--danger); color: #fff; }
.btn-delete:hover { background: #f87171; }

.cleanup-result {
    font-size: 11px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.cleanup-result.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.cleanup-result.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.no-bloat-found {
    text-align: center;
    padding: 16px;
    color: var(--success);
    font-size: 13px;
}

.no-bloat-found .icon {
    font-size: 28px;
    margin-bottom: 6px;
}

/* Process List Compact */
.process-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.process-sort-label {
    font-size: 11px;
    color: var(--text-muted);
}

.process-sort-btn {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.process-sort-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.process-sort-btn:hover:not(.active) {
    background: var(--bg-hover);
}

.process-list-compact {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    max-height: 280px;
    overflow-y: auto;
}

.process-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.process-item:last-child { border-bottom: none; }
.process-item:hover { background: var(--bg-hover); }

.process-info {
    flex: 1;
    min-width: 0;
}

.process-name {
    font-weight: 500;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-details {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
}

.process-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-right: 10px;
}

.process-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.process-stat-value {
    font-weight: 600;
    font-size: 12px;
}

.process-stat-value.memory { color: #8b5cf6; }
.process-stat-value.cpu { color: var(--warning); }

.process-stat-label {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-process-kill {
    background: var(--danger);
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
}

.btn-process-kill:hover { background: #f87171; }

.process-protected {
    font-size: 9px;
    color: var(--text-muted);
    font-style: italic;
}

.memory-cleanup-result {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    font-size: 12px;
}

.memory-cleanup-result.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.memory-cleanup-result.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

/* =============================================================================
   SECURITY SERVICES STYLES
   ============================================================================= */

.section-divider {
    margin: 40px 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-divider h2 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.section-divider p {
    margin: 0;
    font-size: 0.9rem;
}

.security-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 900px) {
    .security-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

@media (max-width: 1200px) {
    .security-grid {
        grid-template-columns: 1fr;
    }
}

/* UFW Styles */
.ufw-output {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    max-height: 300px;
    overflow: auto;
}

.ufw-output pre {
    margin: 0;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

.rules-list .rule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.rule-item .rule-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.rule-item .rule-action {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    text-transform: uppercase;
}

.rule-action.allow {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.rule-action.deny {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.add-rule-form h4,
.unban-form h4,
.add-user-form h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-input-sm {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 80px;
    flex: 1;
}

/* Fail2Ban Styles */
.jail-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
}

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

.jail-name {
    font-weight: 600;
    color: var(--text-primary);
}

.banned-count {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 10px;
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

.banned-count.has-banned {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.banned-ips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.banned-ip {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.banned-ip:hover {
    background: var(--danger);
    color: white;
}

.banned-ip .unban-hint {
    font-size: 9px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.banned-ip:hover .unban-hint {
    opacity: 0.8;
}

/* Authelia Styles */
.authelia-status {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 15px;
}

.authelia-status .status-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.authelia-status .status-row:last-child {
    border-bottom: none;
}

.authelia-status .status-row span:first-child {
    color: var(--text-muted);
}

.authelia-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Basic Auth Styles */
.htpasswd-path {
    font-family: var(--font-mono);
    font-size: 11px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.btn-xs {
    padding: 2px 6px;
    font-size: 10px;
}

/* SSL Certificate Styles */
.certs-list {
    display: grid;
    gap: 12px;
}

.cert-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 15px;
    border-left: 3px solid var(--success);
}

.cert-item.expiring-soon {
    border-left-color: var(--warning);
}

.cert-item.expiring-critical {
    border-left-color: var(--danger);
}

.cert-item.expired {
    border-left-color: #6b7280;
    opacity: 0.7;
}

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

.cert-name {
    font-weight: 600;
    color: var(--text-primary);
}

.cert-domains {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.domain-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--bg-primary);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--accent-secondary);
}

.cert-expiry {
    font-size: 12px;
    color: var(--text-muted);
}

.cert-expiry.expiring-soon {
    color: var(--warning);
}

.cert-expiry.expiring-critical {
    color: var(--danger);
    font-weight: 500;
}

.cert-expiry.expired {
    color: #6b7280;
    text-decoration: line-through;
}

/* Status badges for security */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-success,
.status-badge.status-running {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-badge.status-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status-badge.status-inactive {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

/* Info and error messages */
.info-msg {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 12px 15px;
    border-radius: var(--radius-sm);
}

/* =============================================================================
   SETUP & CONFIG PAGE STYLES
   ============================================================================= */

.setup-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .setup-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Setup Tabs */
.setup-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: var(--bg-tertiary);
    padding: 5px;
    border-radius: var(--radius-md);
}

.setup-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.setup-tab.active {
    background: var(--accent-primary);
    color: white;
}

.setup-tab-content {
    display: none;
}

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

/* GitHub Grid */
.github-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1000px) {
    .github-grid {
        grid-template-columns: 1fr;
    }
}

/* Git Status */
.git-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 15px;
}

.git-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.git-row:last-child {
    border-bottom: none;
}

.git-label {
    color: var(--text-muted);
    min-width: 80px;
}

.git-value {
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
}

.git-commit {
    font-family: var(--font-mono);
    color: var(--accent-secondary);
}

.git-remote {
    font-size: 11px;
    color: var(--text-muted);
}

.git-update-notice, .git-changes-notice {
    margin-top: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.git-update-notice {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-secondary);
}

.git-changes-notice {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Git Actions */
.git-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.git-actions .btn-lg {
    padding: 15px 20px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.git-actions .btn-hint {
    font-size: 11px;
    opacity: 0.7;
    font-weight: normal;
}

/* Commits List */
.commits-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.commit-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    border-left: 3px solid var(--border-color);
}

.commit-item.current {
    border-left-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.commit-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.commit-hash {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-secondary);
}

.commit-date {
    font-size: 11px;
    color: var(--text-muted);
}

.commit-message {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.commit-author {
    font-size: 11px;
    color: var(--text-muted);
}

/* Changes List */
.changes-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.change-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.change-status {
    font-family: var(--font-mono);
    font-weight: 600;
    min-width: 25px;
}

.change-item.change-modified .change-status { color: var(--warning); }
.change-item.change-added .change-status { color: var(--success); }
.change-item.change-deleted .change-status { color: var(--danger); }
.change-item.change-untracked .change-status { color: var(--text-muted); }

.change-path {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Config Files List */
.config-files-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-category {
    margin-bottom: 10px;
}

.category-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.config-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--success);
}

.config-item.missing {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.config-item.critical {
    border-left-width: 4px;
}

.config-status {
    font-size: 18px;
    min-width: 30px;
    text-align: center;
}

.config-info {
    flex: 1;
    min-width: 0;
}

.config-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.config-path {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-secondary);
    margin: 2px 0;
}

.config-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.config-actions {
    display: flex;
    gap: 8px;
}

/* Config Editor */
.config-editor {
    width: 100%;
    min-height: 400px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 15px;
    resize: vertical;
}

.config-editor:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Environment Variables */
.env-vars-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.env-category {
    margin-bottom: 10px;
}

.env-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.env-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.env-item.missing {
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid var(--danger);
}

.env-item.secret .env-name::after {
    content: '🔒';
    margin-left: 6px;
    font-size: 11px;
}

.env-info {
    flex: 1;
    min-width: 0;
}

.env-name {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
    color: var(--accent-secondary);
}

.env-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.env-value {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 250px;
}

.env-input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 8px 10px;
}

.env-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Setup Scripts */
.setup-scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.setup-script-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.setup-script-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.setup-script-card .script-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.setup-script-card .script-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.setup-script-card .script-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Interactive Terminal for Scripts */
.script-terminal-card {
    margin-top: 20px;
    background: #1a1d23;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.script-terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-bottom: 1px solid #3b82f6;
    font-weight: 500;
    color: #e4e4e7;
}

.terminal-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.terminal-status.connecting {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.terminal-status.connected {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.terminal-status.disconnected {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.terminal-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.terminal-hint {
    padding: 8px 15px;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 12px;
    color: #93c5fd;
}

.terminal-container {
    height: 450px;
    padding: 10px;
    background: #1a1d23;
}

.terminal-container .xterm {
    height: 100%;
}

.terminal-container .xterm-viewport {
    overflow-y: auto !important;
}

/* Legacy Script Output (kept for backwards compatibility) */
.script-output-card {
    margin-top: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.script-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
}

.script-output {
    padding: 15px;
    background: var(--bg-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* =============================================================================
   DOCKER HEALTH MONITOR STYLES
   ============================================================================= */

.docker-health-card {
    margin-bottom: 20px;
    border: 1px solid var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.docker-health-card .card-header {
    border-bottom-color: var(--accent-primary);
}

.docker-health-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .docker-health-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .docker-health-grid {
        grid-template-columns: 1fr;
    }
}

.health-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.health-status-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.health-icon {
    font-size: 28px;
    min-width: 40px;
    text-align: center;
}

.health-info {
    flex: 1;
}

.health-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.health-status-text {
    font-size: 12px;
    color: var(--text-muted);
}

.health-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.health-indicator.checking {
    background: var(--text-muted);
    animation: pulse 1.5s ease-in-out infinite;
}

.health-indicator.healthy {
    background: var(--success);
    box-shadow: 0 0 10px var(--success-glow);
}

.health-indicator.warning {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning-glow);
}

.health-indicator.error {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger-glow);
    animation: pulse 1s ease-in-out infinite;
}

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

/* Port Health Section */
.port-health-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

.port-health-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.port-health-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.port-health-hint .hint-icon {
    font-size: 14px;
}

.port-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.port-health-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--border-color);
    transition: all var(--transition-fast);
}

.port-health-item.accessible {
    border-left-color: var(--success);
}

.port-health-item.inaccessible {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.port-health-item.checking {
    border-left-color: var(--text-muted);
}

.port-health-item.not-running {
    border-left-color: var(--warning);
    opacity: 0.7;
}

.port-health-item.internal {
    border-left-color: var(--accent-secondary, #8b5cf6);
    background: rgba(139, 92, 246, 0.05);
}

.port-icon {
    font-size: 20px;
    min-width: 30px;
    text-align: center;
}

.port-info {
    flex: 1;
}

.port-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.port-details {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.port-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.port-status.accessible {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.port-status.inaccessible {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.port-status.internal {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-secondary, #8b5cf6);
}

.port-status.not-running {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.port-status.checking {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

/* Docker Info Section */
.docker-info-section {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.docker-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.docker-info-row .info-label {
    color: var(--text-muted);
    font-size: 12px;
}

.docker-info-row .info-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-secondary);
    text-align: right;
    word-break: break-all;
}

/* Bulk Actions Panel */
.bulk-actions-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.bulk-action-item .btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Container Metrics in Detail */
.container-metrics {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 4px;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    display: inline-block;
}

/* Port mapping display */
.container-ports {
    font-size: 10px;
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.container-ports .port-mapping {
    display: inline-block;
    padding: 1px 6px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 3px;
    margin-right: 4px;
}

/* Update/Rebuild progress indicator */
.docker-operation-progress {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    padding: 12px 24px;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.docker-operation-progress.active {
    display: flex;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.docker-operation-progress .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.docker-operation-progress .progress-text {
    flex: 1;
    font-weight: 500;
}

.docker-operation-progress .cancel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
}

.docker-operation-progress .cancel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Response time display in port health */
.port-response-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.port-response-time.fast {
    color: var(--success);
}

.port-response-time.slow {
    color: var(--warning);
}

/* =============================================================================
   DOCKER INSTALLATION SECTION
   ============================================================================= */

.docker-install-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

.docker-install-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

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

.docker-install-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.docker-install-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.docker-install-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.docker-install-item:hover {
    border-color: var(--accent-primary);
}

.docker-install-item.installed {
    border-left: 4px solid var(--success);
}

.docker-install-item.not-installed {
    border-left: 4px solid var(--warning);
}

.install-icon {
    font-size: 28px;
    min-width: 40px;
    text-align: center;
}

.install-info {
    flex: 1;
}

.install-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.install-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.install-status {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 4px;
}

.install-status.installed {
    color: var(--success);
}

.install-status.not-installed {
    color: var(--warning);
}

.install-status.conflict {
    color: var(--danger);
    font-weight: 600;
}

.install-status.checking {
    color: var(--accent-primary);
}

.install-status.ok {
    color: var(--success);
}

.install-status.warning {
    color: var(--warning);
}

.install-status.error {
    color: var(--danger);
}

.docker-install-item.has-conflict {
    border-left: 4px solid var(--danger);
    background: rgba(220, 53, 69, 0.05);
}

/* =============================================================================
   DOCKER CONFIGURATION SECTION
   ============================================================================= */

.docker-config-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

.docker-config-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.docker-config-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.docker-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.docker-config-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.docker-config-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    transform: translateX(4px);
}

.docker-config-item.exists {
    border-left: 4px solid var(--success);
}

.docker-config-item.missing {
    border-left: 4px solid var(--text-muted);
    opacity: 0.7;
}

.config-icon {
    font-size: 24px;
    min-width: 36px;
    text-align: center;
}

.config-info {
    flex: 1;
    min-width: 0;
}

.config-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.config-path {
    font-size: 10px;
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.config-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.config-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.config-status.exists {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.config-status.missing {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

.config-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Config Editor Panel */
.config-editor-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 16px;
    animation: slideDown 0.2s ease-out;
}

.config-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.config-panel-title h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-primary);
}

.config-path-label {
    font-size: 0.8em;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.config-panel-actions {
    display: flex;
    gap: 8px;
}

.config-form-editor {
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.config-fields-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.config-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.config-section-header:hover {
    background: var(--bg-secondary);
}

.config-section-header h4 {
    margin: 0;
    font-size: 0.95em;
    color: var(--text-primary);
}

.config-section-toggle {
    font-size: 0.9em;
    transition: transform 0.2s;
}

.config-section.collapsed .config-section-toggle {
    transform: rotate(-90deg);
}

.config-section.collapsed .config-section-fields {
    display: none;
}

.config-section-fields {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-field {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: start;
}

.config-field-info {
    padding-top: 6px;
}

.config-field-label {
    font-weight: 500;
    font-size: 0.9em;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.config-field-desc {
    font-size: 0.75em;
    color: var(--text-muted);
    line-height: 1.3;
}

.config-field-input {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-field-input input,
.config-field-input select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.9em;
}

.config-field-input input:focus,
.config-field-input select:focus {
    outline: none;
    border-color: var(--primary);
}

.config-field-input input[type="password"] {
    font-family: 'JetBrains Mono', monospace;
}

.config-field-input .field-hint {
    font-size: 0.75em;
    color: var(--text-muted);
}

.config-field-input .input-with-action {
    display: flex;
    gap: 6px;
}

.config-field-input .input-with-action input {
    flex: 1;
}

.config-raw-editor {
    padding: 16px;
}

.config-raw-editor .config-editor {
    width: 100%;
    min-height: 400px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    resize: vertical;
}

.config-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.config-footer-info {
    font-size: 0.85em;
    color: var(--text-muted);
}

.config-footer-actions {
    display: flex;
    gap: 8px;
}

.no-schema-notice {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* =============================================================================
   SHARED FIELD INDICATORS - For fields that appear in multiple configs
   ============================================================================= */

.shared-fields-legend {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.shared-fields-legend .legend-title {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.shared-fields-legend .legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.shared-fields-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.shared-fields-legend .legend-label {
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-primary);
}

.shared-fields-legend .legend-count {
    font-size: 0.75em;
    color: var(--text-muted);
}

.shared-fields-legend .legend-hint {
    font-size: 0.8em;
    color: var(--text-muted);
    font-style: italic;
}

.shared-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 4px currentColor;
}

/* Shared field badge on individual fields */
.shared-field-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 0.7em;
    background: rgba(255,255,255,0.05);
    white-space: nowrap;
}

.shared-field-badge .shared-label {
    font-weight: 500;
}

.shared-field-badge .shared-count {
    opacity: 0.7;
    font-size: 0.9em;
}

/* Config field with shared indicator */
.config-field.has-shared {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    margin-left: -12px;
}

.config-field-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Optional field styling */
.config-field.is-optional {
    opacity: 0.9;
}

.config-field.using-default {
    opacity: 0.7;
}

.config-field.using-default input {
    font-style: italic;
    color: var(--text-muted);
}

.optional-badge {
    font-size: 0.65em;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.using-default-badge {
    font-size: 0.65em;
    background: #6366f122;
    color: #818cf8;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-left: 6px;
}

/* =============================================================================
   WEBHOOKS MANAGEMENT
   ============================================================================= */

.webhooks-section {
    margin-top: 20px;
}

.webhooks-info {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.webhooks-info p {
    margin: 4px 0;
}

.webhooks-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.webhooks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webhooks-empty {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

.webhooks-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.webhooks-empty .empty-text {
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.webhooks-empty .empty-hint {
    font-size: 0.85em;
    color: var(--text-muted);
}

.webhook-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: border-color 0.2s ease;
}

.webhook-card:hover {
    border-color: var(--primary);
}

.webhook-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.webhook-service {
    font-weight: 600;
    font-size: 1.05em;
    color: var(--text-primary);
}

.webhook-actions {
    display: flex;
    gap: 6px;
}

.webhook-url {
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow-x: auto;
}

.webhook-url code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--accent-primary);
}

.webhook-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.webhook-type-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7em;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.webhook-areas {
    font-size: 0.8em;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* Webhook Modal */
.webhook-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.webhook-type-checkbox {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.webhook-type-checkbox:hover {
    border-color: var(--primary);
}

.webhook-type-checkbox input {
    position: absolute;
    opacity: 0;
}

.webhook-type-checkbox input:checked + .type-label {
    color: var(--primary);
}

.webhook-type-checkbox input:checked ~ .type-label::before {
    content: '✓ ';
    color: var(--success);
}

.webhook-type-checkbox:has(input:checked) {
    background: var(--primary-transparent);
    border-color: var(--primary);
}

.type-label {
    font-weight: 500;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.type-desc {
    font-size: 0.75em;
    color: var(--text-muted);
}

.webhook-presets {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.webhook-presets label {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Section description */
.config-section-header .section-desc {
    font-size: 0.75em;
    color: var(--text-muted);
    font-weight: normal;
    margin-left: 8px;
}

/* Sync button styling */
.btn-sync {
    font-size: 0.75em !important;
    padding: 4px 8px !important;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-sync:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Input with action - ensure proper layout */
.input-with-action {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.input-with-action input {
    flex: 1;
    min-width: 0;
}

.no-schema-notice p {
    margin-bottom: 10px;
}

/* Docker Config Editor */
.docker-config-editor {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--accent-primary);
}

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

.config-editor-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.config-editor-actions {
    display: flex;
    gap: 8px;
}

.config-editor-path {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-secondary);
    margin-bottom: 12px;
    padding: 6px 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.docker-config-editor .config-editor {
    width: 100%;
    min-height: 300px;
    margin-bottom: 12px;
}

.config-editor-hint {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Installation Progress Modal */
.install-progress {
    padding: 20px;
}

.install-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.install-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.install-step.pending {
    opacity: 0.6;
}

.install-step.running {
    border-left: 3px solid var(--accent-primary);
    animation: pulse 1.5s ease-in-out infinite;
}

.install-step.success {
    border-left: 3px solid var(--success);
}

.install-step.error {
    border-left: 3px solid var(--danger);
}

.step-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.step-info {
    flex: 1;
}

.step-name {
    font-weight: 500;
    font-size: 13px;
}

.step-status {
    font-size: 11px;
    color: var(--text-muted);
}

.install-output {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

/* =============================================================================
   STACK SETUP WIZARD
============================================================================= */

.wizard-start-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.wizard-start-prompt .start-prompt-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.wizard-start-prompt h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.wizard-start-prompt p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 500px;
}

.wizard-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    text-align: left;
}

.wizard-features li {
    padding: 8px 0;
    font-size: 15px;
    color: var(--text-secondary);
}

.wizard-start-prompt .btn-lg {
    padding: 14px 40px;
    font-size: 18px;
}

.wizard-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.wizard-title h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: var(--text-primary);
}

.wizard-title p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.wizard-progress-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    margin: 20px 0 12px 0;
    overflow: hidden;
}

.wizard-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.wizard-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Wizard Steps Grid */
.wizard-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.wizard-step-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.wizard-step-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wizard-step-card.complete {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(46, 204, 113, 0.05) 100%);
}

.wizard-step-card.pending {
    opacity: 0.9;
}

.wizard-step-card.partial {
    border-color: var(--warning, #f39c12);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(243, 156, 18, 0.1) 100%);
    animation: pulse-partial 2s ease-in-out infinite;
}

@keyframes pulse-partial {
    0%, 100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(243, 156, 18, 0); }
}

.wizard-step-final {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(52, 152, 219, 0.1) 100%);
    border-color: var(--accent-primary);
}

.step-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 12px;
}

.step-number {
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.step-status {
    font-size: 18px;
}

.wizard-step-card .step-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.wizard-step-card .step-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.wizard-step-card .step-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.wizard-step-card .step-details {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    min-height: 28px;
}

.wizard-step-card .step-action {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
}

/* Wizard Output Panel */
.wizard-output-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    overflow: hidden;
}

.wizard-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
}

.wizard-output-content {
    background: #1a1a2e;
    color: #00ff88;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 16px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.wizard-output-success {
    color: #00ff88;
}

.wizard-output-error {
    color: #ff6b6b;
}

.wizard-output-warning {
    color: #ffd93d;
}

.wizard-output-info {
    color: #6bceff;
}

/* ============================================= */
/* Authentication Setup Styles */
/* ============================================= */

.auth-choice-section {
    padding: 0 0 20px 0;
}

.auth-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.auth-option-card {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all 0.2s ease;
}

.auth-option-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-option-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.auth-option-header .auth-icon {
    font-size: 32px;
}

.auth-option-header h4 {
    flex: 1;
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.auth-option-header .auth-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.auth-option-header .auth-status.configured {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.auth-option-header .auth-status.running {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
}

.auth-option-header .auth-status.stopped {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

.auth-option-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.auth-option-desc p {
    margin: 0 0 12px 0;
}

.pros-cons {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.pros-cons li {
    font-size: 13px;
    padding: 4px 0;
}

.pros-cons li.pro {
    color: var(--success);
}

.pros-cons li.con {
    color: var(--warning);
}

.auth-option-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.auth-setup-panel {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
}

.auth-setup-panel .panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.auth-setup-panel .panel-header h4 {
    margin: 0;
    flex: 1;
}

.current-users-section,
.add-user-section,
.nginx-config-section,
.authelia-status-section,
.authelia-install-section,
.authelia-config-section {
    margin-bottom: 24px;
}

.current-users-section h5,
.add-user-section h5,
.nginx-config-section h5,
.authelia-status-section h5,
.authelia-install-section h5,
.authelia-config-section h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 13px;
}

.user-tag .delete-user {
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.user-tag .delete-user:hover {
    opacity: 0.7;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.code-block {
    background: #1a1a2e;
    color: #00ff88;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    overflow-x: auto;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

.setup-steps {
    padding-left: 20px;
    margin: 12px 0;
    color: var(--text-secondary);
}

.setup-steps li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.setup-steps code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.authelia-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.status-display {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.status-display .status-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.status-display .status-label {
    color: var(--text-secondary);
}

.status-display .status-value {
    font-weight: 600;
}

.status-display .status-value.running {
    color: var(--success);
}

.status-display .status-value.stopped {
    color: var(--danger);
}

.wizard-output-code {
    color: #c8a2fa;
    background: rgba(200, 162, 250, 0.1);
    padding: 0 4px;
    border-radius: 3px;
}

/* Quick Actions */
.wizard-quick-actions {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.wizard-quick-actions h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.quick-actions-grid .btn {
    padding: 12px 16px;
    font-size: 13px;
    justify-content: center;
}

/* =============================================================================
   FLETCHLING MANAGEMENT TAB
   ============================================================================= */

.fletchling-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.fletchling-status-grid .status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.fletchling-status-grid .status-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.fletchling-status-grid .status-light.checking {
    background: #666;
    animation: pulse 1.5s ease-in-out infinite;
}

.fletchling-status-grid .status-light.success {
    background: var(--success);
    box-shadow: 0 0 10px var(--success-glow);
}

.fletchling-status-grid .status-light.warning {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning-glow);
}

.fletchling-status-grid .status-light.error {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger-glow);
}

.fletchling-status-grid .status-info {
    flex: 1;
}

.fletchling-status-grid .status-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.fletchling-status-grid .status-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.fletchling-setup-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.fletchling-setup-section h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.setup-step {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.setup-step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.setup-step .step-content {
    flex: 1;
}

.setup-step .step-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.setup-step .step-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.setup-step .step-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.setup-step .step-input-group input {
    flex: 1;
    max-width: 300px;
}

.setup-step .step-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.setup-step .step-hint .hint-icon {
    font-size: 14px;
}

.setup-step .button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.setup-step.completed .step-number {
    background: var(--success);
}

.setup-step.completed .step-number::after {
    content: '✓';
}

.fletchling-stats {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.fletchling-stats h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.fletchling-stats .stats-grid {
    display: flex;
    gap: 20px;
}

.fletchling-stats .stat-box {
    background: var(--bg-secondary);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    text-align: center;
    min-width: 120px;
}

.fletchling-stats .stat-box .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-primary);
}

.fletchling-stats .stat-box .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.fletchling-docs {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.fletchling-docs h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.fletchling-docs .docs-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.fletchling-docs .doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.fletchling-docs .doc-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* =============================================================================
   FLETCHLING NEST MANAGEMENT
   ============================================================================= */

.fletchling-management {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.fletchling-management h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

/* Nest Statistics Grid */
.nest-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.nest-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.nest-stat-card .stat-icon {
    font-size: 24px;
}

.nest-stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.nest-stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Nest Controls */
.nest-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.nest-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nest-filters select {
    min-width: 180px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

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

.nest-actions {
    display: flex;
    gap: 8px;
}

/* Nest Table */
.nest-table-container {
    overflow-x: auto;
    margin-bottom: 16px;
}

.nest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

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

.nest-table tr:hover {
    background: var(--bg-hover);
}

.nest-table tr.active {
    background: rgba(46, 204, 113, 0.05);
}

.nest-table tr.inactive {
    opacity: 0.7;
}

.nest-table .unknown-nest {
    color: var(--warning);
    font-style: italic;
}

.nest-table .loading-row,
.nest-table .error-row,
.nest-table .empty-row {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 12px;
}

.nest-table .error-row {
    color: var(--danger);
}

/* Pokemon Badge */
.pokemon-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.pokemon-badge img {
    width: 24px;
    height: 24px;
}

.no-pokemon {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 12px;
}

/* Pagination */
.nest-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px;
}

.nest-pagination .page-info {
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Monitored Areas Section */
.fletchling-areas {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.fletchling-areas h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.areas-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.area-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.area-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.area-actions {
    display: flex;
    gap: 4px;
}

.area-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px;
}

.area-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.area-stat .stat-icon {
    font-size: 14px;
}

/* Edit Nest Modal Pokemon Preview */
.pokemon-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pokemon-input-group input {
    flex: 1;
}

.pokemon-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    min-width: 120px;
}

.pokemon-preview img {
    width: 32px;
    height: 32px;
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 8px 0;
}

/* Loading Placeholder */
.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Extra small buttons */
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

/* OSM Import Progress Indicator */
.osm-progress {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.osm-progress .progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.osm-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.osm-progress .progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* =============================================================================
   PORACLE MANAGEMENT PAGE
   ============================================================================= */

/* Reuse fletchling styles for poracle - same grid layout */
.poracle-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.poracle-status-grid .status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.poracle-status-grid .status-light {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.poracle-status-grid .status-light.checking {
    background: #666;
    animation: pulse 1.5s ease-in-out infinite;
}

.poracle-status-grid .status-light.success {
    background: var(--success);
    box-shadow: 0 0 10px var(--success-glow);
}

.poracle-status-grid .status-light.warning {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning-glow);
}

.poracle-status-grid .status-light.error {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger-glow);
}

.poracle-status-grid .status-light.neutral {
    background: #666;
}

.poracle-status-grid .status-info {
    flex: 1;
}

.poracle-status-grid .status-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.poracle-status-grid .status-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.poracle-setup-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.poracle-setup-section h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.poracle-stats {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.poracle-stats h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.poracle-logs-preview {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.poracle-logs-preview h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.poracle-logs-preview .log-preview {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
}

.poracle-docs {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.poracle-docs h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.poracle-docs .docs-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.poracle-docs .doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.poracle-docs .doc-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

/* =============================================================================
   ENHANCED FILE MANAGER
   ============================================================================= */

.file-manager-card {
    display: flex;
    flex-direction: column;
}

.file-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.toolbar-left {
    display: flex;
    gap: 8px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.toolbar-separator {
    color: var(--border-color);
    margin: 0 4px;
}

.current-user {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
}

.file-path-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--accent-primary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
}

.breadcrumb-item:hover {
    background: var(--bg-hover);
}

.breadcrumb-separator {
    color: var(--text-muted);
    margin: 0 2px;
}

.file-list.enhanced {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

.file-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.file-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

.file-item.selected {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
}

.file-item .file-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.file-item .file-name {
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .file-size {
    color: var(--text-secondary);
    font-size: 12px;
    min-width: 70px;
    text-align: right;
}

.file-item .file-modified {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 140px;
}

.file-item .file-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-item .file-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

.file-item.directory .file-name {
    color: var(--accent-secondary);
}

/* File Editor */
.file-editor-textarea {
    width: 100%;
    min-height: 500px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    tab-size: 4;
}

.file-editor-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.editor-info {
    color: var(--text-secondary);
    font-size: 12px;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

/* File Info Panel */
.file-info-panel {
    position: fixed;
    right: 20px;
    top: 100px;
    width: 320px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 100;
}

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

.file-info-panel .panel-header h4 {
    margin: 0;
    font-size: 14px;
}

.file-info-panel .panel-body {
    padding: 16px;
    font-size: 13px;
}

.file-info-panel .panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.file-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.file-info-row:last-child {
    border-bottom: none;
}

.file-info-label {
    color: var(--text-secondary);
}

.file-info-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Chmod Modal */
.chmod-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.chmod-section {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.chmod-section label:first-child {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.chmod-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chmod-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.chmod-preview {
    text-align: center;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.chmod-preview code {
    font-size: 18px;
    color: var(--accent-primary);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 12px;
}

/* Modal sizes */
.modal-large .modal-content {
    max-width: 900px;
    width: 90%;
}

.modal-small .modal-content {
    max-width: 400px;
}

/* =============================================================================
   DEBUG PAGE STYLES
   ============================================================================= */

.debug-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.debug-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

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

.debug-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
}

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

.debug-value.warning {
    color: var(--warning);
}

.debug-value.error {
    color: var(--danger);
}

.debug-log-viewer {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 16px;
    max-height: 400px;
    overflow: auto;
}

.debug-log-viewer pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-primary);
}

.debug-log-info {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.debug-log-info span {
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.debug-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tip-item {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.tip-item strong {
    color: var(--accent-primary);
}

.tip-item code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Live Stream Options */
.stream-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stream-option {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.stream-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stream-icon {
    font-size: 24px;
}

.stream-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stream-info strong {
    color: var(--text-primary);
    font-size: 14px;
}

.stream-desc {
    color: var(--text-secondary);
    font-size: 12px;
}

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

.stream-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 13px;
}

.stream-status-bar .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stream-status-bar .status-dot.stopped {
    background: var(--text-muted);
}

.stream-status-bar .status-dot.running {
    background: var(--success);
    animation: pulse 1.5s infinite;
}

.stream-status-bar .status-dot.error {
    background: var(--danger);
}

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

.stream-status-bar .status-text {
    flex: 1;
    color: var(--text-primary);
}

.stream-status-bar .status-stats {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.terminal-commands {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cmd-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.cmd-row .cmd-label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 80px;
}

.cmd-row code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-primary);
    overflow-x: auto;
    white-space: nowrap;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* AI Debug Access Styles */
.ai-debug-toggles {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.toggle-section h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.toggle-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.toggle-item:hover {
    border-color: var(--primary);
}

.toggle-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-info strong {
    font-size: 14px;
    color: var(--text-primary);
}

.toggle-info small {
    font-size: 12px;
    color: var(--text-secondary);
}

.ai-instructions h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.instruction-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 16px;
    max-height: 400px;
    overflow: auto;
}

.instruction-box pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
}

.ai-test-section h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.test-commands {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-cmd {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.test-cmd code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-primary);
    overflow-x: auto;
    white-space: nowrap;
}

/* MCP Server Section */
.mcp-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.mcp-status-bar .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mcp-status-bar .status-dot.checking {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.mcp-status-bar .status-dot.running {
    background: var(--success);
}

.mcp-status-bar .status-dot.stopped {
    background: var(--danger);
}

.mcp-status-bar .status-dot.warning {
    background: var(--warning);
}

.mcp-setup-steps {
    margin-top: 16px;
}

.mcp-setup-steps h4 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.setup-step {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.code-block {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.code-block code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    overflow-x: auto;
    white-space: nowrap;
}

.code-block.mcp-config {
    flex-direction: column;
    align-items: stretch;
}

.code-block.mcp-config pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-primary);
    white-space: pre;
    overflow-x: auto;
}

.code-block.mcp-config button {
    align-self: flex-end;
    margin-top: 8px;
}

.mcp-tools-section h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.mcp-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.mcp-tool {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.mcp-tool strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.mcp-tool small {
    font-size: 11px;
    color: var(--text-secondary);
}

.mcp-test-section h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.mcp-test-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* =============================================================================
   SHELLDER CONFIGURATION PAGE
   ============================================================================= */

.shellder-components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.component-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.component-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.component-card.disabled {
    opacity: 0.6;
}

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

.component-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.component-card-title .icon {
    font-size: 24px;
}

.component-card-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.component-card-badges {
    display: flex;
    gap: 6px;
}

.component-badge {
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.component-badge.enabled {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.component-badge.disabled {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.component-badge.local {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.component-badge.remote {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.component-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
}

.component-detail {
    display: flex;
    flex-direction: column;
}

.component-detail-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.component-detail-value {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.component-detail.full-width {
    grid-column: span 2;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-lg {
    max-width: 800px;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
}

/* Form Styles for Config Editor */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-mono);
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

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

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-section {
    margin: 20px 0;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.form-section h3 {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

/* Code Editor */
.code-editor {
    width: 100%;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    tab-size: 4;
}

.code-editor:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Stats Grid 4 columns */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
}

/* =============================================================================
   METRICS PAGE - VictoriaMetrics & Grafana Integration
   ============================================================================= */

/* Metrics Widgets Row */
.metrics-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .metrics-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .metrics-widgets {
        grid-template-columns: 1fr;
    }
}

.metric-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.2s ease;
}

.metric-widget:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.metric-icon {
    font-size: 32px;
    line-height: 1;
    opacity: 0.9;
}

.metric-content {
    flex: 1;
    min-width: 0;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.metric-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

.metric-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.metric-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.metric-bar-fill.success {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.metric-bar-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.metric-bar-fill.danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.metric-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.status-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.status-indicator-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-indicator-dot.offline {
    background: #ef4444;
}

/* Metrics Status Bar */
.metrics-status-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.metrics-status-bar .status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.metrics-status-bar .status-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metrics-status-bar select {
    padding: 6px 12px;
    font-size: 13px;
}

/* Grafana Full-Page Container */
.grafana-fullpage-container {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    min-height: calc(100vh - 200px);
    height: calc(100vh - 200px);
}

.grafana-fullpage-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    border-radius: 0;
    height: 100vh;
    min-height: 100vh;
}

#grafanaFrame {
    width: 100%;
    height: 100%;
    border: none;
}

.grafana-loading, .grafana-offline, .grafana-setup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 40px;
    max-width: 600px;
    width: 90%;
}

.grafana-loading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.grafana-loading p {
    color: var(--text-secondary);
    margin: 8px 0;
}

.grafana-loading .loading-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Grafana Setup Screen */
.grafana-setup .setup-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.grafana-setup h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 24px;
}

.grafana-setup > p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    text-align: left;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
}

.setup-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.setup-step .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.setup-step .step-text {
    flex: 1;
    color: var(--text-primary);
}

.setup-step .step-status {
    font-size: 18px;
}

.setup-step.complete .step-number {
    background: var(--color-success);
}

.setup-step.error .step-number {
    background: var(--color-error);
}

.setup-form {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    text-align: left;
}

.setup-form h4 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.setup-form .form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.setup-form .form-group {
    margin-bottom: 12px;
}

.setup-form .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.setup-form .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

.setup-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.setup-actions .btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.setup-log {
    margin-top: 20px;
    text-align: left;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
}

.setup-log h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.setup-log .log-output {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 13px;
    max-height: 200px;
    overflow-y: auto;
    color: var(--text-secondary);
}

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

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

.setup-log .log-info {
    color: var(--accent-primary);
}

.grafana-offline .offline-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.grafana-offline h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.grafana-offline p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.offline-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.offline-help {
    text-align: left;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    max-width: 400px;
    margin: 0 auto;
}

.offline-help ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.offline-help li {
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.offline-help code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Custom Query Section */
.query-help {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.query-help h4 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.query-examples {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.example-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.example-group strong {
    color: var(--text-secondary);
    font-size: 13px;
    min-width: 80px;
}

.example-group code {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.example-group code:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.help-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.query-input-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.query-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
}

.query-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.query-results {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    min-height: 100px;
    max-height: 300px;
    overflow: auto;
}

.query-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.query-result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.query-result-metric {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-primary);
}

.query-result-value {
    font-weight: 600;
    color: var(--text-primary);
}

.query-error {
    color: #ef4444;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

/* Spin animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

