/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #1B3A6B;
    --primary-light: #2A5298;
    --primary-dark: #0F2547;
    --accent: #6B4C9A;
    --accent-light: #8B6EBF;
    --success: #2E7D32;
    --warning: #F57F17;
    --danger: #C62828;
    --info: #0277BD;
    --bg: #F4F6FA;
    --surface: #FFFFFF;
    --border: #D8DCE6;
    --text: #1A1F36;
    --text-secondary: #5A607F;
    --sidebar-bg: #0B1929;
    --sidebar-active: #1B3A6B;
    --sidebar-hover: #122240;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}
html { font-size: 14px; }
body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== LOGIN ===== */
#login-overlay {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #0F2547 0%, #6B4C9A 100%);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
#login-overlay.hidden { display: none; }
.login-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}
.login-logo { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 1.8rem; color: var(--primary-dark); margin-bottom: 8px; }
.login-logo i { color: var(--primary); font-size: 2.2rem; }
.login-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 28px; }
.login-field { text-align: left; margin-bottom: 16px; }
.login-field label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.login-input-wrap {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 14px; transition: var(--transition);
}
.login-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,58,107,0.12); }
.login-input-wrap i { color: var(--text-secondary); font-size: 0.9rem; }
.login-input-wrap input { border: none; outline: none; flex: 1; font-size: 0.92rem; background: transparent; }
.login-error { color: var(--danger); font-size: 0.8rem; margin-bottom: 12px; text-align: center; }
.login-error.hidden { display: none; }
.login-btn {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; border: none; border-radius: var(--radius);
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.login-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.login-footer { margin-top: 20px; }
.login-footer small { color: var(--text-secondary); }

/* ===== SIDEBAR ===== */
#sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #A0B4D0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    transition: var(--transition);
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo {
    display: flex; align-items: center; gap: 10px;
    color: #fff; font-size: 1.3rem;
}
.logo i { color: #5B8DEF; font-size: 1.6rem; }
.subtitle { color: #4A6A9A; font-size: 0.72rem; display: block; margin-top: 4px; }
.nav-menu { list-style: none; padding: 8px 0; flex: 1; overflow-y: auto; }
.nav-section {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #4A6A9A;
    padding: 16px 20px 6px;
    font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    cursor: pointer; transition: var(--transition);
    font-size: 0.88rem;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: #5B8DEF;
}
.nav-item i { width: 20px; text-align: center; font-size: 0.95rem; }
.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}
.nav-divider { border-top: 1px solid rgba(255,255,255,0.06); margin: 6px 0; }
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600;
}
.user-name { color: #fff; font-weight: 500; font-size: 0.85rem; }
.user-role { font-size: 0.72rem; color: #4A6A9A; }
.btn-logout {
    margin-left: auto; background: none; border: none;
    color: #4A6A9A; cursor: pointer; font-size: 0.9rem;
    padding: 4px;
}
.btn-logout:hover { color: #fff; }

/* ===== PORTAL SWITCHER ===== */
.portal-switcher {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.portal-tabs {
    display: flex; gap: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px; padding: 3px;
}
.portal-tab {
    flex: 1; text-align: center;
    padding: 6px 4px;
    font-size: 0.7rem; font-weight: 600;
    color: #4A6A9A;
    border-radius: 4px; cursor: pointer;
    transition: var(--transition);
}
.portal-tab:hover { color: #A0B4D0; }
.portal-tab.active {
    background: var(--primary);
    color: #fff;
}

/* ===== MAIN ===== */
#main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== TOPBAR ===== */
#topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h1 { font-size: 1.2rem; font-weight: 600; }
#sidebar-toggle { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-secondary); display: none; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-selector {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 6px 12px;
}
.topbar-selector select {
    border: none; background: transparent;
    font-size: 0.82rem; color: var(--text);
    cursor: pointer; outline: none;
}
.topbar-selector i { color: var(--text-secondary); font-size: 0.82rem; }
.btn-icon {
    background: none; border: none;
    font-size: 1.1rem; cursor: pointer;
    color: var(--text-secondary);
    position: relative; padding: 6px;
}
.btn-icon .badge {
    position: absolute; top: 0; right: 0;
    background: var(--danger); color: #fff;
    font-size: 0.6rem; padding: 2px 5px;
    border-radius: 10px; font-weight: 600;
}

/* ===== CONTENT ===== */
#content-area { padding: 24px; flex: 1; }
.view { display: none; }
.view.active { display: block; }

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.section-header h2 { font-size: 1.3rem; font-weight: 700; }
.section-header p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px; }
.section-actions { display: flex; gap: 8px; }

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; border: none; border-radius: var(--radius);
    padding: 8px 16px; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline {
    background: transparent; color: var(--primary);
    border: 1px solid var(--primary); border-radius: var(--radius);
    padding: 8px 16px; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-outline:hover { background: rgba(27,58,107,0.06); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-ghost { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 0.82rem; font-weight: 600; padding: 4px 8px; }
.btn-ghost:hover { text-decoration: underline; }

/* ===== KPI CARDS ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow);
}
.kpi-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.kpi-icon.compliance { background: #E8EAF6; color: var(--primary); }
.kpi-icon.risk { background: #FFEBEE; color: var(--danger); }
.kpi-icon.evidence { background: #E8F5E9; color: var(--success); }
.kpi-icon.odv { background: #EDE7F6; color: var(--accent); }
.kpi-icon.env { background: #E8F5E9; color: var(--success); }
.kpi-icon.social { background: #E3F2FD; color: var(--info); }
.kpi-icon.gov { background: #FFF3E0; color: var(--warning); }
.kpi-icon.danger { background: #FFEBEE; color: var(--danger); }
.kpi-icon.success { background: #E8F5E9; color: var(--success); }
.kpi-icon.info { background: #E3F2FD; color: var(--info); }
.kpi-icon.warning { background: #FFF3E0; color: var(--warning); }
.kpi-icon.accent { background: #EDE7F6; color: var(--accent); }
.kpi-value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.kpi-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.kpi-trend { font-size: 0.72rem; margin-top: 4px; }
.kpi-trend.positive { color: var(--success); }
.kpi-trend.negative { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-secondary); }

/* ===== SCORE RING ===== */
.score-container {
    display: flex; align-items: center; justify-content: center;
    gap: 32px; padding: 24px;
}
.score-ring {
    position: relative;
    width: 140px; height: 140px;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: var(--border); stroke-width: 8; }
.score-ring-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-ring-value {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.score-ring-value .score-number { font-size: 2.2rem; font-weight: 800; }
.score-ring-value .score-label { font-size: 0.72rem; color: var(--text-secondary); }
.score-breakdown { display: flex; flex-direction: column; gap: 12px; }
.score-item { display: flex; align-items: center; gap: 10px; }
.score-dot { width: 10px; height: 10px; border-radius: 50%; }
.score-item-label { font-size: 0.85rem; color: var(--text-secondary); min-width: 140px; }
.score-item-bar { flex: 1; height: 8px; background: #EEE; border-radius: 4px; overflow: hidden; min-width: 120px; }
.score-item-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.score-item-value { font-size: 0.85rem; font-weight: 700; min-width: 40px; text-align: right; }

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--text-secondary); }
.card-body { padding: 20px; }

/* ===== CHARTS ===== */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.chart-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.chart-header h3 { font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.chart-body { padding: 16px; }
.chart-body canvas { max-height: 260px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left; font-size: 0.75rem;
    font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-secondary);
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
    background: #F8F9FC;
}
tbody td {
    padding: 10px 14px; font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tbody tr:hover { background: rgba(27,58,107,0.03); }

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 12px;
    font-size: 0.72rem; font-weight: 600;
}
.status-badge.green { background: #E8F5E9; color: var(--success); }
.status-badge.yellow { background: #FFF8E1; color: #F9A825; }
.status-badge.red { background: #FFEBEE; color: var(--danger); }
.status-badge.blue { background: #E3F2FD; color: var(--info); }
.status-badge.indigo { background: #E8EAF6; color: var(--primary); }
.status-badge.purple { background: #EDE7F6; color: var(--accent); }
.status-badge.gray { background: #F5F5F5; color: #757575; }

/* ===== PROGRESS BAR ===== */
.progress-bar { height: 8px; background: #EEE; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.progress-bar-fill.indigo { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.progress-bar-fill.green { background: var(--success); }
.progress-bar-fill.yellow { background: var(--warning); }
.progress-bar-fill.red { background: var(--danger); }
.progress-bar-fill.blue { background: var(--info); }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

/* ===== GUIDE ACCORDION ===== */
.guide-search { margin-bottom: 20px; }
.guide-search input {
    width: 100%; padding: 10px 16px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.88rem; outline: none; transition: var(--transition);
    background: var(--surface);
}
.guide-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,58,107,0.1); }
.guide-accordion { display: flex; flex-direction: column; gap: 8px; }
.guide-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.guide-section:hover { border-color: rgba(27,58,107,0.3); }
.guide-section-header {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px;
    cursor: pointer; transition: var(--transition);
    user-select: none;
}
.guide-section-header:hover { background: rgba(27,58,107,0.03); }
.guide-section-icon {
    width: 40px; height: 40px;
    background: rgba(27,58,107,0.08);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.guide-section-header h3 { flex: 1; font-size: 0.95rem; font-weight: 600; }
.guide-section-header p { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.guide-section-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.guide-section.open .guide-section-arrow { transform: rotate(180deg); }
.guide-section-body {
    padding: 0 20px 20px;
    display: none;
    border-top: 1px solid var(--border);
}
.guide-section.open .guide-section-body { display: block; padding-top: 16px; }
.guide-content { font-size: 0.875rem; line-height: 1.7; }
.guide-content h4 {
    color: var(--primary); margin: 16px 0 8px;
    font-size: 0.9rem; font-weight: 700;
}
.guide-content p { margin-bottom: 12px; }
.guide-content ul { padding-left: 20px; margin-bottom: 12px; }
.guide-content ul li { padding: 3px 0; line-height: 1.6; }
.law-ref {
    background: rgba(27,58,107,0.06);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 12px 0;
    font-size: 0.85rem;
}
.guide-reati-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.guide-reato-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: var(--transition);
}
.guide-reato-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.guide-reato-card .reato-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; margin-bottom: 8px;
}
.guide-reato-card .reato-article {
    font-size: 0.72rem; color: var(--primary);
    font-weight: 700; text-transform: uppercase;
}
.guide-reato-card .reato-title { font-size: 0.88rem; font-weight: 600; margin: 4px 0; }
.guide-reato-card .reato-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; }
.guide-reato-card .reato-count {
    font-size: 0.7rem; color: var(--text-secondary);
    margin-top: 6px; font-weight: 600;
}

/* ===== WIZARD / FORMS ===== */
.wizard-steps {
    display: flex; gap: 0; margin-bottom: 24px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.wizard-step {
    flex: 1; padding: 12px 16px;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; color: var(--text-secondary);
    border-right: 1px solid var(--border);
    position: relative;
}
.wizard-step:last-child { border-right: none; }
.wizard-step.active { background: rgba(27,58,107,0.06); color: var(--primary); font-weight: 600; }
.wizard-step.completed { background: #E8EAF6; color: var(--primary); }
.wizard-step-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--border); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700;
    flex-shrink: 0;
}
.wizard-step.active .wizard-step-num { background: var(--primary); color: #fff; }
.wizard-step.completed .wizard-step-num { background: var(--primary); color: #fff; }
.wizard-content { display: none; }
.wizard-content.active { display: block; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.88rem; color: var(--text);
    outline: none; transition: var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,58,107,0.1); }
textarea.form-control { min-height: 80px; resize: vertical; }
.form-hint { font-size: 0.72rem; color: var(--text-secondary); margin-top: 4px; font-style: italic; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.form-actions { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== RISK MATRIX ===== */
.risk-matrix-container { padding: 20px; }
.risk-matrix {
    display: grid;
    grid-template-columns: auto repeat(5, 1fr);
    grid-template-rows: auto repeat(5, 1fr);
    gap: 2px;
    max-width: 600px;
    margin: 0 auto;
}
.risk-matrix-label {
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 600; color: var(--text-secondary);
    padding: 4px;
}
.risk-cell {
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    min-height: 50px;
    transition: var(--transition);
}
.risk-cell:hover { opacity: 0.8; transform: scale(1.05); }
.risk-cell.level-1 { background: #E8F5E9; }
.risk-cell.level-2 { background: #FFF8E1; }
.risk-cell.level-3 { background: #FFF3E0; }
.risk-cell.level-4 { background: #FFEBEE; }
.risk-cell.level-5 { background: #FFCDD2; }
.risk-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: ''; position: absolute;
    left: 7px; top: 0; bottom: 0;
    width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; padding-left: 16px; }
.timeline-item::before {
    content: ''; position: absolute;
    left: -20px; top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-date { font-size: 0.72rem; color: var(--text-secondary); font-weight: 600; }
.timeline-text { font-size: 0.85rem; margin-top: 2px; }

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.upload-area:hover { border-color: var(--primary); background: rgba(27,58,107,0.02); }
.upload-area i { font-size: 2rem; color: var(--text-secondary); margin-bottom: 8px; }
.upload-area p { font-size: 0.85rem; color: var(--text-secondary); }
.upload-area small { font-size: 0.72rem; color: var(--text-secondary); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
    padding: 10px 20px;
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== LANGUAGE SWITCHER ===== */
.sidebar-lang-toggle {
    display: flex;
    gap: 4px;
    padding: 10px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.lang-btn {
    flex: 1;
    padding: 5px 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: #4A6A9A;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lang-btn:hover {
    color: #A0B4D0;
    background: rgba(255,255,255,0.1);
}
.lang-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== MOG PILLAR DIAGRAM ===== */
.mog-pillars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin: 20px 0;
}
.mog-pillar {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
    transition: var(--transition);
}
.mog-pillar:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.mog-pillar i { font-size: 1.2rem; color: var(--primary); margin-bottom: 6px; display: block; }
.mog-pillar .pillar-title { font-size: 0.72rem; font-weight: 600; line-height: 1.3; }
.mog-pillar .pillar-pct { font-size: 0.85rem; font-weight: 700; color: var(--primary); margin-top: 4px; }
.mog-pillar.complete { border-color: var(--success); }
.mog-pillar.complete i { color: var(--success); }
.mog-pillar.complete .pillar-pct { color: var(--success); }

/* ===== CHECKLIST ===== */
.checklist { list-style: none; padding: 0; }
.checklist li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    font-size: 0.85rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist li i.fa-check-circle { color: var(--success); }
.checklist li i.fa-times-circle { color: var(--danger); }
.checklist li i.fa-clock { color: var(--warning); }

/* ===== CONSULTANT CLIENT ROW ===== */
.client-row { display: flex; align-items: center; gap: 12px; }
.client-avatar {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: #fff;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal-container {
    background: #fff; border-radius: 12px; width: 100%;
    max-width: 580px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.18s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 8px; }
.modal-header h3 i { color: var(--primary); }
.modal-close { background: none; border: none; font-size: 1.4rem; color: var(--text-secondary); cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 12px;
    position: sticky; bottom: 0; background: #fff;
}
.radio-group { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 6px; }
.radio-option { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.875rem; font-weight: 400; }
.radio-option input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 0.82rem; margin-top: 12px; }
.alert-danger { background: #FFEBEE; color: var(--danger); border: 1px solid rgba(198,40,40,0.2); }
.alert-success { background: #E8F5E9; color: var(--success); border: 1px solid rgba(46,125,50,0.2); }
.btn-secondary {
    padding: 8px 18px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; color: var(--text-primary); font-size: 0.82rem;
    font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-secondary:hover { background: var(--bg-secondary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .guide-reati-grid { grid-template-columns: repeat(2, 1fr); }
    .mog-pillars { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    #main-content { margin-left: 0; }
    #sidebar-toggle { display: block; }
    .kpi-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
    .wizard-steps { flex-direction: column; }
    .wizard-step { border-right: none; border-bottom: 1px solid var(--border); }
    .mog-pillars { grid-template-columns: repeat(2, 1fr); }
    .guide-reati-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Coming Soon toast animation
   ============================================================ */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.btn-coming-soon { cursor: not-allowed !important; opacity: 0.85; }
.btn-coming-soon:hover { opacity: 1; }
