/*
 * Modern content patterns for the faculty admin surfaces. The shell styles
 * live in base.css and components.css; these are the page content primitives
 * described in the students/admin refresh plan.
 */

.tb-page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: 1.5rem;
}

.tb-page__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tb-page__title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--tb-heading);
}

.tb-page__subtitle {
  margin: 0.35rem 0 0;
  color: var(--tb-text-muted);
}

.tb-page__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tb-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--tb-surface);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
}

.tb-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.tb-filter-field > label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tb-text-muted);
  white-space: normal;
}

.tb-filter-bar--six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 1500px) {
  .tb-filter-bar--six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.tb-filter-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.tb-filter-bar__actions .btn {
  white-space: nowrap;
  flex: 0 0 auto;
}

.tb-surface {
  padding: 1rem 1.25rem;
  background: var(--tb-surface);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
}

.tb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tb-toolbar__meta {
  color: var(--tb-text-muted);
  font-size: 0.9rem;
}

.tb-toolbar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tb-table {
  width: 100%;
  color: var(--tb-text);
  border-collapse: collapse;
}

.tb-table > thead th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tb-text-muted);
  background: var(--tb-surface-alt);
  border-bottom: 1px solid var(--tb-border-strong);
}

.tb-table > tbody > tr > td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: middle;
}

.tb-table--sticky > thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.tb-table-scroll {
  max-height: 68vh;
  overflow: auto;
}

.tb-table__identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.tb-monogram {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--tb-primary);
  color: var(--tb-primary-fg);
}

.tb-table__name {
  font-weight: 600;
  color: var(--tb-heading);
}

.tb-table__meta {
  display: block;
  font-size: 0.78rem;
  color: var(--tb-text-muted);
}

.tb-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.tb-status--success {
  background: var(--tb-success-bg);
  color: var(--tb-success-text, var(--tb-success));
  border-color: var(--tb-success-border, transparent);
}

.tb-status--warning {
  background: var(--tb-warning-bg);
  color: var(--tb-warning-text, var(--tb-warning));
  border-color: var(--tb-warning-border, transparent);
}

.tb-status--danger {
  background: var(--tb-danger-bg);
  color: var(--tb-danger-text, var(--tb-danger));
  border-color: var(--tb-danger-border, transparent);
}

.tb-status--info {
  background: var(--tb-info-bg);
  color: var(--tb-info-text, var(--tb-info));
  border-color: var(--tb-info-border, transparent);
}

.tb-status--neutral {
  background: var(--tb-neutral-bg, var(--tb-surface-alt));
  color: var(--tb-neutral-text, var(--tb-text-muted));
  border-color: var(--tb-neutral-border, var(--tb-border));
}

.tb-row-open {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius-sm);
  background: var(--tb-surface-alt);
  color: var(--tb-link);
  font-size: 0.82rem;
  text-decoration: none;
}

.tb-row-open:hover,
.tb-row-open:focus {
  color: var(--tb-link);
  background: var(--tb-table-hover-bg);
}

.tb-row-actions {
  display: flex;
  gap: 0.3rem;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.tb-row-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
}

.tb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--tb-text-muted);
}

.tb-empty__icon {
  font-size: 1.75rem;
  opacity: 0.7;
}

.tb-empty__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tb-heading);
}

.tb-empty__body {
  max-width: 42ch;
}

.tb-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
}

.tb-form-grid > label {
  margin: 0 0 -0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tb-text-muted);
}

.tb-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.tb-form-field > label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tb-text-muted);
}

.tb-form-field--full {
  grid-column: 1 / -1;
}

.tb-subtabs {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--tb-border);
}

.tb-subtabs .nav-link {
  border: 1px solid transparent;
  border-radius: var(--tb-radius-sm) var(--tb-radius-sm) 0 0;
  color: var(--tb-text-muted);
}

.tb-subtabs .nav-link:hover,
.tb-subtabs .nav-link:focus {
  border-color: var(--tb-border) var(--tb-border) transparent;
  color: var(--tb-heading);
}

.tb-subtabs .nav-link.active {
  background: var(--tb-surface);
  border-color: var(--tb-border) var(--tb-border) var(--tb-surface);
  color: var(--tb-heading);
}

@media (max-width: 991.98px) {
  .tb-page__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tb-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .tb-filter-bar {
    grid-template-columns: 1fr;
  }

  .tb-filter-bar__actions {
    justify-content: stretch;
  }

  .tb-filter-bar__actions .btn {
    flex: 1 1 auto;
  }

  .tb-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .tb-table--cards thead {
    display: none;
  }

  .tb-table--cards tbody tr {
    display: block;
    margin-bottom: 0.6rem;
    padding: 0.4rem 0.6rem;
    background: var(--tb-surface);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-sm);
  }

  .tb-table--cards tbody td {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.3rem 0;
    border: 0;
  }

  .tb-table--cards tbody td::before {
    content: attr(data-label);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--tb-text-muted);
  }

  .tb-table--cards tbody td[data-label=""]::before {
    content: none;
  }
}

/* Control Center activity: statistics blocks and the account profile modal. */

.CcActivityTable td,
.CcActivityTable th {
  vertical-align: middle;
}

.CcActivityTable td,
.CcActivityTable th {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.CcActivityTable th {
  white-space: nowrap;
}

.CcActivityTable .tb-table__meta {
  font-size: 0.78rem;
}

.cc-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cc-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  background: var(--tb-surface);
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
}

.cc-kpi__value {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--tb-heading);
}

.cc-kpi__label {
  font-size: 0.82rem;
  color: var(--tb-text-muted);
}

.cc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.cc-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tb-text-muted);
}

.cc-bar {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-size: 0.82rem;
}

.cc-bar__label {
  color: var(--tb-text-muted);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cc-bar__track {
  height: 8px;
  background: var(--tb-surface-alt);
  border: 1px solid var(--tb-border);
  border-radius: 999px;
  overflow: hidden;
}

.cc-bar__fill {
  display: block;
  height: 100%;
  background: var(--tb-accent);
  border-radius: 999px;
}

.cc-bar__value {
  min-width: 5.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--tb-text);
}

.cc-bar__value span {
  margin-left: 0.35rem;
  color: var(--tb-text-muted);
}

.cc-facts {
  margin: 0;
}

.cc-facts > div,
.cc-facts > li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--tb-border);
  font-size: 0.85rem;
}

.cc-facts > div:last-child,
.cc-facts > li:last-child {
  border-bottom: 0;
}

.cc-facts dt {
  margin: 0;
  color: var(--tb-text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.cc-facts dd {
  margin: 0;
  text-align: right;
  color: var(--tb-text);
  word-break: break-word;
}

.cc-facts--plain {
  padding-left: 0;
  list-style: none;
}

.cc-facts--plain > li {
  display: block;
  text-align: left;
}

.cc-profile.modal-dialog {
  max-width: min(1500px, 94vw);
  width: min(1500px, 94vw);
}

.cc-profile .modal-body {
  padding: 1.25rem;
}

.cc-profile__identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0 0 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--tb-border);
}

.cc-profile__monogram {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 600;
  background: var(--tb-primary);
  color: var(--tb-primary-fg);
}

.cc-profile__heading {
  flex: 1 1 240px;
  min-width: 0;
}

.cc-profile__name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--tb-heading);
}

.cc-profile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--tb-text-muted);
}

.cc-profile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cc-profile__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .cc-grid,
  .cc-profile__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .cc-profile.modal-dialog {
    max-width: 100vw;
    width: 100vw;
    margin: 0;
  }

  .cc-bar {
    grid-template-columns: 5rem minmax(0, 1fr) auto;
  }

  .cc-bar__value {
    min-width: 4.5rem;
  }
}
