/* Production-only admin dashboard refinement. Loaded after the main app stylesheet. */
main.app-shell.staff-shell:has(.admin-layout) {
  width: min(calc(100% - 32px), 1400px);
  max-width: 1400px;
  padding-bottom: 48px;
}

.staff-shell .admin-layout {
  gap: 20px;
}

.staff-shell .admin-workspace-header {
  padding: 4px 2px 0;
}

.staff-shell .admin-workspace-header h2 {
  margin: 4px 0 6px;
  color: #123f68;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  line-height: 1.35;
}

.staff-shell .admin-workspace-header p {
  margin: 0;
  color: #607a94;
  font-size: 1rem;
  line-height: 1.8;
}

.staff-shell .admin-section-tabs {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border: 1px solid #d9e6f2;
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: 0 8px 20px rgba(13, 59, 102, 0.06);
}

.staff-shell .admin-section-tabs button {
  min-width: 0;
  min-height: 48px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.staff-shell .admin-section-tabs button:focus-visible,
.staff-shell .row-actions button:focus-visible,
.staff-shell .catalog-actions button:focus-visible {
  outline: 3px solid rgba(26, 124, 196, 0.24);
  outline-offset: 2px;
}

.staff-shell .stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.staff-shell .stats-grid .stat {
  min-height: 124px;
  padding: 20px;
  border-color: #dce7f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(13, 59, 102, 0.055);
}

.staff-shell .stats-grid .stat svg {
  color: #1479bf;
}

.staff-shell .stats-grid .stat strong {
  color: #123f68;
  font-size: 2rem;
  line-height: 1.2;
}

.staff-shell .admin-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.staff-shell .admin-overview-grid > button {
  min-height: 132px;
  padding: 20px;
  border-radius: 8px;
}

.staff-shell .admin-layout .panel {
  padding: 24px;
  border-color: #dce7f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(13, 59, 102, 0.05);
}

.staff-shell .admin-section-header {
  gap: 16px;
  margin-bottom: 18px;
}

.staff-shell .admin-section-header h2,
.staff-shell .admin-layout .section-title h2 {
  color: #123f68;
  font-size: 1.45rem;
  line-height: 1.45;
}

.staff-shell .admin-section-header p,
.staff-shell .admin-layout .section-title p {
  color: #607a94;
  font-size: 0.98rem;
  line-height: 1.75;
}

.staff-shell .admin-inline-filters,
.staff-shell .admin-table-filters {
  gap: 12px;
  padding: 14px;
  border: 1px solid #e0e9f2;
  border-radius: 8px;
  background: #f8fbfe;
}

.staff-shell .admin-table-filters {
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr);
}

.staff-shell .table-wrap {
  border: 1px solid #dfe8f1;
  border-radius: 8px;
  background: #fff;
  overflow: auto;
}

.staff-shell .table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.staff-shell .table-wrap th {
  padding: 13px 16px;
  color: #365a79;
  background: #f4f8fc;
  font-size: 0.9rem;
  white-space: nowrap;
}

.staff-shell .table-wrap td {
  padding: 14px 16px;
  vertical-align: middle;
}

.staff-shell .table-wrap tbody tr:hover td {
  background: #fbfdff;
}

.staff-shell .row-actions,
.staff-shell .catalog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.staff-shell .row-actions button,
.staff-shell .catalog-actions button {
  min-width: 40px;
  min-height: 40px;
  border-radius: 6px;
}

.staff-shell .row-actions .icon-danger,
.staff-shell .catalog-actions .danger-icon-button {
  color: #b42318;
  border-color: #f3c6c2;
  background: #fff7f6;
}

.staff-shell .reference-manager {
  gap: 18px;
}

.staff-shell .catalog-list {
  gap: 8px;
}

.staff-shell .catalog-item {
  min-height: 68px;
  padding: 12px 14px;
  border-color: #e0e9f2;
  border-radius: 8px;
  background: #fff;
}

.staff-shell .empty-state {
  min-height: 132px;
  padding: 24px;
  border-radius: 8px;
  color: #607a94;
  background: #f8fbfe;
}

@media (max-width: 1024px) {
  .staff-shell .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .staff-shell .admin-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main.app-shell.staff-shell:has(.admin-layout) {
    width: min(calc(100% - 20px), 100%);
    padding-bottom: 28px;
  }

  .staff-shell .admin-layout {
    gap: 16px;
  }

  .staff-shell .admin-workspace-header h2 {
    font-size: 1.65rem;
  }

  .staff-shell .admin-workspace-header p {
    font-size: 0.95rem;
  }

  .staff-shell .admin-section-tabs {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
  }

  .staff-shell .admin-section-tabs button {
    min-height: 46px;
    padding: 6px 8px;
    font-size: 0.84rem;
  }

  .staff-shell .admin-section-tabs button:last-child {
    grid-column: 1 / -1;
  }

  .staff-shell .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .staff-shell .stats-grid .stat {
    min-height: 108px;
    padding: 15px;
  }

  .staff-shell .stats-grid .stat strong {
    font-size: 1.7rem;
  }

  .staff-shell .admin-overview-grid {
    gap: 10px;
  }

  .staff-shell .admin-overview-grid > button {
    min-height: 112px;
    padding: 16px;
  }

  .staff-shell .admin-layout .panel {
    padding: 16px;
  }

  .staff-shell .admin-section-header {
    align-items: stretch;
    gap: 12px;
  }

  .staff-shell .admin-inline-filters,
  .staff-shell .admin-table-filters {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .staff-shell .table-wrap table {
    min-width: 720px;
  }

  .staff-shell .reference-manager {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .staff-shell .catalog-item {
    min-height: 62px;
    padding: 10px 12px;
  }
}
