/* ===========================
   QE5 Capability Assessment
   Global Stylesheet — v2
   =========================== */

/* 1. Variables */
:root {
  --primary: #1F4E79;
  --primary-dark: #174069;
  --primary-mid: #378ADD;
  --primary-light: #D6E4F0;
  --primary-xlight: #EBF5FB;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --sidebar-width: 220px;
  --topbar-height: 56px;
  --border-radius: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .04);
  --transition: all 0.15s ease;
  /* Slate-based grays */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
}

/* 2. Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-800);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* 3. App Shell — topbar + sidebar layout */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 50;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-logo {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  padding: 4px 9px;
  border-radius: 6px;
}

.topbar-tagline {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.view-toggle {
  display: inline-flex;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.view-toggle-btn {
  padding: 4px 16px;
  border-radius: 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gray-500);
  font-family: inherit;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.view-toggle-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.view-toggle-btn.disabled {
  cursor: default;
  opacity: 0.5;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .5px;
}

.topbar-user {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.topbar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-800);
}

.topbar-user-sub {
  font-size: 0.7rem;
  color: var(--gray-500);
}

/* App Body Layout */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.nav-section {
  padding: 14px 0 6px;
}

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-400);
  padding: 0 14px;
  margin-bottom: 2px;
}

.sidebar-nav {
  list-style: none;
}

.nav-item {}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  color: var(--gray-600);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  border-right: 3px solid transparent;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-xlight);
  text-decoration: none;
}

.nav-link i {
  font-size: 1rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.nav-item.active .nav-link {
  color: var(--primary);
  background: var(--primary-xlight);
  border-right-color: var(--primary);
  font-weight: 600;
}

.badge-count {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.btn-logout-nav {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
}

.btn-logout-nav:hover {
  color: var(--danger) !important;
  background: var(--danger-light) !important;
  border-right-color: transparent !important;
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--bg);
}

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

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* 4. Cards */
.card {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* 5. Stat Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-card--primary .stat-card__icon {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-card--success .stat-card__icon {
  background: var(--success-light);
  color: var(--success);
}

.stat-card--warning .stat-card__icon {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-card--info .stat-card__icon {
  background: var(--info-light);
  color: var(--info);
}

.stat-card--danger .stat-card__icon {
  background: var(--danger-light);
  color: var(--danger);
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}

.stat-card__title {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 3px;
  font-weight: 500;
}

.stat-card__trend {
  font-size: 0.72rem;
  color: var(--gray-400);
  margin-top: 2px;
}

/* 6. Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}

.badge-l1 {
  background: #D6E4F0;
  color: #1F4E79;
}

.badge-l2 {
  background: #dcfce7;
  color: #15803d;
}

.badge-l3 {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-pass {
  background: var(--success-light);
  color: var(--success);
}

.badge-fail {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-pending {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-more-evidence {
  background: #fef9c3;
  color: #854d0e;
}

.badge-in-progress {
  background: var(--primary-xlight);
  color: var(--primary-mid);
}

.badge-info {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-foundation {
  background: #dcfce7;
  color: #15803d;
}

.badge-operational {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-leadership {
  background: #fce7f3;
  color: #be185d;
}

/* 7. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

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

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-100);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

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

.btn-disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 8. Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-800);
  background: #fff;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(55, 138, 221, .15);
}

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

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 4px;
}

.form-select {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

/* 9. Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--gray-500);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: var(--gray-50);
}

.worker-name {
  display: block;
  font-weight: 600;
  color: var(--gray-800);
}

.worker-dept {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 1px;
  display: block;
}

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

/* 10. Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border-left: 3px solid var(--success);
}

.alert-error {
  background: var(--danger-light);
  color: var(--danger);
  border-left: 3px solid var(--danger);
}

.alert-info {
  background: var(--info-light);
  color: var(--info);
  border-left: 3px solid var(--info);
}

/* 11. Auth Layout */
.auth-body {
  background: var(--gray-100);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 16px;
}

.auth-card {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 40px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-block {
  margin-bottom: 12px;
}

.auth-logo-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 2px;
  padding: 8px 16px;
  border-radius: 8px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 12px;
}

.auth-subtitle {
  color: var(--gray-500);
  margin-top: 4px;
  font-size: 0.875rem;
}

/* 12. Assessment Layout */
.assessment-body {
  background: var(--bg);
  min-height: 100vh;
}

.assessment-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.assessment-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.back-link {
  color: var(--gray-500);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.back-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.assessment-title {
  font-weight: 600;
  color: var(--gray-800);
  flex-shrink: 0;
}

.assessment-progress-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 3px;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--gray-500);
  white-space: nowrap;
}

.assessment-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* 4-pip progress indicator */
.progress-pips {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pip {
  height: 6px;
  flex: 1;
  border-radius: 3px;
  min-width: 24px;
}

.pip-filled {
  background: var(--primary);
}

.pip-active {
  background: var(--primary-mid);
}

.pip-empty {
  background: var(--gray-200);
}

/* 13. Assessment Card */
.assessment-card {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 32px;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.question-number {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.question-text {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 24px;
  line-height: 1.7;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.option-btn:hover:not([disabled]) {
  border-color: var(--primary-mid);
  background: var(--primary-xlight);
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-xlight);
}

.option-btn.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}

.option-btn.incorrect {
  border-color: var(--danger);
  background: var(--danger-light);
  color: var(--danger);
}

.option-letter {
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 24px;
  color: inherit;
}

.feedback-area {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
}

.feedback-correct {
  background: var(--success-light);
  color: var(--success);
}

.feedback-incorrect {
  background: var(--danger-light);
  color: var(--danger);
}

.feedback-message {
  font-weight: 600;
  margin-bottom: 4px;
}

.feedback-text {
  font-size: 0.875rem;
}

.question-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.submit-card {
  text-align: center;
  padding: 48px 32px;
}

.submit-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 16px;
}

.submit-card h2 {
  margin-bottom: 8px;
}

.submit-card p {
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* 14. Dashboard */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.progress-ring-container {
  position: relative;
  display: inline-block;
}

.progress-ring__bg {
  stroke: var(--gray-200);
}

.progress-ring__fill {
  stroke: var(--primary);
  transition: stroke-dashoffset 0.5s;
}

.progress-ring__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-pct {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.progress-label {
  font-size: 0.7rem;
  color: var(--gray-500);
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-100);
  overflow: hidden;
}

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

.activity-topic {
  font-weight: 500;
  font-size: 0.875rem;
  display: block;
}

.activity-date {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.skill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}

.skill-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.skill-levels {
  display: flex;
  gap: 4px;
}

.skill-dot {
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-400);
  font-weight: 600;
}

.skill-dot.achieved {
  background: var(--primary);
  color: #fff;
}

/* 15. Topic Cards */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.topic-card {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.topic-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
}

.topic-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-item {
  font-size: 0.8rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

.topic-description {
  font-size: 0.82rem;
  color: var(--gray-500);
  line-height: 1.5;
  flex: 1;
}

.topic-card__actions {
  margin-top: auto;
}

.level-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.level-pill--locked    { background:#F1F3F5; color:#868E96; }
.level-pill--unlocked  { background:#E9ECEF; color:#495057; }
.level-pill--progress  { background:#FFF3BF; color:#7D5C00; }
.level-pill--review    { background:#D0EBFF; color:#1864AB; }
.level-pill--passed    { background:#D3F9D8; color:#2B8A3E; }
.level-pill--failed    { background:#FFE3E3; color:#C92A2A; }

/* 16. Skill Matrix Page */
.skill-matrix-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.layer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.layer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.skill-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.skill-matrix-item {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.skill-matrix-item__name {
  font-size: 0.875rem;
  font-weight: 500;
}

.skill-matrix-item__levels {
  display: flex;
  gap: 4px;
}

.level-cell {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 36px;
  text-align: center;
}

.level-cell.achieved {
  background: var(--primary);
  color: #fff;
}
.level-cell-1.achieved { background: #EF4444; color: #fff; }
.level-cell-2.achieved { background: #F59E0B; color: #fff; }
.level-cell-3.achieved { background: #16A34A; color: #fff; }
.level-cell-4.achieved { background: #2563EB; color: #fff; }

.level-cell.next {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.level-cell.locked {
  background: var(--gray-100);
  color: var(--gray-400);
}

.level-icon {
  font-size: 0.75rem;
}

/* 17. Assessor Queue */
.pagination-wrapper {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}

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

.queue-item__info {
  flex: 1;
}

.queue-item__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.queue-worker {
  font-weight: 600;
  font-size: 0.875rem;
  display: block;
}

.queue-topic {
  font-size: 0.8rem;
  color: var(--gray-500);
  display: block;
}

.queue-date {
  font-size: 0.75rem;
  color: var(--gray-400);
  display: block;
}

/* 18. Review Layout */
.review-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.review-evidence {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 12px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-family: inherit;
}

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

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

.tab-panel {
  padding: 20px;
}

.evidence-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.evidence-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}

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

.evidence-question {
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.evidence-answer {
  font-size: 0.875rem;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.answer-correct {
  background: var(--success-light);
}

.answer-incorrect {
  background: var(--danger-light);
}

.evidence-short {
  font-style: italic;
  color: var(--gray-600);
}

.tab-placeholder {
  color: var(--gray-400);
  font-style: italic;
  font-size: 0.875rem;
}

.review-form-panel {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  padding: 24px;
}

.decision-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.rating-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition);
}

.rating-btn.nm {
  color: var(--danger);
}

.rating-btn.nm.selected {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.rating-btn.pm {
  color: var(--warning);
}

.rating-btn.pm.selected {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

.rating-btn.fm {
  color: var(--success);
}

.rating-btn.fm.selected {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.rating-btn:hover {
  opacity: .85;
}

/* 19. Heatmap — proper table */
.heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}

.heatmap-table thead th {
  padding: 10px 8px;
  background: var(--gray-50);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--gray-500);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: center;
  vertical-align: bottom;
  white-space: nowrap;
}

.heatmap-table thead th.heatmap-member-th {
  text-align: left;
  min-width: 140px;
  padding-left: 4px;
  border-right: 1px solid var(--border);
}

.heatmap-table thead th.heatmap-topic-th {
  min-width: 58px;
}

.heatmap-table tbody td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--gray-100);
  text-align: center;
  vertical-align: middle;
}

.heatmap-table tbody td.heatmap-member-td {
  text-align: left;
  padding-left: 4px;
  border-right: 1px solid var(--gray-100);
  font-weight: 500;
  font-size: 0.82rem;
  white-space: nowrap;
  color: var(--gray-800);
}

.heatmap-table tbody td.heatmap-member-td span {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 400;
}

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

.hm-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 26px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
}

.hm-0 {
  background: #FFE4E4;
  color: #991B1B;
}

.hm-1 {
  background: #D6E4F0;
  color: #1F4E79;
}

.hm-2 {
  background: #B5D4F4;
  color: #1F4E79;
}

.hm-3 {
  background: #378ADD;
  color: #fff;
}

.hm-4 {
  background: #1F4E79;
  color: #fff;
}

/* Heatmap legend */
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--gray-600);
}

.legend-swatch {
  width: 20px;
  height: 12px;
  border-radius: 3px;
}

/* 20. Team Page */
.team-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pass-rate-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.pass-rate-pct-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pass-rate-big {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.pass-rate-sym {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-mid);
}

.pass-rate-sub {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.pass-rate-bar-wrap {
  flex: 1;
  min-width: 160px;
}

.pass-rate-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
}

.pass-rate-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width .5s ease;
}

.pass-rate-counts {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.month-filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.month-filter-form label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

.month-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--gray-700);
  background: #fff;
  cursor: pointer;
}

/* Activity status dots */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}

.dot-passed {
  background: var(--success);
}

.dot-failed {
  background: var(--danger);
}

.dot-pending {
  background: var(--warning);
}

.dot-more {
  background: var(--info);
}

/* 21. Team member cards (old team view) */
.team-member-card {
  background: #fff;
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  padding: 16px 20px;
}

.team-member__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.member-name {
  font-size: 1rem;
  font-weight: 600;
}

.member-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.team-member__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.78rem;
}

.skill-pill--achieved {
  background: var(--primary-light);
}

.skill-pill__name {
  font-weight: 500;
  color: var(--gray-700);
}

.skill-pill__none {
  color: var(--gray-400);
}

/* 22. Empty States */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}

.empty-state i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* 23. Utilities */
.text-muted {
  color: var(--gray-400);
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.gap-8 {
  gap: 8px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-400);
  margin-bottom: 10px;
}

/* Mobile hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--gray-100);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--gray-600);
  flex-shrink: 0;
  line-height: 1;
}
.hamburger-btn:hover { background: var(--gray-200); }

/* Sidebar overlay backdrop — hidden on desktop */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 149;
  cursor: pointer;
}
.sidebar-overlay.is-active { display: block; }

/* 24. Responsive */
@media (max-width: 900px) {
  .review-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Show hamburger button */
  .hamburger-btn { display: flex; }

  /* Topbar cleanup */
  .topbar-tagline { display: none; }
  .topbar-center { display: none; }
  .topbar-user-sub { display: none; }

  /* Fix viewport overflow */
  .app-body,
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }

  /* Off-canvas sidebar drawer */
  .app-layout { display: block; position: relative; }
  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: -280px;
    width: 260px;
    height: calc(100vh - var(--topbar-height));
    z-index: 150;
    transition: left 0.25s ease;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }
  .sidebar.is-open { left: 0; }

  /* Main content takes full width */
  .main-content {
    padding: 12px 14px;
    min-height: calc(100vh - var(--topbar-height));
    overflow: visible;
    width: 100%;
  }
  .page-header { flex-wrap: wrap; gap: 8px; }
  .page-title { font-size: 1.1rem; }

  /* Stack all two/three column grids */
  .dashboard-main,
  .two-col,
  .three-col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .review-layout { grid-template-columns: 1fr; }

  /* Matrix rows — tighten columns */
  .matrix-head,
  .matrix-row {
    grid-template-columns: 1fr 56px 90px 40px;
    font-size: 0.78rem;
    gap: 8px;
    padding: 10px 14px;
  }

  /* Queue rows — show avatar + candidate + review button, hide waiting/urgency */
  .queue-head { display: none; }
  .queue-row {
    grid-template-columns: 32px 1fr auto;
    gap: 8px;
    padding: 10px 14px;
  }
  .queue-row > span:nth-child(4),
  .queue-row > span:nth-child(5) { display: none; }

  /* Tap-friendly buttons */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }

  /* Footer in layout — remove negative margins that break mobile */
  .main-content > div:last-child {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
  }
}

@media (max-width: 480px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-user { display: none; }
  .topbar-avatar { width: 30px; height: 30px; font-size: 0.65rem; }

  .main-content { padding: 10px 12px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stats-row .stat { padding: 12px; }
  .stats-row .stat-val { font-size: 20px; }

  .card { border-radius: 8px; }
  .page-header { flex-direction: column; align-items: flex-start; }

  /* Skill matrix — hide progress pips on tiny screens to prevent overflow */
  .matrix-row > div:nth-child(3),
  .matrix-head > span:nth-child(3) { display: none; }
  .matrix-head,
  .matrix-row { grid-template-columns: 1fr 56px 40px; }

  /* Assessment */
  .assessment-main { padding: 16px 12px; }
  .assessment-card { padding: 20px 14px; }
  .assessment-header-inner { padding: 0 12px; gap: 10px; }
  .assessment-title { font-size: 0.8rem; }
  .question-text { font-size: 0.95rem; }

  /* Forms */
  .form-input,
  .form-textarea,
  .form-select { font-size: 1rem; }

  /* Heatmap — ensure horizontal scroll wrapper is obvious */
  .heatmap-wrap { padding: 12px; }
}

/* --- MOCKUP DASHBOARD OVERRIDES --- */
.greeting { margin-bottom: 24px; }
.greeting h1 { font-size: 20px; font-weight: 600; color: var(--gray-900); }
.greeting p { font-size: 14px; color: var(--gray-600); margin-top: 4px; }

.stats-row .stat { 
  background: #ffffff; 
  border: 1px solid var(--gray-200); 
  border-radius: 10px; 
  padding: 16px; 
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  display: block; /* Override previous flex */
}
.stats-row .stat-val { font-size: 26px; font-weight: 600; color: var(--gray-900); line-height: 1; margin-bottom: 6px;}
.stats-row .stat-lbl { font-size: 13px; font-weight: 500; color: var(--gray-600); margin-top: 4px; }
.stats-row .stat-sub { font-size: 12px; margin-top: 4px; font-weight: 500;}

.card { 
  background: #ffffff; border: 1px solid var(--gray-200); 
  border-radius: 10px; margin-bottom: 16px; 
  overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  padding: 0; /* Remove old padding */
}
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 10px; background: #fafafa;}
.card-title { font-size: 14px; font-weight: 600; color: var(--gray-900); text-transform: none; letter-spacing: normal;}
.card-count { font-size: 12px; font-weight: 500; color: var(--gray-600); margin-left: auto; }

.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-bottom: 16px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }

.b-l1 { background: #EF4444; color: #fff; }
.b-l2 { background: #F59E0B; color: #fff; }
.b-l3 { background: #16A34A; color: #fff; }
.b-l4 { background: #2563EB; color: #fff; }
.b-pass { background: #EAF3DE; color: #1D6A39; }
.b-fail { background: #FCEBEB; color: #A32D2D; }
.b-pend { background: #FAEEDA; color: #854F0B; }
.b-info { background: #E6F1FB; color: #185FA5; }

.btn-navy { background: #1F4E79; color: #fff; border-color: #1F4E79; font-size: 12px; padding: 6px 12px; }
.btn-navy:hover { background: #185FA5; color: #fff; text-decoration: none;}

/* skill matrix */
.matrix-row { padding: 12px 18px; border-bottom: 1px solid var(--gray-200); display: grid; grid-template-columns: 1fr 90px 160px 60px; align-items: center; gap: 12px; transition: background 0.15s;}
.matrix-row:last-child { border-bottom: none; }
.matrix-row:hover { background: var(--gray-50); }
.topic-name-sm { font-size: 13px; font-weight: 500; color: var(--gray-900); }
.topic-layer { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.level-track { display: flex; gap: 4px; }
.level-pip { width: 30px; height: 6px; border-radius: 3px; background: var(--gray-200); }
.pip-done { background: #1F4E79; }
.pip-l1.pip-done { background: #EF4444; }
.pip-l2.pip-done { background: #EAB308; }
.pip-l3.pip-done { background: #16A34A; }
.pip-l4.pip-done { background: #2563EB; }
.pip-cur { background: #378ADD; opacity: .8; }
.gap-chip { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 12px; text-align: center; display: inline-block;}
.gap-0 { background: #92ffba; color: #111827; }
.gap-1 { background: #FEE2E2; color: #111827; }
.gap-2 { background: #FCA5A5; color: #111827; }
.gap-3 { background: #ff5959; color: #111827; }
.matrix-head { padding: 10px 18px; background: var(--gray-50); display: grid; grid-template-columns: 1fr 90px 160px 60px; gap: 12px; border-bottom: 1px solid var(--gray-200); }
.matrix-head span { font-size: 11px; font-weight: 600; color: var(--gray-500); letter-spacing: .5px; text-transform: uppercase; }

/* progress ring */
.ring-wrap { display: flex; align-items: center; gap: 18px; padding: 18px; }
.ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; }
.ring-info h3 { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 6px; }
.ring-info p { font-size: 13px; color: var(--gray-600); line-height: 1.5; }

/* activity feed */
.act-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; background: #D1D5DB; }
.act-text { font-size: 13px; color: var(--gray-900); line-height: 1.5; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-text strong { color: #000; }
.act-time { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.act-right { margin-left: auto; flex-shrink: 0; }

/* assessor queue */
.queue-row { padding: 12px 18px; border-bottom: 1px solid var(--gray-200); display: grid; grid-template-columns: 32px 1fr 80px 70px 90px 90px; align-items: center; gap: 12px; transition: background 0.15s;}
.queue-row:last-child { border-bottom: none; }
.queue-row:hover { background: var(--gray-50); }
.queue-head { padding: 10px 18px; background: var(--gray-50); display: grid; grid-template-columns: 32px 1fr 80px 70px 90px 90px; gap: 12px; border-bottom: 1px solid var(--gray-200); }
.queue-av { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.qa-blue { background: #e0f2fe; color: #0369a1; }
.qa-teal { background: #E1F5EE; color: #0F6E56; }
.qa-purple { background: #EEEDFE; color: #534AB7; }
.qa-coral { background: #FAECE7; color: #993C1D; }
.q-name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.q-topic { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.urgency { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 12px; text-align: center;}
.urg-high { background: #FCEBEB; color: #A32D2D; }
.urg-med { background: #FAEEDA; color: #854F0B; }
.urg-low { background: #EAF3DE; color: #1D6A39; }

/* team heat map */
.heatmap-wrap { padding: 16px 18px; overflow-x: auto; }
.heatmap { width: 100%; border-collapse: collapse; }
.heatmap th { font-size: 11px; font-weight: 600; color: var(--gray-500); padding: 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--gray-200);}
.heatmap th.name-col { text-align: left; width: 130px; }
.heatmap td { padding: 8px; text-align: center; border-bottom: 1px solid var(--gray-200);}
.heatmap tr:last-child td { border-bottom: none; }
.heatmap td.name-cell { text-align: left; font-size: 13px; color: var(--gray-900); font-weight: 500; white-space: nowrap; }

/* alert strip */
.alert-strip { border-radius: 6px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; margin: 0 0 16px 0; font-size: 13px; line-height: 1.5;}
.alert-warn { background: #FAEEDA; color: #854F0B; border-left: 4px solid #EF9F27; box-shadow: 0 1px 2px rgba(0,0,0,0.02);}
.alert-info { background: #E6F1FB; color: #185FA5; border-left: 4px solid #378ADD; box-shadow: 0 1px 2px rgba(0,0,0,0.02);}

/* Mobile: wrap queue rows in scroll container via JS-injected class */
@media (max-width: 480px) {
  .queue-row-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Final mobile safety-net rules ── */

/* Prevent any card from overflowing horizontally */
@media (max-width: 768px) {
  /* Cards containing bare data-tables get implicit scroll */
  .card { overflow-x: hidden; }

  /* data-table used without .table-wrapper — add scroll via parent card */
  .card .data-table,
  .card .heatmap-table { min-width: 480px; }
  .card { overflow-x: auto; }

  /* Keep worker dashboard heatmap scrollable */
  .heatmap-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Greeting text wrapping */
  .greeting h1 { font-size: 17px; }
  .greeting p  { font-size: 13px; word-break: break-word; }

  /* Page-actions in header stack below title */
  .page-header { align-items: flex-start; }

  /* Ensure topic grid is always at least 1 column */
  .topics-grid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }

  /* Assessment header — title truncate gracefully */
  .assessment-title { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Skill matrix grid cards min-width */
  .skill-matrix-grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
}

@media (max-width: 480px) {
  /* Stats row wraps at 2 columns regardless of viewport */
  .stats-row { grid-template-columns: 1fr 1fr; }

  /* Auth card full width on tiny screens */
  .auth-card { padding: 24px 20px; }

  /* Assessment card comfortable padding */
  .submit-card { padding: 32px 16px; }

  /* Decision buttons stack on very narrow screens */
  .decision-buttons { flex-direction: column; }
  .rating-btn { width: 100%; }

  /* Pagination wraps */
  .pagination-wrapper { justify-content: center; }
}

/* Override mockup .two-col/.three-col rules (defined further up)
   which would otherwise win over the earlier responsive block */
@media (max-width: 768px) {
  .two-col,
  .three-col { grid-template-columns: 1fr; }
}

/* Sidebar: switch to block layout on mobile so overflow-y:scroll works */
@media (max-width: 768px) {
  .sidebar { display: block !important; overflow-y: scroll; -webkit-overflow-scrolling: touch; }
  .sidebar-footer { margin-top: 0; }
}

/* Fix skill matrix responsive columns — overrides the MOCKUP DASHBOARD OVERRIDES
   section (defined below in source order) which otherwise wins over earlier media queries */
@media (max-width: 768px) {
  .matrix-row  { grid-template-columns: 1fr 56px 90px 40px !important; padding: 10px 14px !important; gap: 8px !important; }
  .matrix-head { grid-template-columns: 1fr 56px 90px 40px !important; padding: 10px 14px !important; gap: 8px !important; }
  .level-pip   { width: 14px !important; }
  .level-track { gap: 2px !important; }
}
@media (max-width: 480px) {
  .matrix-row > div:nth-child(3),
  .matrix-head > span:nth-child(3) { display: none !important; }
  .matrix-row  { grid-template-columns: 1fr 56px 40px !important; }
  .matrix-head { grid-template-columns: 1fr 56px 40px !important; }
}

/* Footer in worker/assessor layout — wrap and shrink on mobile */
@media (max-width: 640px) {
  .main-content > div:last-child {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.65rem !important;
  }
  .main-content > div:last-child img { height: 18px !important; }
}
/* ══ 25. Mobile optimization pass ═════════════════════════════════════════
   Everything below is scoped to max-width media queries and has NO effect
   on desktop. Views annotate inline-styled elements with .m-* utilities. */

@media (max-width: 768px) {
  /* ── Mobile utility classes (inert on desktop) ── */
  .m-stack   { grid-template-columns: 1fr !important; }
  .m-2col    { grid-template-columns: repeat(2, 1fr) !important; }
  .m-wrap    { flex-wrap: wrap !important; }
  .m-col     { flex-direction: column !important; align-items: stretch !important; }
  .m-hide    { display: none !important; }
  .m-full    { width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
  .m-scroll  { overflow-x: auto !important; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .m-pad     { padding: 12px !important; }
  .m-wrap-text { white-space: normal !important; text-align: center; }
  .m-stack > *, .m-2col > * { min-width: 0; }

  /* ── Backstop: no sideways page scroll on phones ── */
  body { overflow-x: hidden; }

  /* ── Topbar: inline styles set height 102px + 150px centered logo ── */
  :root { --topbar-height: 60px; }
  .topbar { height: 60px !important; padding: 0 10px !important; gap: 10px !important; }
  .topbar-logo-link img { height: 48px !important; }
  .topbar-brand img { height: 26px !important; max-width: 100px !important; }
  .topbar-avatar { width: 34px !important; height: 34px !important; font-size: 0.7rem !important; }
  .topbar-right { gap: 8px !important; }
  .hamburger-btn { font-size: 1.5rem !important; }
  .sidebar-collapse-btn { display: none !important; } /* desktop-only control */

  /* ── Wide data tables inside .table-wrapper keep natural width, scroll ── */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrapper table { min-width: 560px; }

  /* Tables inside .m-scroll wrappers keep a readable width and pan */
  .m-scroll > table { min-width: 640px; }
}

@media (max-width: 480px) {
  .topbar-brand { display: none; }         /* company logo — reclaim space */
  .topbar-logo-link img { height: 42px !important; }
  #lang-switcher span, #lang-switcher svg { display: none; } /* flag only */
}

