* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:host {
  display: block;
  // 100vh (not 100%) on purpose — this component is hosted inside a tab/portlet
  // panel whose own height isn't guaranteed to cascade "height:100%" down through
  // every ancestor. vh always resolves to a real value, which is what actually
  // gives .content's `overflow-y: auto` something bounded to scroll within.
  height: 100vh;
  width: 100%;
  overflow: hidden;
  font-family: var(--app-font-family);
  background: #f5f5fa;
  color: var(--text-primary, #1d2939);
  font-size: 13px;
}

.tpd {
  height: 100%;
  display: flex;
  flex-direction: column;
}

mat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===================================
   HEADER
=================================== */

.topbar {
  flex-shrink: 0;
  z-index: 20;

  background: linear-gradient(90deg, var(--button-primary-bg-default, #834dd0) 0%, var(--button-primary-bg-active, #6f3eb4) 100%);
  color: var(--button-primary-text-default, #fff);

  display: flex;
  align-items: center;
  gap: 10px;

  // Kept compact on purpose — the page-header below already carries the real
  // title ("Associate Training — Plan vs Actual"); this bar is just a thin
  // app-identity strip, not a second full title block.
  padding: 8px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);

  .logo {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;

    .logo-icon {
      display: flex;
      align-items: center;
      justify-content: center;

      width: 26px;
      height: 26px;
      border-radius: 7px;

      background: rgba(255, 255, 255, 0.18);

      mat-icon {
        font-size: 15px;
        width: 15px;
        height: 15px;
      }
    }
  }
}

/* ===================================
   CONTENT
=================================== */

.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  padding: 14px 24px 24px;
  width: 100%;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  margin-bottom: 10px;

  h1 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-primary, #1d2939);
  }

  p {
    font-size: 11px;
    color: var(--text-tertiary, #667085);
  }
}

.plan-breadcrumb {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--button-primary-bg-default, #834dd0);
  margin-bottom: 6px;
}

.domain-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #edf1f5);
  border-radius: 14px;

  padding: 64px 24px;
  text-align: center;

  .domain-gate-icon {
    font-size: 30px;
    width: 30px;
    height: 30px;
    color: var(--button-primary-bg-default, #834dd0);
    margin-bottom: 6px;
  }

  h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary, #1d2939);
  }

  p {
    font-size: 12px;
    color: var(--text-tertiary, #667085);
    margin-bottom: 18px;
  }

  .filter-picklist {
    min-width: 280px;
  }
}

.badge-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-default, #d0d5dd);
  background: var(--bg-surface, #fff);

  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #344054);
  white-space: nowrap;

  mat-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
  }
}

/* ===================================
   SUMMARY TILES
=================================== */

.summary-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.tpd-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.summary-tile {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #edf1f5);
  border-radius: 10px;

  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

  &.tile-alert {
    border-color: var(--status-warning-error, #d97706);
    background: var(--status-warning-bg, #fffbeb);
  }

  .tile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2px;
  }

  h2 {
    font-size: 21px;
    font-weight: 700;
    line-height: 1;

    &.green { color: var(--status-success-text, #12b76a); }
    &.orange { color: var(--status-warning-error, #d97706); }
    &.blue { color: var(--category-text-alpha, #2563eb); }
    &.purple { color: var(--button-primary-bg-default, #7c3aed); }
  }

  .tile-icon {
    flex-shrink: 0;

    width: 26px;
    height: 26px;
    border-radius: 7px;

    display: flex;
    align-items: center;
    justify-content: center;

    mat-icon {
      font-size: 14px;
      width: 14px;
      height: 14px;
    }

    &.icon-green { background: var(--badge-success, #d1fae5); color: var(--status-success-text, #12b76a); }
    &.icon-orange { background: var(--badge-warning, #fef3c7); color: var(--status-warning-error, #d97706); }
    &.icon-blue { background: var(--category-bg-alpha, #eaf0ff); color: var(--category-text-alpha, #2563eb); }
    &.icon-purple { background: var(--bg-selected, #f4effe); color: var(--button-primary-bg-default, #7c3aed); }
  }

  span {
    font-size: 11px;
    color: var(--text-tertiary, #667085);
  }

  .tile-hint {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: var(--text-disabled, #b0b7c3);
  }
}

.tpd-hero-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===================================
   QUICK STAT PILLS
=================================== */

.quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-default, #d0d5dd);
  background: var(--bg-surface, #fff);

  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #1d2939);

  em {
    font-style: normal;
    font-weight: 500;
    color: var(--text-tertiary, #667085);
    margin-left: 2px;
  }
}

/* ===================================
   TAB NAV
=================================== */

.tab-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;

  background: var(--bg-subtle, #f4f5f7);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 10px;
}

.tab-btn {
  border: none;
  background: none;
  cursor: pointer;

  padding: 6px 14px;
  border-radius: 8px;

  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #344054);
  white-space: nowrap;

  &:hover { color: var(--text-primary, #1d2939); }

  &.active {
    background: var(--text-primary, #1d2939);
    color: #fff;
  }
}

/* ===================================
   LEGEND
=================================== */

.legend-panel {
  padding: 16px 20px;
}

.legend-title {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-tertiary, #8b97a7);
  margin-bottom: 12px;
}

.legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.legend-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 28px;

  @media (max-width: 560px) {
    grid-template-columns: 1fr;
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-label {
  font-weight: 500;
  color: var(--text-secondary, #344054);
}

.legend-days {
  font-size: 11px;
  color: var(--text-tertiary, #98a2b3);
}

.legend-swatch {
  width: 18px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;

  &.hatched {
    background-image: repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.6) 0,
      rgba(255, 255, 255, 0.6) 2px,
      transparent 2px,
      transparent 5px
    );
  }

  &.dotted {
    background-image: radial-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px);
    background-size: 5px 5px;
  }

  &.planned-swatch {
    background: var(--bg-surface, #fff);
    border: 1.5px dashed var(--border-default, #b0b7c3);
  }

  &.actual-swatch {
    background: #14b8a6;
  }

  &.delay-swatch {
    background: #ef4444;
  }

  &.retraining-swatch {
    background: #7c3aed;
  }
}

.legend-divider {
  height: 1px;
  background: var(--border-subtle, #edf1f5);
  margin: 12px 0;
}

/* ===================================
   FILTERS
=================================== */

.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.search-box {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 8px;

  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-default, #d0d5dd);
  border-radius: 8px;
  padding: 8px 12px;

  mat-icon {
    font-size: 17px;
    width: 17px;
    height: 17px;
    color: var(--text-tertiary, #98a2b3);
  }

  input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 12px;
    background: transparent;
    color: var(--text-primary, #1d2939);

    &::placeholder {
      color: var(--text-disabled, #b0b7c3);
    }
  }
}

.filter-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default, #d0d5dd);
  background: var(--bg-surface, #fff);
  font-size: 12px;
  color: var(--text-secondary, #344054);
  cursor: pointer;
}

.filter-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary, #98a2b3);
  white-space: nowrap;
}

.filter-picklist {
  display: inline-block;
  min-width: 220px;
}

/* ===================================
   PANELS
=================================== */

.panel {
  background: var(--bg-surface, #fff);
  border-radius: 14px;
  padding: 20px;

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 18px;

  h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1d2939);
  }
}

.panel-subtitle {
  font-size: 11px;
  color: var(--text-tertiary, #98a2b3);
  margin-top: 2px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;

  margin-bottom: 14px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;

  .panel { margin-bottom: 0; }
}

/* ===================================
   ENROLLMENT FUNNEL
=================================== */

.funnel-row {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  align-items: center;
  gap: 12px;

  padding: 8px 0;
}

.funnel-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #344054);
}

.funnel-track {
  height: 10px;
  border-radius: 20px;
  background: var(--bg-muted, #e4e7ec);
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--button-primary-bg-default, #834dd0), #14b8a6);
}

.funnel-value {
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: var(--text-primary, #1d2939);
}

.funnel-total {
  margin-top: 10px;
  text-align: right;
  font-size: 11px;
  color: var(--text-tertiary, #98a2b3);
}

.type-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.score-pass {
  color: var(--status-success-text, #12b76a);
  font-weight: 700;
}

/* ===================================
   DATA TABLE
=================================== */

.data-table {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #e8eaef);
  border-radius: 12px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

.data-table table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--table-header-bg, #fafbfc);
}

.data-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-tertiary, #8b97a7);
  font-weight: 700;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-top: 1px solid var(--table-border, #edf1f5);
  font-size: 13px;
  vertical-align: middle;

  h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary, #1d2939);
  }

  .muted {
    font-size: 11px;
    color: var(--text-tertiary, #98a2b3);
  }
}

.data-table tbody tr:hover {
  background: var(--bg-hover, #fafcff);
}

.cell-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;

  &.inline {
    display: inline-flex;
    color: var(--text-secondary, #344054);
  }

  .row-icon {
    flex-shrink: 0;

    width: 34px;
    height: 34px;
    border-radius: 9px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, var(--button-primary-bg-default, #834dd0), var(--button-primary-bg-active, #6f3eb4));
    color: #fff;

    mat-icon {
      font-size: 17px;
      width: 17px;
      height: 17px;
    }
  }
}

.muted-icon {
  font-size: 14px !important;
  width: 14px !important;
  height: 14px !important;
  color: var(--text-tertiary, #98a2b3);
  margin-right: 2px;
}

.score-cell {
  display: flex;
  align-items: center;
  gap: 10px;

  strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary, #1d2939);
    white-space: nowrap;
  }
}

.score-bar {
  width: 72px;
  height: 6px;
  flex-shrink: 0;

  background: var(--bg-muted, #e4e7ec);
  border-radius: 20px;
  overflow: hidden;

  .fill {
    height: 100%;

    &.good {
      background: linear-gradient(90deg, var(--button-primary-bg-default, #834dd0), #14b8a6);
    }

    &.bad {
      background: var(--border-error, #ef4444);
    }
  }
}

/* ===================================
   PILLS / STATUS
=================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 3px 10px;
  border-radius: 16px;

  font-size: 11px;
  font-weight: 600;

  &.active {
    background: var(--badge-success, #d1fae5);
    color: var(--status-success-text, #047857);
  }

  &.expired {
    background: var(--badge-error, #fee2e2);
    color: var(--status-error-text, #b91c1c);
  }

  &.notdone {
    background: var(--bg-subtle, #f4f5f7);
    color: var(--text-tertiary, #7b8794);
  }

  &.warn {
    background: var(--badge-warning, #fef3c7);
    color: var(--status-warning-error, #d97706);
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;

  &.st-draft {
    background: var(--bg-subtle, #f4f5f7);
    color: var(--text-tertiary, #7b8794);
  }

  &.st-open, &.st-scheduled {
    background: var(--bg-selected, #f4effe);
    color: var(--text-link, #834dd0);
  }

  &.st-progress {
    background: var(--badge-warning, #fef3c7);
    color: var(--status-warning-error, #d97706);
  }

  &.st-completed {
    background: var(--badge-success, #d1fae5);
    color: var(--status-success-text, #047857);
  }

  &.st-closed, &.st-postponed {
    background: var(--category-bg-alpha, #eaf0ff);
    color: var(--category-text-alpha, #2563eb);
  }

  &.st-cancelled {
    background: var(--badge-error, #fee2e2);
    color: var(--status-error-text, #b91c1c);
  }

  &.pr-low {
    background: var(--bg-subtle, #f4f5f7);
    color: var(--text-tertiary, #7b8794);
  }

  &.pr-medium {
    background: var(--bg-selected, #f4effe);
    color: var(--text-link, #834dd0);
  }

  &.pr-high {
    background: var(--badge-warning, #fef3c7);
    color: var(--status-warning-error, #d97706);
  }

  &.pr-critical {
    background: var(--badge-error, #fee2e2);
    color: var(--status-error-text, #b91c1c);
  }
}

/* ===================================
   CERT / TRAINER ROWS
=================================== */

.cert-row {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  border-bottom: 1px solid var(--border-subtle, #edf1f5);

  transition: background 0.15s ease;

  &:hover {
    background: var(--bg-hover, #f9fafb);
  }

  &:last-of-type {
    border-bottom: none;
  }

  .cert-icon {
    flex-shrink: 0;

    width: 40px;
    height: 40px;
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(135deg, var(--button-primary-bg-default, #834dd0), var(--button-primary-bg-active, #6f3eb4));
    color: #fff;

    mat-icon {
      font-size: 19px;
      width: 19px;
      height: 19px;
    }
  }

  .cert-info {
    flex: 1;
    min-width: 0;

    h4 {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 2px;
      color: var(--text-primary, #1d2939);
    }

    span {
      font-size: 11px;
      color: var(--text-tertiary, #98a2b3);
    }
  }

  .cert-status {
    text-align: right;
    flex-shrink: 0;

    .valid-until {
      display: block;
      font-size: 11px;
      color: var(--text-tertiary, #98a2b3);
      margin-top: 4px;
    }
  }
}

/* ===================================
   GANTT
=================================== */

.gantt-panel {
  padding: 0;
  overflow: hidden;
}

.gantt-table {
  display: flex;
  flex-direction: column;
}

.gantt-header-row,
.gantt-body-row {
  display: flex;
  border-bottom: 1px solid var(--table-border, #edf1f5);
}

.gantt-header-row {
  background: var(--table-header-bg, #fafbfc);
  position: sticky;
  top: 0;
  z-index: 3;
}

.gantt-name-col {
  width: 240px;
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--bg-surface, #fff);
}

.gantt-rowlabel-col {
  width: 56px;
  flex-shrink: 0;
  padding: 8px 10px;
  background: var(--bg-surface, #fff);
  display: flex;
  flex-direction: column;
}

.gantt-rowlabel {
  height: 24px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--text-tertiary, #8b97a7);

  &:last-child { margin-bottom: 0; }
}

.gantt-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid var(--table-border, #edf1f5);
}

.gantt-rowlabel-col.gantt-sticky {
  left: 240px;
}

.gantt-name-head {
  display: flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-tertiary, #8b97a7);
  background: var(--table-header-bg, #fafbfc);
}

.gantt-rowlabel-head {
  background: var(--table-header-bg, #fafbfc);
}

.gantt-months {
  display: flex;
}

.gantt-month-col {
  flex-shrink: 0;
  padding: 8px 0 6px;
  text-align: center;
  border-left: 1px solid var(--table-border, #edf1f5);
}

.gantt-month-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--text-tertiary, #8b97a7);
  margin-bottom: 4px;
}

.gantt-week-ticks {
  display: flex;
}

.gantt-week-tick {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-disabled, #b0b7c3);
  border-left: 1px dashed var(--table-border, #edf1f5);

  &:first-child { border-left: none; }
}

.gantt-week-grid-col {
  border-left: 1px dashed var(--table-border, #edf1f5);

  &:nth-child(4n + 1) {
    border-left: 1px solid var(--table-border, #edf1f5);
  }

  &:first-child {
    border-left: none;
  }
}

.gantt-name-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.gantt-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1d2939);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-name-sub {
  font-size: 11px;
  color: var(--text-tertiary, #98a2b3);
  margin-bottom: 6px;
  white-space: nowrap;
}

.gantt-progress {
  width: 100%;
}

.gantt-lanes {
  position: relative;
  flex-shrink: 0;
  padding: 8px 0;
}

.gantt-grid-lines {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 0;
}

.gantt-grid-col {
  flex-shrink: 0;
  height: 100%;
  border-left: 1px solid var(--table-border, #edf1f5);

  &:first-child {
    border-left: none;
  }
}

.gantt-lane {
  position: relative;
  height: 24px;
  margin-bottom: 4px;

  &:last-child {
    margin-bottom: 0;
  }
}

.gantt-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;

  z-index: 1;

  &.gantt-bar-clickable {
    cursor: pointer;
    transition: filter 0.1s, box-shadow 0.1s;

    &:hover {
      filter: brightness(0.92);
      box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25) inset;
    }
  }

  &.hatched {
    background-image: repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.35) 0,
      rgba(255, 255, 255, 0.35) 3px,
      transparent 3px,
      transparent 7px
    );
  }

  &.dotted {
    background-image: radial-gradient(rgba(255, 255, 255, 0.6) 1.2px, transparent 1.2px);
    background-size: 6px 6px;
  }
}

.gantt-actual-bar {
  background: #14b8a6;

  &.retraining {
    background: #7c3aed;
  }

  &.delay {
    background: #ef4444;
  }
}

/* ===================================
   ASSOCIATES NEEDING ATTENTION
=================================== */

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.attention-card {
  background: var(--bg-subtle, #fafafa);
  border: 1px solid var(--border-subtle, #edf1f5);
  border-radius: 10px;
  padding: 14px 16px;
}

.attention-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;

  h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #1d2939);
  }
}

.attention-msg {
  font-size: 11px;
  color: var(--text-tertiary, #667085);
  margin-top: 8px;
}

/* ===================================
   TRAINER CARDS
=================================== */

.trainer-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.trainer-card {
  background: var(--bg-subtle, #fafafa);
  border: 1px solid var(--border-subtle, #edf1f5);
  border-radius: 10px;
  padding: 16px;
}

.trainer-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.trainer-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #1d2939);
}

.trainer-sub {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary, #98a2b3);
  margin-bottom: 14px;
}

.trainer-stats {
  display: flex;
  gap: 16px;
}

.trainer-stat {
  display: flex;
  flex-direction: column;

  strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1d2939);
  }

  span {
    font-size: 10px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-tertiary, #98a2b3);
  }
}

.btn-edit-card {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-default, #d0d5dd);
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #344054);
  cursor: pointer;

  mat-icon { font-size: 14px; width: 14px; height: 14px; }
  &:hover { background: var(--bg-hover, #f9fafb); }
}

.btn-edit-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default, #d0d5dd);
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #344054);
  cursor: pointer;
  white-space: nowrap;

  mat-icon { font-size: 14px; width: 14px; height: 14px; }
  &:hover { background: var(--bg-hover, #f9fafb); }
}

/* ===================================
   TRAINING NEED CARDS
=================================== */

.need-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;

  @media (max-width: 720px) {
    grid-template-columns: 1fr;
  }
}

.need-card {
  background: var(--bg-subtle, #fafafa);
  border: 1px solid var(--border-subtle, #edf1f5);
  border-radius: 10px;
  padding: 16px;
}

.need-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;

  h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #1d2939);
  }
}

.need-desc {
  font-size: 12px;
  color: var(--text-secondary, #344054);
  margin: 8px 0;
}

.need-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.priority-dots {
  display: flex;
  align-items: center;
  gap: 5px;

  span:first-child {
    font-size: 10px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-tertiary, #98a2b3);
    margin-right: 2px;
  }

  .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg-muted, #e4e7ec);

    &.filled {
      background: var(--status-error-text, #d92d20);
    }
  }
}

.need-deadline {
  font-size: 11px;
  color: var(--text-tertiary, #98a2b3);
  white-space: nowrap;

  &.overdue {
    color: var(--status-error-text, #b91c1c);
    font-weight: 600;
  }
}

/* ===================================
   EMPTY STATE
=================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  color: var(--text-tertiary, #98a2b3);
  font-size: 12px;
  padding: 32px 24px;
  text-align: center;

  .empty-icon {
    font-size: 26px;
    width: 26px;
    height: 26px;
  }
}

/* ===================================
   RESPONSIVE
=================================== */

@media (max-width: 992px) {
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 20px 16px;
  }
}

@media (max-width: 680px) {
  .data-table table {
    min-width: 0;
  }

  .table-scroll {
    overflow-x: visible;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    display: block;
    padding: 12px 16px;
    border-top: 1px solid var(--table-border, #edf1f5);

    &:first-child {
      border-top: none;
    }
  }

  .data-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    border-top: none;
    padding: 6px 0;
    text-align: right;

    &::before {
      content: attr(data-label);

      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .4px;
      color: var(--text-tertiary, #8b97a7);
      text-align: left;
    }

    h4, .muted {
      text-align: right;
    }

    .cell-with-icon {
      flex-direction: row-reverse;
    }
  }

  .funnel-row {
    grid-template-columns: 110px 1fr 30px;
  }
}

// ── Bulk Import ───────────────────────────────────────────────────────────

.btn-bulk-import {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-default, #d0d5dd);
  background: var(--bg-surface, #fff);
  color: var(--text-secondary, #344054);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  &:hover { background: var(--bg-hover, #f9fafb); }
  &:disabled { opacity: 0.5; cursor: not-allowed; }
}
.btn-bulk-import-primary {
  background: var(--button-primary-bg-default);
  color: var(--button-primary-text-default);
  border-color: var(--button-primary-border-default);
  &:hover:not(:disabled) { background: var(--button-primary-bg-hover); }
}

.bi-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
}

.bi-modal-content {
  background: var(--bg-surface);
  border-radius: 10px;
  width: min(1000px, 95vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.bi-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--table-border);
}
.bi-modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.bi-close-icon { cursor: pointer; color: var(--text-tertiary); &:hover { color: var(--text-primary); } }

.bi-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }

.bi-desc { margin: 0 0 16px; font-size: 13px; color: var(--text-tertiary); }

.bi-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bi-upload-label { margin: 0; display: inline-flex; align-items: center; cursor: pointer; }
.bi-filename { font-size: 12px; color: var(--text-tertiary); }

.bi-hints {
  background: var(--bg-muted); border-radius: 8px; padding: 12px 16px; font-size: 13px; margin-bottom: 14px;
  p { margin: 0 0 6px; font-weight: 600; color: var(--text-primary); }
  ul { margin: 0; padding-left: 18px; color: var(--text-secondary); }
  li { margin-bottom: 2px; }
}
.bi-hints-error { background: var(--status-error-bg); color: var(--status-error-text); a { color: var(--status-error-text); text-decoration: underline; } }
.bi-required { color: var(--status-error-text); font-weight: 700; }
.bi-hint { color: var(--text-tertiary); }
.bi-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.bi-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.bi-chip {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
  background: var(--bg-muted); color: var(--text-secondary);
  &.bi-chip-warn  { background: var(--status-warning-bg, #fdf3d8); color: var(--status-warning-text, #b8860b); }
  &.bi-chip-ok    { background: var(--category-bg-alpha); color: var(--category-text-alpha); }
  &.bi-chip-error { background: var(--status-error-bg); color: var(--status-error-text); }
}
.bi-progress { font-size: 12px; color: var(--text-tertiary); }

.bi-table-wrap { max-height: 40vh; overflow: auto; border: 1px solid var(--table-border); border-radius: 8px; margin-bottom: 14px; }
.bi-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  thead tr { border-bottom: 1px solid var(--table-border); }
  th {
    padding: 8px 10px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
    color: var(--table-text-header); background: var(--table-header-bg);
    white-space: nowrap; position: sticky; top: 0;
  }
  td { padding: 6px 10px; vertical-align: top; color: var(--table-text-body); white-space: nowrap; }
  tr.bi-row-invalid td { background: var(--status-error-bg); }
  tr.bi-row-error td   { background: var(--status-error-bg); }
  tr.bi-row-success td { background: var(--category-bg-alpha); }
}

.bi-status-cell { white-space: normal; min-width: 140px; }
.bi-status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  &.bi-status-pending  { background: var(--bg-muted); color: var(--text-secondary); }
  &.bi-status-invalid  { background: var(--status-error-bg); color: var(--status-error-text); }
  &.bi-status-success  { background: var(--category-bg-alpha); color: var(--category-text-alpha); }
  &.bi-status-error    { background: var(--status-error-bg); color: var(--status-error-text); }
}
.bi-row-msg { font-size: 11px; color: var(--status-error-text); margin-top: 2px; }

.bi-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--table-border);
}
