// ── Dashboard shell ───────────────────────────────────────────────
.aa-dashboard {
  padding: 16px 20px;
  font-family: var(--app-font-family);
  // The app shell's .main wrapper clips overflow instead of scrolling it (see
  // gblayout.component.scss), so nothing below it will ever get its own scrollbar
  // unless this screen is itself bounded to the app's real available height and
  // scrolls internally. --screenheight (window.innerHeight - 160, set in
  // gblayout.component.ts) is the same variable the rest of the app's full-screen
  // views use for this (.FormOverView/.ReportOverView in projects/gbhost/src/styles.scss).
  height: var(--screenheight);
  overflow-y: auto;
  box-sizing: border-box;
}

.aa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.aa-title-block h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #111827);
}

.aa-subtitle {
  font-size: 12px;
  color: var(--text-tertiary, #6b7280);
}

.aa-header-actions {
  display: flex;
  gap: 10px;
}

.btn-start-attempt {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;

  &:hover { background: #15803d; }
}

.btn-record-manual {
  background: none;
  color: var(--text-secondary, #374151);
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;

  &:hover { background: var(--bg-hover, #f3f4f6); }
}

.modal-hint {
  font-size: 12px;
  color: var(--text-tertiary, #6b7280);
  margin: 0 0 12px;
}

// ── Stat tiles ────────────────────────────────────────────────────
.aa-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.aa-stat-tile {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
}

.aa-stat-pending {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;

  &:hover { border-color: #d1d5db; }
}

.aa-stat-tile-active {
  border-color: #7c3aed;
  box-shadow: 0 0 0 1px #7c3aed inset;
}

.aa-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary, #111827);
}

.aa-stat-passed .aa-stat-value { color: #15803d; }
.aa-stat-failed .aa-stat-value { color: #b91c1c; }
.aa-stat-progress .aa-stat-value { color: #b45309; }
.aa-stat-pending .aa-stat-value { color: #7c3aed; }

.aa-stat-label {
  font-size: 11px;
  color: var(--text-tertiary, #6b7280);
  margin-top: 2px;
}

.pending-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: #f3e8ff;
  color: #7c3aed;
  white-space: nowrap;
}

// ── Filters ───────────────────────────────────────────────────────
.aa-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  font-size: 13px;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  font-size: 13px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--bg-page, #f3f4f6);
  color: var(--text-secondary, #374151);
  font-size: 12px;
  white-space: nowrap;
}

.filter-chip-clear {
  border: none;
  background: none;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  padding: 0;

  &:hover { text-decoration: underline; }
}

// ── Table ─────────────────────────────────────────────────────────
.aa-table-wrap {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
}

.aa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;

  th {
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-tertiary, #6b7280);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-default, #e5e7eb);
  }

  td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-default, #f3f4f6);
    vertical-align: middle;
  }
}

.aa-row-clickable {
  cursor: pointer;

  &:hover { background: var(--bg-page, #f9fafb); }
}

.emp-name, .assess-title {
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.emp-sub, .assess-sub {
  font-size: 11px;
  color: var(--text-tertiary, #9ca3af);
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg-page, #f3f4f6);
  color: var(--text-secondary, #374151);

  &.status-passed { background: #dcfce7; color: #15803d; }
  &.status-failed { background: #fee2e2; color: #b91c1c; }
  &.status-inprogress { background: #fef3c7; color: #92400e; }
  &.status-notstarted { background: #f3f4f6; color: #6b7280; }
}

.lms-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;

  &.lms-synced { background: #dbeafe; color: #1d4ed8; }
  &.lms-pending { background: #f3f4f6; color: #6b7280; }
}

.td-actions {
  display: flex;
  gap: 6px;
}

.btn-open, .btn-delete {
  border: 1px solid var(--border-default, #d1d5db);
  background: #fff;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  mat-icon { font-size: 16px; width: 16px; height: 16px; }
}

.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-tertiary, #9ca3af);
}

// ── Modal (reused pattern from questionbank.component.scss) ─────────
.modal {
  display: none; position: fixed; z-index: 999; padding-top: 60px;
  left: 0; top: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}
.modal-content-wrapper { display: flex; justify-content: center; }
.modal-content {
  background-color: #fefefe; margin: auto; padding: 0;
  border: 1px solid #888; width: 600px; min-height: 200px; border-radius: 8px;
  max-height: calc(100vh - 80px); overflow-y: auto; box-sizing: border-box;
}
.titlecontainer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 21px; margin-bottom: 0;
  position: sticky; top: 0; z-index: 1;
  background: #fefefe; border-bottom: 1px solid #e5e5e5;
}
.buttfilter { font-weight: 700; font-size: 18px; margin: 0; color: #333333; }
.closeicon {
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.3s ease;
  mat-icon { width: 27px; height: 27px; font-size: 27px; color: #666666; }
  &:hover { transform: scale(1.1); mat-icon { color: #333333; } }
}
.modal-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 21px 21px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.btn-cancel {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border-default, #d1d5db);
  background: #fff;
  cursor: pointer;
}

.btn-confirm-start {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: #16a34a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;

  &:disabled { opacity: 0.6; cursor: not-allowed; }
}

// ── Send via FLS modal ─────────────────────────────────────────────
.fls-email-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default, #d1d5db);
  font-size: 13px;
}

.fls-result-panel {
  background: var(--bg-hover, #f3f4f6);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 8px;
  padding: 14px 16px;
}

.fls-result-label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-secondary, #374151);
}

.fls-token {
  display: block;
  word-break: break-all;
  background: #fff;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: 'SFMono-Regular', Consolas, monospace;
}
