/* ============================================================
 * Kantor Virtual Heri WS - Stylesheet
 * Modern Minimalis - Putih/Biru, banyak kaca
 * ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4A90E2;
    --primary-dark: #2C5F8D;
    --primary-light: #6DD5FA;
    --accent: #E74C3C;
    --accent-soft: #FF6B5B;
    --bg: #EAF2F8;
    --bg-light: #F8FAFB;
    --white: #FFFFFF;
    --text: #2C3E50;
    --text-soft: #5A6C7D;
    --text-muted: #95A5A6;
    --border: #E1E8ED;
    --shadow: 0 4px 20px rgba(44, 95, 141, 0.08);
    --shadow-lg: 0 10px 40px rgba(44, 95, 141, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --success: #2ECC71;
    --warning: #F39C12;
    --danger: #E74C3C;
    --purple: #9B59B6;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

/* ============================================================
 * LAYOUT - 3D Office (kiri) + Sidebar (kanan)
 * ============================================================ */
.app-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    height: 100vh;
    gap: 0;
}

@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 60vh 40vh;
    }
}

/* ============================================================
 * OFFICE CANVAS (kiri)
 * ============================================================ */
.office-container {
    position: relative;
    background: linear-gradient(180deg, #EAF2F8 0%, #CDE5F0 100%);
    overflow: hidden;
}

#office-canvas {
    width: 100%;
    height: 100%;
}

#office-canvas canvas {
    display: block;
    cursor: grab;
}

#office-canvas canvas:active {
    cursor: grabbing;
}

/* Floating controls di atas canvas */
.office-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.office-controls button {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.office-controls button:hover {
    background: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.office-controls button.active {
    background: var(--primary);
    color: white;
}

/* Header bar di atas office */
.office-header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.office-header .logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.office-header h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.office-header .subtitle {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 2px;
}

/* Loading indicator */
.office-loading {
    position: absolute;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
    transition: opacity 0.5s;
}

.office-loading.hide {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hint di bawah office */
.office-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

/* ============================================================
 * SIDEBAR (kanan) - dashboard & controls
 * ============================================================ */
.sidebar {
    background: var(--white);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.sidebar-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-header .sub {
    font-size: 12px;
    opacity: 0.85;
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 16px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.stat-card {
    background: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .stat-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 11px;
    color: var(--text-soft);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.working .stat-val { color: var(--warning); }
.stat-card.idle .stat-val { color: var(--success); }
.stat-card.redone .stat-val { color: var(--danger); }

/* Tabs */
.tab-bar {
    display: flex;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
}

.tab-btn {
    background: transparent;
    padding: 14px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

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

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tab-content::-webkit-scrollbar {
    width: 6px;
}
.tab-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Agent list cards */
.agent-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.agent-card:hover {
    background: white;
    box-shadow: var(--shadow);
    transform: translateX(-2px);
}

.agent-card.selected {
    border-color: var(--primary);
    background: white;
    box-shadow: var(--shadow);
}

.agent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.agent-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-role {
    font-size: 12px;
    color: var(--text-soft);
}

.agent-meta {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    font-size: 11px;
}

.agent-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.status-idle { color: var(--success); }
.status-working { color: var(--warning); font-weight: 600; }
.status-resting { color: var(--purple); }

.agent-rating {
    color: #F1C40F;
    font-weight: 600;
}

.agent-stats {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Task list */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.ti-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-sm);
}

.ti-body { flex: 1; min-width: 0; }

.ti-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.ti-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-soft);
    align-items: center;
}

.ti-agent {
    font-weight: 600;
}

.ti-score {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.ti-revision {
    color: var(--warning);
    font-weight: 600;
}

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

.task-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.status-pending { background: #E8E8E8; color: #666; }
.status-assigned { background: #D5E8F4; color: #4A90E2; }
.status-working { background: #FFE8C2; color: #B07700; }
.status-review { background: #D5F5E3; color: #1E8449; }
.status-done { background: #D4EFDF; color: #1E8449; }
.status-redone { background: #FADBD8; color: #CB4335; }

/* Activity log */
.log-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 12px;
}

.log-time {
    color: var(--text-muted);
    font-size: 11px;
    min-width: 60px;
}

.log-action {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    min-width: 70px;
    text-align: center;
}

.action-completed { background: #D4EFDF; color: #1E8449; }
.action-failed { background: #FADBD8; color: #CB4335; }
.action-started { background: #D5E8F4; color: #4A90E2; }
.action-assigned { background: #FCF3CF; color: #B7950B; }
.action-redone, .action-redo_requested, .action-auto_redo { background: #FAD7A0; color: #B7570B; }
.action-approved { background: #D4EFDF; color: #1E8449; }
.action-chat { background: #E8DAEF; color: #6C3483; }

.log-desc {
    flex: 1;
    color: var(--text);
}

/* ============================================================
 * AGENT DETAIL PANEL (di sidebar)
 * ============================================================ */
.panel-welcome {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-soft);
}

.panel-welcome .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.panel-welcome h3 {
    color: var(--text);
    margin-bottom: 8px;
    font-size: 16px;
}

.panel-welcome p {
    font-size: 13px;
    line-height: 1.6;
}

#panel-agent { display: none; }

.agent-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.agent-detail-header .agent-avatar-big {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 24px;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.agent-detail-header h3 {
    font-size: 18px;
    margin-bottom: 2px;
}

.agent-detail-header .role {
    font-size: 13px;
    opacity: 0.9;
}

.agent-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.detail-row .label {
    color: var(--text-soft);
}

.detail-row .value {
    color: var(--text);
    font-weight: 600;
}

.skill-bar-wrap {
    margin-top: 4px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.skill-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.personality-box {
    background: var(--bg-light);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-soft);
    font-style: italic;
    line-height: 1.6;
    border-left: 3px solid var(--primary);
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin: 16px 0 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-ghost {
    background: var(--bg-light);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--border);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

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

.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-row .btn { flex: 1; justify-content: center; }

/* Agent active task box */
.active-task-box {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF5DC 100%);
    border-left: 4px solid var(--warning);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

.active-task-box .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--warning);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.active-task-box .title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

/* History items */
.history-item {
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.history-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.hi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.hi-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-soft);
    align-items: center;
}

/* ============================================================
 * MODAL - Task form
 * ============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(44, 62, 80, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-size: 18px;
    color: var(--text);
}

.modal-close {
    background: none;
    font-size: 24px;
    color: var(--text-muted);
    padding: 4px 10px;
}

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

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: white;
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: 'Consolas', monospace;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

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

.checkbox-row label {
    margin: 0;
    font-weight: 500;
    color: var(--text);
}

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

/* ============================================================
 * REVIEW PANEL (right slide-in)
 * ============================================================ */
.review-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 900;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.review-panel.active {
    right: 0;
}

.review-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.review-header h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.review-header .sub {
    font-size: 12px;
    opacity: 0.9;
}

.review-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.review-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.review-meta {
    background: var(--bg-light);
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.review-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.review-meta-row .label {
    color: var(--text-soft);
}

.review-meta-row .value {
    color: var(--text);
    font-weight: 600;
}

.quality-score {
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.quality-score.good { background: #D4EFDF; color: #1E8449; }
.quality-score.medium { background: #FCF3CF; color: #B7950B; }
.quality-score.poor { background: #FADBD8; color: #CB4335; }

.feedback-box {
    background: #FFF5DC;
    border-left: 4px solid var(--warning);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    font-size: 13px;
    color: var(--text);
}

.feedback-box .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--warning);
    font-weight: 700;
    margin-bottom: 4px;
}

.result-box {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    max-height: 400px;
    overflow-y: auto;
}

.result-box h1, .result-box h2, .result-box h3 {
    margin: 12px 0 6px;
    color: var(--primary-dark);
}

.result-box h1 { font-size: 18px; }
.result-box h2 { font-size: 16px; }
.result-box h3 { font-size: 14px; }

.result-box ul, .result-box ol {
    margin: 8px 0 8px 20px;
}

.result-box li {
    margin-bottom: 4px;
}

.result-box p {
    margin-bottom: 8px;
}

.code-block {
    background: #1E2A3A;
    color: #E0E6ED;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.inline-code {
    background: #EEF2F5;
    color: #C0392B;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12px;
}

.md-table th, .md-table td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
}

.md-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.review-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

.review-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.review-actions .btn { flex: 1; justify-content: center; }

.redo-feedback-box {
    margin-top: 12px;
}

.redo-feedback-box label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 6px;
}

.redo-feedback-box textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.redo-feedback-box textarea:focus {
    border-color: var(--warning);
    outline: none;
}

.warning-box {
    background: #FADBD8;
    color: #CB4335;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-top: 10px;
    text-align: center;
}

/* ============================================================
 * CHAT PANEL (right slide-in)
 * ============================================================ */
.chat-panel {
    position: fixed;
    top: 0;
    right: -440px;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 900;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chat-panel.active {
    right: 0;
}

.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header .agent-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.chat-header .info {
    flex: 1;
}

.chat-header .info h4 {
    font-size: 15px;
    margin-bottom: 2px;
}

.chat-header .info .role {
    font-size: 12px;
    opacity: 0.85;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    max-width: 80%;
    animation: slideIn 0.2s ease;
}

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

.chat-msg-user {
    align-self: flex-end;
}

.chat-msg-assistant {
    align-self: flex-start;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-msg-user .chat-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg-assistant .chat-bubble {
    background: white;
    color: var(--text);
    box-shadow: var(--shadow);
    border-bottom-left-radius: 4px;
}

.chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-typing .dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.chat-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing .dot:nth-child(3) { animation-delay: 0.4s; }

.chat-typing .typing-label {
    margin-left: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

@keyframes typingDot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-6px); opacity: 1; }
}

.chat-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 40px 20px;
}

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: white;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 100px;
}

.chat-input-area textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

.chat-send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* ============================================================
 * TOAST NOTIFICATIONS
 * ============================================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 320px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-info { background: var(--primary); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}

/* Section divider */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}
