/* ── Account status banner ─────────────────────────────────── */

#accountStatusBanner {
  flex-shrink: 0;
}

.account-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.account-banner--warning {
  background: #fefce8;
  border-bottom: 1px solid #fde047;
  color: #854d0e;
}

.account-banner--danger {
  background: #fef2f2;
  border-bottom: 1px solid #fca5a5;
  color: #991b1b;
}

.account-banner-body {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.account-banner-actions {
  flex-shrink: 0;
}

/* ── Dashboard layout ──────────────────────────────────────── */

.dashboard-body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-navbar {
  background: white;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  z-index: 100;
}

.dashboard-navbar .navbar-brand img {
  height: auto;
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

/* Three-column layout */

.dashboard-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 64px);
  height: calc(100vh - 56px);
}

/* ── Database sidebar ──────────────────────────────────────── */

.db-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.db-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.db-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  overflow-y: auto;
  flex: 1;
}

.db-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  color: var(--text-dark);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}

.db-list li i {
  color: var(--text-light);
  font-size: 1rem;
  flex-shrink: 0;
}

.db-list li:hover {
  background: var(--bg-light);
}

.db-list li.active {
  background: rgba(59,130,246,.07);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.db-list li.active i {
  color: var(--primary-color);
}

/* ── Table slide-out panel ─────────────────────────────────── */

.table-panel {
  width: 0;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
}

.table-panel.open {
  width: 200px;
}

.table-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
}

.table-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  overflow-y: auto;
  flex: 1;
}

.table-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  color: var(--text-dark);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.table-list li i {
  color: var(--text-light);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.table-list li:hover {
  background: var(--bg-light);
}

.table-list li.active {
  background: rgba(59,130,246,.07);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.table-list li.active i {
  color: var(--primary-color);
}

/* ── Records area ──────────────────────────────────────────── */

.records-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-light);
}

.records-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--border-color);
}

.records-placeholder i {
  font-size: 4rem;
}

.records-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: white;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.records-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.25rem;
}

.records-table {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  font-size: 0.875rem;
  min-width: 500px;
}

.records-table thead th {
  background: var(--bg-light);
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border-color);
  padding: 0.65rem 1rem;
  white-space: nowrap;
}

.records-table tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-table tbody tr:last-child td {
  border-bottom: none;
}

#recordsContent {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar footer (Account button) ──────────────────────── */

.db-sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 0.6rem 0.75rem;
  flex-shrink: 0;
}

.db-account-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.db-account-btn:hover {
  background: var(--bg-light);
  color: var(--text-dark);
}

.db-account-btn.active {
  background: rgba(59,130,246,.07);
  color: var(--primary-color);
  font-weight: 600;
}

.db-account-btn i {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Account panel ─────────────────────────────────────────── */

.account-panel {
  width: 420px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.account-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.account-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-section-card {
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-light);
}

.account-section-card--danger {
  border-color: #fca5a5;
  background: #fff8f8;
}

.account-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status badge */

.account-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.account-status-badge--active {
  background: rgba(34,197,94,.12);
  color: #15803d;
}

.account-status-badge--pending {
  background: rgba(251,191,36,.18);
  color: #92400e;
}

.account-status-badge--deleted {
  background: rgba(239,68,68,.12);
  color: #991b1b;
}

/* ── Column builder (new table modal) ─────────────────────── */

.column-builder {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 320px;
  overflow-y: auto;
}

.column-row {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}

/* ── Table panel action buttons ────────────────────────────── */

.table-panel-header .btn-link {
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.table-panel-header .btn-link:hover {
  opacity: 1;
}

/* ── Invitation list items ─────────────────────────────────── */

#invitationsList .border-bottom:last-child {
  border-bottom: none !important;
}

/* ── Record modal field layout ─────────────────────────────── */

#recordModalBody .form-label {
  margin-bottom: 0.2rem;
}

/* ── Pagination strip ──────────────────────────────────────── */

.records-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: white;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ── Empty states ──────────────────────────────────────────── */

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
}

.empty-state i {
  font-size: 2rem;
  color: var(--border-color);
  display: block;
  margin-bottom: 0.5rem;
}

