.at-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1.25rem 1.5rem;
  box-sizing: border-box;
}

.at-frame {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
  padding: 20px 22px;
}

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

.at-frame-header-text {
  min-width: 0;
}

.at-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.at-table-title {
  font-size: var(--st-section);
  font-weight: 600;
  color: var(--text-color);
}

.at-table-subtitle {
  font-size: var(--st-text-sm);
  color: var(--color-gray-400);
  margin-top: 3px;
}

.at-search-wrap {
  position: relative;
  width: 280px;
  max-width: 100%;
  flex-shrink: 0;
}

.at-search-wrap .at-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.at-search-wrap .at-search-icon svg {
  width: 16px;
  height: 16px;
}

.at-search-wrap:focus-within .at-search-icon {
  color: var(--color-brand-green-ink-1a);
}

.at-search-input {
  width: 100%;
  background: var(--white-color);
  border: 1px solid rgba(var(--black-color-rgb), 0.12);
  border-radius: 9999px;
  padding: 0.55rem 2.25rem 0.55rem 2.5rem;
  font-size: var(--st-text-sm);
  color: var(--text-color);
  font-family: "Inter", sans-serif;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 0 1px 2px rgba(var(--black-color-rgb), 0.02);
}

.at-search-input:hover {
  border-color: rgba(var(--black-color-rgb), 0.2);
}

.at-search-input:focus {
  border-color: rgba(var(--primary-color-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.12);
}

.at-search-input::placeholder {
  color: var(--color-gray-400);
}

.at-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: none;
  background: rgba(var(--black-color-rgb), 0.06);
  color: var(--color-gray-500);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.at-search-clear svg {
  width: 12px;
  height: 12px;
}

.at-search-clear:hover {
  background: rgba(var(--black-color-rgb), 0.12);
  color: var(--text-color);
}

.at-table-container {
  border: 1px solid rgba(var(--black-color-rgb), 0.1);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white-color);
  box-shadow: 0 1px 3px rgba(var(--black-color-rgb), 0.04);
}

.at-table-grow {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.at-table-scroll {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.at-table {
  width: 100%;
  text-align: center;
  border-collapse: collapse;
}

.at-table thead {
  background: var(--color-neutral-off-white);
  position: sticky;
  top: 0;
  z-index: 20;
}

.at-table th {
  padding: 16px 20px;
  font-size: var(--st-text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-400);
  border-bottom: 1px solid rgba(var(--black-color-rgb), 0.08);
  text-align: center;
  white-space: nowrap;
}

.at-table th:first-child {
  text-align: center;
  width: 52px;
}

.at-table th:nth-child(3),
.at-table td:nth-child(3) {
  text-align: left;
}

.at-table th:last-child {
  width: 100px;
}

.at-th-sortable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.at-th-sortable:hover {
  color: var(--text-color);
}

.at-th-sortable:hover .at-sort-icon {
  opacity: 1;
}

.at-th-sortable.at-sort-active {
  color: var(--text-color);
}

.at-th-sortable.at-sort-active .at-sort-icon {
  opacity: 1;
}

.at-sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  transition: all 0.15s ease;
  font-size: 16px;
}

.at-sort-icon svg {
  font-size: 16px;
}

.at-sort-icon.at-sort-asc {
  opacity: 1;
  color: var(--success-color-light);
}

.at-sort-icon.at-sort-desc {
  opacity: 1;
  color: var(--danger-color-lighter);
}

.at-table tbody tr {
  transition: background 0.2s;
  cursor: pointer;
}

.at-table tbody tr:hover {
  background: var(--color-gray-100) !important;
}

.at-table tbody tr:nth-child(even) {
  background: var(--color-neutral-off-white);
}

.at-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(var(--black-color-rgb), 0.06);
  text-align: center;
  vertical-align: middle;
}

.at-table td:first-child {
  text-align: center;
  width: 52px;
}

.at-row-num {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--st-text-sm);
  font-weight: 500;
  color: var(--color-gray-400);
}

.at-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: var(--st-text-sm);
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.at-role-owner {
  background: rgba(var(--primary-color-rgb), 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(var(--primary-color-rgb), 0.2);
}

.at-role-superadmin {
  background: rgba(var(--indigo-color-light-rgb), 0.1);
  color: var(--indigo-color-light);
  border: 1px solid rgba(var(--indigo-color-light-rgb), 0.2);
}

.at-role-admin {
  background: rgba(var(--color-zinc-400-rgb), 0.08);
  color: var(--color-gray-500);
  border: 1px solid rgba(var(--color-zinc-400-rgb), 0.15);
}

.at-account-cell {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.at-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  background: var(--color-gray-100);
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  border-radius: 8px;
  padding: 0 12px;
  transition: border-color 0.2s;
}

.at-table tbody tr:hover .at-account-chip {
  border-color: rgba(var(--black-color-rgb), 0.15);
}

.at-account-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.at-account-text {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--st-text-base);
  font-weight: 500;
  color: var(--text-color);
  letter-spacing: 0.3px;
}

.at-name-text {
  font-size: var(--st-text-base);
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
}

.at-actions-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.at-actions-count {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--st-text-base);
  font-weight: 600;
  color: var(--text-color);
  min-width: 36px;
}

.at-actions-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
}

.at-spark-bar {
  width: 3px;
  border-radius: 1.5px;
  background: var(--primary-color);
  opacity: 0.5;
  transition: opacity 0.2s;
}

.at-table tbody tr:hover .at-spark-bar {
  opacity: 0.85;
}

.at-date-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.at-date-ago {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--st-text-base);
  font-weight: 600;
  color: var(--text-color);
}

.at-date-full {
  font-size: var(--st-text-sm);
  color: var(--color-gray-400);
}

.at-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: var(--st-text-sm);
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.at-tag-hr {
  background: rgba(var(--pink-color-magenta-rgb), 0.1);
  color: var(--pink-color);
  border-color: rgba(var(--pink-color-magenta-rgb), 0.2);
}

.at-tag-recruiter {
  background: rgba(var(--info-color-rgb), 0.1);
  color: var(--info-color-dark);
  border-color: rgba(var(--info-color-rgb), 0.2);
}

.at-tag-manager {
  background: rgba(var(--primary-color-rgb), 0.1);
  color: var(--color-brand-green-ink-1a);
  border-color: rgba(var(--primary-color-rgb), 0.25);
}

.at-tag-marketing {
  background: rgba(var(--warning-color-rgb), 0.1);
  color: var(--warning-color-darker);
  border-color: rgba(var(--warning-color-rgb), 0.25);
}

.at-tag-finance {
  background: rgba(var(--indigo-color-light-rgb), 0.1);
  color: var(--indigo-color-deeper);
  border-color: rgba(var(--indigo-color-light-rgb), 0.25);
}

.at-tag-default {
  background: rgba(var(--color-zinc-400-rgb), 0.08);
  color: var(--color-gray-500);
  border-color: rgba(var(--color-zinc-400-rgb), 0.15);
}

@media (max-width: 1000px) {
  .at-table {
    min-width: 820px;
  }

  .at-frame-header {
    flex-direction: column;
    align-items: stretch;
  }

  .at-search-wrap {
    width: 100%;
  }
}

.at-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  gap: 10px;
  width: 100%;
  min-height: 280px;
  text-align: center;
}

.at-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-color-rgb), 0.08);
  color: var(--color-brand-green-ink-1a);
  margin-bottom: 4px;
}

.at-empty-icon svg {
  width: 26px;
  height: 26px;
}

.at-empty-title {
  font-size: var(--st-section);
  font-weight: 600;
  color: var(--text-color);
}

.at-empty-desc {
  font-size: var(--st-text-sm);
  color: var(--color-gray-500);
  max-width: 360px;
  line-height: 1.5;
}

/* Spacing for the empty-state CTA below the title/desc.
   Visuals come from ActionButton (.v-action-btn--primary | --secondary). */
.at-empty-cta {
  margin-top: 8px;
}

/* ==========================================================================
   Responsive — tighter paddings on small screens so the horizontal-scroll
   table doesn't feel cramped inside a padded frame.
   ========================================================================== */
@media (max-width: 639px) {
  .at-page {
    padding: 0.75rem;
  }

  .at-frame {
    padding: 14px;
  }

  .at-frame-header {
    margin-bottom: 12px;
  }

  .at-table th,
  .at-table td {
    padding: 12px 14px;
  }
}
