/* Dense layout for the Data UI -- a top-bar + full-width main area rather than
   the admin dashboard's sidebar, and tighter table rows/padding throughout.
   Builds on top of style.css's base tokens/components (buttons, forms, modals,
   cards) rather than redefining them. */

.data-app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  min-height: 100vh;
}

.data-topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.data-topbar .brand { gap: 0.5rem; }
.data-topbar .logo-icon { width: 32px; height: 32px; font-size: 1.1rem; }
.data-topbar .brand-text h1 { font-size: 1.05rem; }

.data-search-wrap { flex: 1; max-width: 420px; }
.data-search-wrap .form-control { padding: 0.4rem 0.7rem; font-size: 0.85rem; }

.data-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: auto;
}
.data-topbar-actions a { color: var(--cyan-accent); font-size: 0.85rem; text-decoration: none; }
.data-topbar-actions a:hover { text-decoration: underline; }
.data-auth-status { font-size: 0.8rem; color: var(--text-muted); }

.data-main {
  flex: 1;
  padding: 1rem 1.25rem;
  overflow-y: auto;
}

.data-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}

.data-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  transition: background 0.1s ease;
  /* Fixed height, regardless of how many/how long a table's own hashtags are
     -- every tile stays the same size; the tags row below just clips whatever
     doesn't fit instead of growing the card. */
  height: 92px;
  display: flex;
  flex-direction: column;
}
.data-table-card:hover { background: var(--bg-card-hover); }
.data-table-card .data-table-card-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.15rem; }
.data-table-card .data-table-card-meta { font-size: 0.75rem; color: var(--text-muted); }
.data-table-card .data-table-card-tags {
  margin-top: auto; /* pins the tags row to the bottom regardless of the name/meta lines' own height */
  flex-wrap: nowrap;
  overflow: hidden;
}
.data-table-card .data-table-card-tags .tag {
  flex-shrink: 0; /* clipped whole-or-partial by the row's own overflow:hidden, never squeezed to fit */
  white-space: nowrap;
}

.data-detail-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.data-detail-header h2 { font-size: 1.1rem; margin-right: auto; }
.data-detail-actions { display: flex; gap: 0.5rem; align-items: center; }
.data-detail-actions .form-control { padding: 0.35rem 0.6rem; font-size: 0.82rem; width: 200px; }

.data-records-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.data-records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-records-table th, .data-records-table td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-records-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--bg-card);
  position: sticky;
  top: 0;
}
.data-records-table tbody tr:hover { background: var(--bg-card-hover); }
.data-records-table .data-row-actions { white-space: nowrap; }
.data-records-table .data-row-actions button { margin-right: 0.3rem; }

/* Pinned to the right regardless of how many/how wide the data columns are or
   how narrow the viewport is -- Edit/Delete should never need a horizontal
   scroll to reach, on top of MAX_LIST_COLUMNS already keeping row width sane
   in the common case. Needs its own opaque background (rows don't have one by
   default) so scrolled-under content doesn't show through, and a hover-state
   override so it doesn't look "stuck" a different shade than the rest of a
   hovered row. */
.data-records-table td.data-row-actions {
  position: sticky;
  right: 0;
  background: var(--bg-dark);
  border-left: 1px solid var(--border-color);
}
.data-records-table th.data-row-actions {
  position: sticky;
  right: 0;
  z-index: 1;
  border-left: 1px solid var(--border-color);
}
.data-records-table tbody tr:hover td.data-row-actions {
  background: var(--bg-card-hover);
}

.data-pagination {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
