/* =====================================================
   CERRADOPREV - SISTEMA SIMULADO CSS
   ===================================================== */

:root {
    --prev-dark: #0f172a;
    --prev-darker: #020617;
    --prev-primary: #1e3a8a;
    --prev-primary-light: #2563eb;
    --prev-accent: #d97706;
    --prev-accent-light: #f59e0b;
    --prev-success: #10b981;
    --prev-warning: #f59e0b;
    --prev-danger: #ef4444;
    --prev-info: #0ea5e9;
    
    --sidebar-width: 280px;
    --header-height: 70px;
    
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--surface-alt);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* =====================================================
   LAYOUT PRINCIPAL
   ===================================================== */

.prev-system {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR (MENU LATERAL)
   ===================================================== */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--prev-dark) 0%, var(--prev-darker) 100%);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    width: 100%;
    height: auto;
}

.sidebar-brand {
    flex: 1;
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--prev-accent);
    letter-spacing: -0.5px;
}

.sidebar-brand p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 8px 12px;
    opacity: 0.7;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-inverse);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--prev-accent) 0%, var(--prev-accent-light) 100%);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.nav-item i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nav-badge {
    margin-left: auto;
    background: var(--prev-danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    min-width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--prev-primary-light), var(--prev-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.user-info {
    flex: 1;
}

.user-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-inverse);
}

.user-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =====================================================
   HEADER (TOP BAR)
   ===================================================== */

.main-header {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
}

.mobile-toggle:hover {
    background: var(--surface-hover);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--prev-accent);
}

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

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius);
    position: relative;
    transition: var(--transition);
}

.header-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--prev-danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.header-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--surface-alt);
    border-radius: var(--radius);
    font-weight: 500;
}

.header-btn-logout {
    background: var(--prev-danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn-logout:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* =====================================================
   PAGE CONTENT
   ===================================================== */

.page-content {
    flex: 1;
    padding: 25px;
}

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

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}

/* =====================================================
   STATS CARDS (KPIs)
   ===================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

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

.stat-icon.blue { background: rgba(37, 99, 235, 0.1); color: var(--prev-primary-light); }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--prev-success); }
.stat-icon.orange { background: rgba(217, 119, 6, 0.1); color: var(--prev-accent); }
.stat-icon.red { background: rgba(239, 68, 68, 0.1); color: var(--prev-danger); }

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 50px;
}

.stat-trend.up { background: rgba(16, 185, 129, 0.1); color: var(--prev-success); }
.stat-trend.down { background: rgba(239, 68, 68, 0.1); color: var(--prev-danger); }

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =====================================================
   TABLES
   ===================================================== */

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

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

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--surface-alt);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

tr:hover td {
    background: var(--surface-hover);
}

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

.btn-table {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-table.view {
    background: rgba(37, 99, 235, 0.1);
    color: var(--prev-primary-light);
}

.btn-table.view:hover {
    background: var(--prev-primary-light);
    color: white;
}

.btn-table.edit {
    background: rgba(217, 119, 6, 0.1);
    color: var(--prev-accent);
}

.btn-table.edit:hover {
    background: var(--prev-accent);
    color: white;
}

/* =====================================================
   BADGES & STATUS
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--prev-warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--prev-danger);
}

.badge-info {
    background: rgba(14, 165, 233, 0.1);
    color: var(--prev-info);
}

.badge-pending {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-secondary);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--prev-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.btn-primary:hover {
    background: var(--prev-accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-muted);
}

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* =====================================================
   FORMS
   ===================================================== */

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--surface);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--prev-primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* =====================================================
   GRID LAYOUTS
   ===================================================== */

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

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

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

/* =====================================================
   ALERTS & NOTIFICATIONS
   ===================================================== */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.alert-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.alert-message {
    font-size: 0.85rem;
    opacity: 0.9;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #92400e;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #991b1b;
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: #075985;
}

/* =====================================================
   MODALS
   ===================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

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

/* =====================================================
   TABS
   ===================================================== */

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface-alt);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

.tab-btn.active {
    background: var(--surface);
    color: var(--prev-accent);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* =====================================================
   PROGRESS BARS
   ===================================================== */

.progress {
    height: 10px;
    background: var(--surface-alt);
    border-radius: 50px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 50px;
    transition: width 0.5s ease;
}

.progress-bar.success { background: var(--prev-success); }
.progress-bar.warning { background: var(--prev-warning); }
.progress-bar.danger { background: var(--prev-danger); }
.progress-bar.primary { background: var(--prev-primary-light); }

/* =====================================================
   FILTERS
   ===================================================== */

.filters-bar {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================
   TILES (PORTAL DO SERVIDOR)
   ===================================================== */

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tile {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--prev-accent);
}

.tile-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.tile-icon.blue { background: rgba(37, 99, 235, 0.1); color: var(--prev-primary-light); }
.tile-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--prev-success); }
.tile-icon.orange { background: rgba(217, 119, 6, 0.1); color: var(--prev-accent); }
.tile-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.tile-icon.red { background: rgba(239, 68, 68, 0.1); color: var(--prev-danger); }
.tile-icon.teal { background: rgba(20, 184, 166, 0.1); color: #14b8a6; }

.tile h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.tile p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* =====================================================
   CHARTS PLACEHOLDER
   ===================================================== */

.chart-placeholder {
    height: 300px;
    background: linear-gradient(135deg, var(--surface-alt) 0%, var(--border-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =====================================================
   CHECKLIST
   ===================================================== */

.checklist {
    list-style: none;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.checklist-checkbox.checked {
    background: var(--prev-success);
    border-color: var(--prev-success);
    color: white;
}

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

.checklist-text.done {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 50px;
}

/* =====================================================
   CHAT AI
   ===================================================== */

.chat-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.chat-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.chat-header p {
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-messages {
    height: 350px;
    overflow-y: auto;
    padding: 20px;
    background: var(--surface-alt);
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
}

.chat-message.bot .chat-message-avatar {
    background: var(--prev-primary-light);
    color: white;
}

.chat-message.user .chat-message-avatar {
    background: var(--prev-accent);
    color: white;
}

.chat-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-message.bot .chat-message-content {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.chat-message.user .chat-message-content {
    background: var(--prev-primary-light);
    color: white;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

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

.chat-send {
    padding: 12px 20px;
    background: var(--prev-primary-light);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

/* =====================================================
   SIMULATOR CONSOLE
   ===================================================== */

.simulator-console {
    background: var(--prev-darker);
    color: #93c5fd;
    padding: 20px;
    border-radius: var(--radius-lg);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
}

.simulator-console::-webkit-scrollbar {
    width: 8px;
}

.simulator-console::-webkit-scrollbar-track {
    background: var(--prev-dark);
}

.simulator-console::-webkit-scrollbar-thumb {
    background: var(--prev-primary);
    border-radius: 4px;
}

.console-line {
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeInLine 0.3s ease forwards;
}

.console-line::before {
    content: '> ';
    color: var(--prev-success);
}

.console-line.success {
    color: var(--prev-success);
}

.console-line.warning {
    color: var(--prev-warning);
}

.console-line.error {
    color: var(--prev-danger);
}

@keyframes fadeInLine {
    to { opacity: 1; }
}

/* =====================================================
   METRICS BARS (Compliance)
   ===================================================== */

.metric-bar {
    margin-bottom: 20px;
}

.metric-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.metric-bar-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-bar-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--prev-primary-light);
}

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

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

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .tiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tiles-grid {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 15px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}

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

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--prev-success) !important; }
.text-warning { color: var(--prev-warning) !important; }
.text-danger { color: var(--prev-danger) !important; }
.text-muted { color: var(--text-muted) !important; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.d-flex { display: flex !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-1 { gap: 8px !important; }
.gap-2 { gap: 16px !important; }

.hidden { display: none !important; }
