:root {
    --primary: #2563eb;       /* Royal Blue */
    --bg: #f8fafc;           /* Light Grey */
    --sidebar: #1e293b;      /* Dark Slate */
    --white: #ffffff;
    --border: #e2e8f0;

    /* Chip Colors */
    --chip-diag: #8b5cf6;    /* Purple */
    --chip-teach: #10b981;   /* Emerald */
    --chip-plan: #f59e0b;    /* Amber */
    --chip-sum: #3b82f6;     /* Blue */
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    margin: 0;
    display: flex;
    height: 100vh;
    color: #334155;
}

.container { display: flex; width: 100%; }

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: var(--white);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.brand { margin-bottom: 30px; }
.brand h2 { margin: 0; font-size: 1.4rem; font-weight: 600; display: inline-block;}
.badge { background: var(--primary); padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; vertical-align: middle; margin-left: 8px;}

.nav-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.nav-btn.active { background: var(--primary); color: var(--white); }

.nav-divider { border: 0; border-top: 1px solid #334155; margin: 20px 0; }
.info-box { font-size: 0.85rem; color: #64748b; line-height: 1.4; }
.info-box strong { color: #94a3b8; }

/* Main Content */
.content { flex: 1; padding: 40px; overflow-y: auto; display: flex; flex-direction: column; }

h1 { font-size: 1.8rem; margin: 0 0 5px 0; color: #0f172a; }
.subtitle { color: #64748b; margin-top: 0; font-family: monospace; }

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}
.full-width { grid-column: span 2; }

.input-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; color: #475569; }
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

/* AI Command Bar */
.ai-controls {
    margin-top: 30px;
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.chip-container { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap;}

.chip {
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chip:active { transform: scale(0.96); }
.chip.diagnosis { background-color: var(--chip-diag); }
.chip.teaching { background-color: var(--chip-teach); }
.chip.plan { background-color: var(--chip-plan); }
.chip.summary { background-color: var(--chip-sum); }

/* Output */
.output-section { margin-top: 20px; flex: 1; display: flex; flex-direction: column; }
.output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#final-output { background: #f1f5f9; font-family: 'Menlo', monospace; font-size: 0.9rem; color: #334155; flex: 1; }

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.primary-btn:hover { background: #1d4ed8; }
.status-text { font-size: 0.9rem; color: #10b981; margin-right: 10px; }
