/* =============================================
   MSP Resource Planner — ProUnity
   Design System & Styles
   ============================================= */

:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-w);
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid #1e293b;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.logo-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: white;
  line-height: 1.2;
}

.logo-sub {
  display: block;
  font-size: 11px;
  color: #64748b;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
}

.nav-item:hover {
  background: #1e293b;
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.badge-count {
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 4px;
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid #1e293b;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
}

.user-name { display: block; font-size: 12.5px; font-weight: 600; color: white; }
.user-role { display: block; font-size: 11px; color: #64748b; }

/* ==================== MAIN CONTENT ==================== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
  overflow-y: auto;
}

.page { display: none; animation: fadeIn .2s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== PAGE HEADER ==================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all .15s;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: white; color: var(--text-2); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-green { background: var(--success); color: white; padding: 4px 8px; }
.btn-red { background: var(--danger); color: white; padding: 4px 8px; }
.btn-xs { font-size: 11px; padding: 3px 7px; border-radius: 5px; border: none; cursor: pointer; font-weight: 700; }
.btn-amber { background: var(--warning); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { font-size: 14px; }
.text-red { color: var(--danger); }
.text-amber { color: var(--warning); }
.text-blue { color: var(--primary); }
.text-green { color: var(--success); }

.card-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: .06em;
  padding: 0 20px;
}

/* ==================== KPI ROW ==================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid transparent;
}

.kpi-green { border-left-color: var(--success); }
.kpi-red { border-left-color: var(--danger); }
.kpi-amber { border-left-color: var(--warning); }
.kpi-blue { border-left-color: var(--primary); }

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.kpi-green .kpi-icon { background: var(--success-light); color: var(--success); }
.kpi-red .kpi-icon { background: var(--danger-light); color: var(--danger); }
.kpi-amber .kpi-icon { background: var(--warning-light); color: var(--warning); }
.kpi-blue .kpi-icon { background: var(--primary-light); color: var(--primary); }

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.kpi-label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
}

/* ==================== COVERAGE ROW ==================== */
.coverage-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.coverage-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid transparent;
}

.chip-green { background: var(--success-light); color: var(--success); border-color: #bbf7d0; }
.chip-amber { background: var(--warning-light); color: var(--warning); border-color: #fde68a; }
.chip-red { background: var(--danger-light); color: var(--danger); border-color: #fca5a5; }
.chip-blue { background: var(--primary-light); color: var(--primary); border-color: #bfdbfe; }

/* ==================== TWO COL ==================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ==================== RISK LIST ==================== */
.risk-list { padding: 8px 0; }
.risk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background .12s;
}
.risk-item:last-child { border-bottom: none; }
.risk-item:hover { background: var(--bg); }

.risk-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.risk-dot.red { background: var(--danger); }
.risk-dot.amber { background: var(--warning); }
.risk-dot.green { background: var(--success); }

.risk-body { flex: 1; }
.risk-client { font-weight: 700; font-size: 13.5px; }
.risk-issue { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ==================== TAGS ==================== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-red { background: var(--danger); color: white; }
.tag-amber { background: var(--warning); color: white; }
.tag-green { background: var(--success); color: white; }
.tag-blue { background: var(--primary); color: white; }
.tag-gray { background: #e2e8f0; color: #475569; }
.tag-purple { background: var(--purple); color: white; }
.tag-red-soft { background: var(--danger-light); color: var(--danger); }
.tag-amber-soft { background: var(--warning-light); color: var(--warning); }
.tag-blue-soft { background: var(--primary-light); color: var(--primary); }
.tag-green-soft { background: var(--success-light); color: var(--success); }

/* ==================== ABSENCE LIST ==================== */
.absence-list { padding: 8px 0; }
.absence-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
}
.absence-item:last-child { border-bottom: none; }
.absence-info { flex: 1; }
.absence-name { font-weight: 600; font-size: 13px; }
.absence-detail { font-size: 12px; color: var(--text-2); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.absence-actions { display: flex; gap: 4px; }

/* ==================== PERSON AVATAR ==================== */
.person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}
.person-avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.av-blue { background: #2563eb; }
.av-teal { background: #0d9488; }
.av-green { background: #16a34a; }
.av-purple { background: #7c3aed; }
.av-orange { background: #ea580c; }
.av-red { background: #dc2626; }
.av-pink { background: #db2777; }
.av-gray { background: #64748b; }
.av-amber { background: #d97706; }
.av-indigo { background: #4f46e5; }

/* ==================== AVAILABILITY TABLE ==================== */
.table-scroll { overflow-x: auto; }
.availability-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.availability-table th {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.availability-table th:first-child { text-align: left; padding-left: 20px; }
.availability-table td {
  text-align: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
}
.availability-table td:first-child { text-align: left; padding-left: 20px; }
.availability-table tr:last-child td { border-bottom: none; }
.availability-table tr:hover td { background: var(--bg); }

.person-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
}

.avail-dot {
  font-size: 14px;
  font-weight: 700;
}
.avail-dot.green { color: var(--success); }
.avail-dot.red { color: var(--danger); }
.avail-dot.amber { color: var(--warning); }
.avail-dot.blue { color: var(--primary); }

.lang-tags { display: flex; gap: 3px; flex-wrap: wrap; }
.lang {
  display: inline-block;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.lang.FR { background: #fee2e2; color: #991b1b; }
.lang.NL { background: #dbeafe; color: #1e40af; }
.lang.EN { background: #dcfce7; color: #166534; }
.lang.DE { background: #fef3c7; color: #92400e; }

.role-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

/* ==================== PEAKS ==================== */
.peaks-list { padding: 8px 0; }
.peak-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  border-left: 3px solid transparent;
}
.peak-item:last-child { border-bottom: none; }
.peak-amber { border-left-color: var(--warning); }
.peak-red { border-left-color: var(--danger); }
.peak-blue { border-left-color: var(--primary); }
.peak-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  min-width: 80px;
}
.peak-msg { font-size: 13px; color: var(--text); }

/* ==================== TEAM GRID ==================== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.team-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: all .15s;
}
.team-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.team-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.team-card-info { flex: 1; }
.team-card-name { font-weight: 700; font-size: 14px; }
.team-card-role { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.team-card-langs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.team-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.team-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-2);
}

.avail-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
}
.avail-badge.available { background: var(--success-light); color: var(--success); }
.avail-badge.absent { background: var(--danger-light); color: var(--danger); }
.avail-badge.partial { background: var(--warning-light); color: var(--warning); }

/* ==================== FILTER CHIPS ==================== */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.chip-active { background: var(--primary); border-color: var(--primary); color: white; }

/* ==================== SEARCH INPUT ==================== */
.search-input {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  width: 260px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--primary); }

/* ==================== CLIENTS GRID ==================== */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.client-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  cursor: pointer;
  transition: all .15s;
}
.client-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.client-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.client-name { font-weight: 800; font-size: 16px; }
.client-sector { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.client-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.status-green { background: var(--success); }
.status-amber { background: var(--warning); }
.status-red { background: var(--danger); }
.status-blue { background: var(--primary); }
.status-gray { background: var(--text-3); }

.client-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.client-card-people {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-2);
}

/* ==================== CLIENT DETAIL ==================== */
.client-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 0;
}

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

.detail-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: .07em;
  margin-bottom: 10px;
}

.assignment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.assignment-row:last-child { border-bottom: none; }
.assignment-role { font-size: 12px; font-weight: 600; color: var(--text-2); min-width: 60px; }
.assignment-name { font-weight: 700; font-size: 13.5px; flex: 1; }
.assignment-status { font-size: 12px; }

.rule-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.rule-item:last-child { border-bottom: none; }
.rule-icon { font-size: 14px; width: 18px; text-align: center; }

.candidate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.candidate-row:hover { opacity: .85; }
.candidate-row:last-child { border-bottom: none; }
.candidate-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  min-width: 20px;
}
.candidate-info { flex: 1; }
.candidate-name { font-weight: 700; font-size: 13px; }
.candidate-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.candidate-score {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  min-width: 50px;
  text-align: right;
}

/* ==================== PLANNING BOARD ==================== */
.planning-board {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.planning-board th {
  background: var(--bg);
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
}
.planning-board td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  vertical-align: middle;
}
.planning-board td:first-child {
  font-weight: 700;
  background: var(--bg);
  min-width: 160px;
}
.planning-board td:nth-child(2) {
  font-size: 12px;
  color: var(--text-2);
  min-width: 80px;
}

.plan-cell-ok { background: #f0fdf4; color: var(--success); font-weight: 600; font-size: 12px; text-align: center; }
.plan-cell-warn { background: #fffbeb; color: var(--warning); font-weight: 600; font-size: 12px; text-align: center; }
.plan-cell-err { background: #fef2f2; color: var(--danger); font-weight: 600; font-size: 12px; text-align: center; }
.plan-cell-leave { background: #eff6ff; color: var(--primary); font-weight: 600; font-size: 12px; text-align: center; }

/* ==================== ABSENCES FORM ==================== */
.absence-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.form-input, .form-select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: white;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); }
.form-full { grid-column: span 2; }

.impact-preview {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.impact-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 8px;
}
.impact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 3px 0;
}

/* ==================== ALERTS PAGE ==================== */
.alerts-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.alert-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-left: 4px solid transparent;
  transition: all .15s;
}
.alert-card:hover { box-shadow: var(--shadow-md); }
.alert-card.critical { border-left-color: var(--danger); }
.alert-card.warning { border-left-color: var(--warning); }
.alert-card.info { border-left-color: var(--primary); }

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.alert-card.critical .alert-icon { background: var(--danger-light); color: var(--danger); }
.alert-card.warning .alert-icon { background: var(--warning-light); color: var(--warning); }
.alert-card.info .alert-icon { background: var(--primary-light); color: var(--primary); }

.alert-body { flex: 1; }
.alert-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.alert-msg { font-size: 12.5px; color: var(--text-2); }
.alert-meta { font-size: 11px; color: var(--text-3); margin-top: 6px; }

.alert-actions { display: flex; gap: 6px; align-items: flex-start; flex-shrink: 0; }

/* ==================== LONG TERM PLANNING ==================== */
.lt-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.lt-cell {
  background: white;
  padding: 8px;
  min-height: 60px;
  font-size: 11px;
}
.lt-cell-header {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg);
  padding: 8px;
  text-align: center;
}
.lt-cell-safe { background: #f0fdf4; }
.lt-cell-warn { background: #fffbeb; }
.lt-cell-risk { background: #fef2f2; }

/* ==================== PROFILE PAGE ==================== */
.profile-header {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.profile-meta { font-size: 13px; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.profile-meta span { display: flex; align-items: center; gap: 4px; }

.profile-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.lang-bar-row { margin-bottom: 12px; }
.lang-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
.lang-bar-bg {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.lang-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width .4s ease;
}

.impact-warning {
  background: var(--danger-light);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 12px 16px;
}
.impact-warning-title { font-weight: 700; color: var(--danger); font-size: 12px; margin-bottom: 8px; }
.impact-item {
  font-size: 12.5px;
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

/* ==================== MODAL ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-2);
  padding: 4px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--bg); }
.modal-body { padding: 20px 24px; }

/* ==================== LEGEND ==================== */
.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.green { background: var(--success); }
.legend-dot.amber { background: var(--warning); }
.legend-dot.red { background: var(--danger); }
.legend-dot.blue { background: var(--primary); }

/* ==================== LT TABLE ==================== */
.lt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.lt-table th {
  background: var(--bg);
  padding: 10px 12px;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lt-table th:first-child { text-align: left; }
.lt-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: center;
  font-weight: 600;
}
.lt-table td:first-child { text-align: left; font-weight: 700; }
.lt-cell-ok { background: #f0fdf4; color: var(--success); }
.lt-cell-warn2 { background: #fffbeb; color: var(--warning); }
.lt-cell-risk2 { background: #fef2f2; color: var(--danger); }
.lt-cell-na { background: #f8fafc; color: var(--text-3); }
.lt-cell-plan { background: #eff6ff; color: var(--primary); }

/* ==================== UTILITY ==================== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.section-padding { padding: 16px 20px; }
.flex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.muted { color: var(--text-2); font-size: 12px; }
.bold { font-weight: 700; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .client-detail-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 60px; }
  .sidebar-logo .logo-text { display: none; }
  .nav-item span { display: none; }
  .nav-item { justify-content: center; }
  .main-content { padding: 16px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .search-input { width: 180px; }
}
