@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  
  /* Favorite Color Gradient: Orange/Yellow -> Green -> Sky Blue */
  --color-start: #f59e0b; /* Yellow-Orange */
  --color-mid: #10b981;   /* Emerald Green */
  --color-end: #0ea5e9;   /* Sky Blue */
  
  --brand-gradient: linear-gradient(135deg, var(--color-start) 0%, var(--color-mid) 50%, var(--color-end) 100%);
  --brand-gradient-h: linear-gradient(90deg, var(--color-start) 0%, var(--color-mid) 50%, var(--color-end) 100%);
  
  /* Primary & Slate System */
  --primary: #0284c7; 
  --primary-dark: #0369a1;
  --primary-soft: #f0f9ff;
  
  --bg: #f8fafc;
  --bg-deep: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #fafcfd;
  --surface-tint: #f0fdfa;
  
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  
  --navy: #0f172a;
  --blue: #2563eb;
  --green: #10b981;
  --amber: #d97706;
  --red: #ef4444;
  
  /* Shadow & Radius System */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --shadow-premium: 0 20px 40px -15px rgba(15, 23, 42, 0.12);
  
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 320px;
}

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

body {
  min-height: 100vh;
  background: 
    radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.05), transparent 450px),
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.05), transparent 600px),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.07), transparent 500px),
    var(--bg);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* App Shell Layout */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar Styling */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 30px rgba(15, 23, 42, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-gradient);
  color: #fff;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.4);
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255,255,255,0.15), transparent);
}

.brand-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--navy) 30%, var(--primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sync Status Dot Indicator */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-deep);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.sync-dot.syncing {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
  animation: pulse 1.2s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Inputs, Selects, Buttons */
.select,
.input {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 40px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.select:hover,
.input:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.select:focus,
.input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
  outline: none;
}

.textarea {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 40px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  width: 100%;
  resize: vertical;
  line-height: 1.5;
}

.textarea:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
  outline: none;
}

/* Clean up button states */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  background: rgba(255, 255, 255, 0.3);
  border: 1.5px solid transparent; /* Fallback for mask */
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  z-index: 1;
  background-clip: padding-box;
}

.button.primary::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, #f59e0b 0%, #10b981 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  pointer-events: none;
}

.button.primary:hover {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

.button.ghost {
  background: rgba(241, 245, 249, 0.5);
  border: 1px solid transparent;
  box-shadow: none;
}

.button.ghost:hover {
  background: rgba(241, 245, 249, 0.9);
  border-color: var(--line);
}

.button.danger {
  background: rgba(254, 226, 226, 0.6);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.2);
}

.button.danger:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.button.icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

/* Layout Split */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - 72px);
  position: relative;
  transition: var(--transition);
}

.layout.sidebar-collapsed {
  --sidebar-width: 0px;
}

/* Sidebar Styling */
.sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.4);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
  z-index: 10;
}

.sidebar-inner {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 320px; /* keep stable width when transitioning parent */
}

/* Sidebar Toggle Trigger floating button */
.sidebar-toggle-floating {
  position: absolute;
  right: -16px;
  top: 90px;
  z-index: 40;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle-floating:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.1);
}

/* Sidebar content card */
.sidebar-card {
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  height: 100%;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sidebar-heading span:first-child {
  font-family: 'Be Vietnam Pro', sans-serif;
  color: var(--navy);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-heading span:last-child {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-deep);
  padding: 4px 10px;
  border-radius: 99px;
  color: var(--muted);
}

.sidebar-search-container {
  position: relative;
  margin-bottom: 12px;
}

.sidebar-search-container input {
  width: 100%;
  padding-left: 36px;
}

.sidebar-search-container::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.5;
}

.tree-container {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.tree-list {
  list-style: none;
}

.tree-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.tree-item.active {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}

.tree-item.active button {
  color: var(--primary-dark);
  font-weight: 700;
}

.tree-icon {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tree-item button {
  border: 0;
  background: transparent;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-item button:hover {
  color: var(--primary);
}

.tree-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tree-item.active .tree-meta {
  background: var(--surface);
  color: var(--primary-dark);
}

.indent-1 { padding-left: 20px; }
.indent-2 { padding-left: 36px; }

/* Main Workspace */
.main {
  min-width: 0;
  padding: 24px 32px 48px;
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100vh - 72px);
  word-break: break-word;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.tab-button {
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: none;
}

.tab-button:hover {
  background: rgba(241, 245, 249, 0.7);
  color: var(--ink);
}

.tab-button.active {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Headers */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
  color: var(--navy);
}

.section-caption {
  margin-top: 4px;
  color: var(--muted);
  max-width: 800px;
  font-size: 14px;
}

/* Page Action Header Row */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grid layout options */
.grid {
  display: grid;
  gap: 20px;
}
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Panels and Cards */
.panel {
  position: relative;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.panel.hover-lift:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
  border-color: rgba(226, 232, 240, 1);
}

.panel.flat {
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* KPI Card styling with border gradient */
.kpi {
  min-height: 120px;
  position: relative;
  overflow: hidden;
  background: #fff;
  border-top: 4px solid transparent;
}

.kpi::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--brand-gradient-h);
}

.kpi::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.04) 0%, rgba(14, 165, 233, 0.04) 100%);
}

.kpi span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.kpi strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  line-height: 1.1;
  color: var(--navy);
}

.kpi small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* KPI Chips (Row at top of Center Summary page) */
.summary-chips {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.summary-chip {
  flex: 1;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.summary-chip-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-deep);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.summary-chip-icon.blue { background: #e0f2fe; color: var(--blue); }
.summary-chip-icon.green { background: #dcfce7; color: var(--green); }
.summary-chip-icon.amber { background: #fef3c7; color: var(--amber); }
.summary-chip-icon.red { background: #fee2e2; color: var(--red); }

.summary-chip-content span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}

.summary-chip-content strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  display: block;
  margin-top: 2px;
}

/* Tables styling */
.table-wrap {
  overflow: auto;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 800px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--line);
}

/* Freeze Columns for tables (e.g. Center Summary name column) */
.table-freeze-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.02);
}

th.table-freeze-col {
  z-index: 3;
  background: #f8fafc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tr {
  transition: var(--transition);
}

tr:hover td {
  background: rgba(248, 250, 252, 0.6);
}

/* Tags & Badges */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--bg-deep);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.green { background: #dcfce7; color: #16a34a; }
.tag.amber { background: #fef3c7; color: #d97706; }
.tag.red { background: #fee2e2; color: #dc2626; }
.tag.blue { background: #e0f2fe; color: #0284c7; }

/* Progress Bars */
.bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-mid) 0%, var(--color-end) 100%);
  transition: width 0.4s ease;
}

/* Split layout on individual assessment */
.split {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.assessment-list {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 4px;
}

.assessment-list button {
  width: 100%;
  display: block;
  padding: 14px 18px;
  margin-bottom: 8px;
  text-align: left;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.assessment-list button:hover {
  border-color: var(--line-strong);
  transform: translateX(2px);
}

.assessment-list button.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.08);
}

.assessment-list button.active .muted {
  color: var(--primary);
}

/* Assessment hero / top sticky personal summary */
.assessment-hero {
  position: sticky;
  top: 86px;
  z-index: 6;
  margin-bottom: 20px;
  border-left: 5px solid transparent;
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.assessment-hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--brand-gradient);
  border-radius: var(--radius) 0 0 var(--radius);
}

.hero-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--navy);
  line-height: 1.2;
}

.hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Competency list accordions */
.competency {
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.competency:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.competency-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(180deg, #fafcfd, #f1f5f9);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.competency-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.competency-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 28px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.competency-title-text {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}

.competency-arrow {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s ease;
  font-weight: bold;
}

/* Collapsed Accordion State */
.competency.collapsed .competency-body {
  display: none;
}

.competency.collapsed .competency-arrow {
  transform: rotate(-90deg);
}

.competency.collapsed {
  box-shadow: none;
}

.competency.collapsed .competency-head {
  border-bottom-color: transparent;
}

/* Competency Body */
.competency-body {
  background: #fff;
}

.score-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.2fr) 210px minmax(280px, 0.8fr);
}

.score-grid-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.score-grid > div {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.score-grid > div:nth-child(3n + 2),
.score-grid > div:nth-child(3n + 3) {
  border-left: 1px solid var(--line);
}

.score-grid > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

/* Segmented controls for rating */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  height: 38px;
  width: 100%;
}

.score-pill {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: none;
}

.score-pill:hover:not(.active) {
  color: var(--ink);
  background: rgba(255,255,255,0.4);
}

.score-pill.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* Summary tools / Actions row under header */
.summary-tools,
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 18px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
}

/* Empty states */
.empty {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-icon {
  font-size: 32px;
  opacity: 0.6;
}

.empty-text {
  font-weight: 600;
  font-size: 15px;
}

/* Side Drawer Component (Slide-over) */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 480px;
  max-width: 100%;
  background: #fff;
  z-index: 51;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer-overlay.open .drawer {
  transform: translateX(0);
}

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

.drawer-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--navy);
}

.drawer-close {
  font-size: 20px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  transition: var(--transition);
  box-shadow: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.drawer-close:hover {
  background: var(--bg-deep);
  color: var(--ink);
}

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

.drawer-body .field {
  margin-bottom: 20px;
}

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

/* Custom Modal Dialog (Replacing standard alert / confirm) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 440px;
  max-width: 90%;
  box-shadow: var(--shadow-premium);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.modal-icon.warning { background: #fef3c7; color: var(--amber); }
.modal-icon.danger { background: #fee2e2; color: var(--red); }
.modal-icon.info { background: #e0f2fe; color: var(--blue); }

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--navy);
}

.modal-body {
  padding: 8px 24px 24px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.modal-footer {
  padding: 12px 24px 16px;
  background: var(--bg);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast Messages Stack */
.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xl);
  color: var(--ink);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(20px);
  opacity: 0;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  overflow: hidden;
}

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

@keyframes slideOut {
  to {
    transform: translateY(20px);
    opacity: 0;
  }
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.toast.success::before { background: var(--green); }
.toast.warning::before { background: var(--amber); }
.toast.error::before { background: var(--red); }

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-message {
  flex-grow: 1;
  font-size: 13px;
}

.toast-close {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  opacity: 0.6;
  font-size: 14px;
  box-shadow: none;
}

.toast-close:hover {
  opacity: 1;
}

/* Responsive Overrides */
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 72px);
    box-shadow: 10px 0 30px rgba(0,0,0,0.05);
    background: #fff;
    transform: translateX(0);
  }
  
  .layout.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar-toggle-floating {
    left: calc(var(--sidebar-width) - 16px);
  }
  
  .layout.sidebar-collapsed .sidebar-toggle-floating {
    left: 12px;
  }

  .main {
    padding: 20px 16px 36px;
  }

  .nav-tabs,
  .assessment-list,
  .assessment-hero {
    position: static;
  }

  .split {
    grid-template-columns: 1fr;
  }
  
  .assessment-list {
    max-height: 200px;
    margin-bottom: 16px;
  }
}

@media (max-width: 768px) {
  .topbar {
    height: auto;
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .top-actions {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  .top-actions > * {
    flex: 1 1 auto;
  }
  
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
  
  .score-grid {
    grid-template-columns: 1fr;
  }
  
  .score-grid-header {
    display: none;
  }
  
  .score-grid > div:nth-child(n) {
    border-left: 0;
  }
  
  .score-grid > div {
    padding: 12px;
  }
  
  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  
  .toast {
    min-width: 0;
  }
}

/* Data Tables */
.table-wrapper {
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
  background: var(--surface-tint);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.badge-role {
  display: inline-flex;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  background: var(--bg-deep);
  color: var(--muted);
}
.badge-role.director {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}
.badge-role.manager {
  background: rgba(2, 132, 199, 0.15);
  color: var(--primary-dark);
}

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