
:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --bg: #f4f7f6;
    --card-bg: #ffffff;
    --border: #ddd;
    --text-primary: #2c3e50;
    --text-secondary: #666;
    --text-muted: #999;
    --msg-user: #dcf8c6;
    --msg-system: #eee;
    --msg-result: #e3f2fd;
    --radius-sm: 5px;
    --radius-md: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --primary: #1a252f;
    --primary-light: #2c3e50;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --bg: #121212;
    --card-bg: #1e1e1e;
    --border: #333;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #777;
    --msg-user: #2c3e50;
    --msg-system: #2a2a2a;
    --msg-result: #1a237e;
    --shadow: 0 4px 12px rgba(0,0,0,0.5);
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    margin: 0; 
    display: flex; 
    background: var(--bg); 
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.app-container { display: flex; width: 100%; height: 100vh; }

/* Sidebar */
.sidebar { 
    width: 250px; 
    background: var(--primary); 
    color: white; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    transition: all 0.3s ease;
}
.sidebar .logo { 
    font-size: 22px; 
    font-weight: 800; 
    margin-bottom: 40px; 
    text-align: center; 
    letter-spacing: -0.5px;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar ul li { margin: 8px 0; }
.sidebar ul li a { 
    color: #bdc3c7; 
    text-decoration: none; 
    font-size: 15px; 
    display: block; 
    padding: 12px 15px; 
    border-radius: var(--radius-sm); 
    transition: all 0.2s ease;
}
.sidebar ul li a:hover { background: var(--primary-light); color: white; }
.sidebar ul li.active a { 
    background: var(--primary-light); 
    color: white; 
    font-weight: 600; 
    border-left: 4px solid #fff;
}

.content { 
    flex: 1; 
    padding: 30px; 
    overflow-y: auto; 
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-out;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { 
        width: 100%; 
        height: auto; 
        padding: 10px 20px; 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .sidebar .logo { margin-bottom: 0; font-size: 18px; }
    .sidebar ul { display: flex; gap: 10px; }
    .sidebar ul li { margin: 0; }
    .sidebar ul li a { padding: 8px 12px; font-size: 13px; }
    .sidebar ul li.active a { border-left: none; border-bottom: 3px solid #fff; border-radius: 0; }
    .content { padding: 15px; }
}

/* Phase 10 operator guidance and reconciliation UI */
.page-title {
    margin-top: 0;
}

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

.inline-link {
    color: #1d70b8;
    font-weight: 600;
}

.analysis-guidance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 0 0 20px 0;
}

.guidance-card,
.queue-health-panel,
.queue-reconciliation-panel,
.jobs-toolbar,
.jobs-summary {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 18px;
}

.guidance-card h2,
.queue-health-panel h2,
.queue-reconciliation-panel h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.guidance-card ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.safety-note {
    border-left: 5px solid var(--warning);
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.queue-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.queue-health-grid div {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    background: var(--bg);
}

.queue-health-grid strong,
.queue-health-grid span {
    display: block;
}

.operator-hint {
    background: #fff8e1;
    border: 1px solid #f5c542;
    border-radius: var(--radius-sm);
    color: #6b4f00;
    padding: 10px;
    margin: 10px 0;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    margin: 4px 4px 4px 0;
}

.status-ok {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.status-warn {
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffeeba;
}

.reconciliation-mismatch {
    border: 1px solid var(--warning);
    border-left: 5px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 10px;
    background: var(--card-bg);
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.jobs-table th,
.jobs-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.jobs-table th {
    background: var(--primary);
    color: #fff;
}

button {
    cursor: pointer;
}
