/* admin.css — styles only the staff dashboard needs: key-figure strip, data tables, reset box.
   Used by: pages/admin.html */


.page-header .admin-notice {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}


/* --------------------------------------------------------------------------
   Key figures — one framed strip split into four cells
   -------------------------------------------------------------------------- */

/* [TOPIC: grid]  four equal columns */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 3rem;
  border: 2px solid var(--color-ink);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding: 1.4rem 1.5rem;
}

.stat-card + .stat-card {
  border-left: 1px solid var(--color-border);
}

.stat-card-label {
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.stat-card-value {
  overflow: hidden;
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card-value-sm {
  font-size: 1.5rem;
  line-height: 1.65;
}

.stat-card-sub {
  color: var(--color-muted);
  font-size: 0.875rem;
}


/* --------------------------------------------------------------------------
   Table sections
   -------------------------------------------------------------------------- */
.admin-section {
  margin-bottom: 3rem;
}

.admin-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
}

.admin-section-header h2 {
  margin: 0;
  font-size: 1.75rem;
}

.admin-section-header p {
  margin: 0;
  color: var(--color-muted);
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.inline-field label {
  color: var(--color-muted);
}

.inline-field .form-control {
  width: auto;
  min-height: 2.5rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

/* Lets wide tables scroll sideways on small screens.
   position: relative keeps hidden screen-reader labels (position: absolute) inside
   the scroll box; without it they escaped and made the whole page scroll sideways. */
.table-wrap {
  position: relative;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th {
  padding: 0.7rem 1rem 0.7rem 0;
  border-top: 2px solid var(--color-ink);
  border-bottom: 1px solid var(--color-ink);
  color: var(--color-ink);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.data-table th:last-child,
.data-table td:last-child {
  padding-right: 0;
}

/* [TOPIC: :hover]  highlight the row under the mouse */
.data-table tbody tr:hover {
  background-color: var(--color-surface);
}

.data-table tfoot td {
  border-top: 2px solid var(--color-ink);
  border-bottom: 0;
  color: var(--color-ink);
  font-weight: 600;
}

.data-table .num {
  text-align: right;
  white-space: nowrap;
}

.cell-main {
  display: block;
  color: var(--color-ink);
  font-weight: 600;
  white-space: nowrap;
}

.cell-sub {
  display: block;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.table-car {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.table-car img {
  width: 4rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

.data-table .table-empty {
  padding: 2.5rem 0;
  color: var(--color-muted);
  text-align: center;
}


/* --------------------------------------------------------------------------
   Reset demo data box
   -------------------------------------------------------------------------- */
.danger-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-red);
}

.danger-zone h2 {
  margin-bottom: 0.2rem;
  font-size: 1.25rem;
}

.danger-zone p {
  margin: 0;
  color: var(--color-muted);
}


/* [TOPIC: media queries] */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card:nth-child(3) {
    border-left: 0;
  }

  .stat-card:nth-child(n + 3) {
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card + .stat-card {
    border-top: 1px solid var(--color-border);
    border-left: 0;
  }
}
