/*
====================================================
DoseClock Administration Log Styles
Phase 4 Package 2
Clinical structure + modern polish
====================================================
*/

.admin-log-page,
.admin-log,
.audit-log-page,
.log-page {
  max-width: 1200px;
  margin: 0 auto;
}

.admin-log-header,
.log-header,
.audit-log-header {
  margin-bottom: 1.5rem;
}

.admin-log-filters,
.log-filters,
.audit-filters,
.filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  align-items: end;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #d7dee8);
  border-radius: var(--radius-lg, 1rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(15, 23, 42, 0.08));
  padding: 1rem;
  margin: 1rem 0 1.5rem;
}

.admin-log-filters label,
.log-filters label,
.audit-filters label,
.filter-panel label {
  font-weight: 700;
  color: var(--color-heading, #0a2d6f);
}

.admin-log-table-wrapper,
.admin-log-table-container,
.audit-table-wrapper,
.log-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border, #d7dee8);
  border-radius: var(--radius-lg, 1rem);
  background: var(--color-surface, #ffffff);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(15, 23, 42, 0.08));
}

.admin-log-table,
table.admin-log-table,
.admin-log table,
.audit-log-page table,
.log-page table {
  width: 100%;
  min-width: 860px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-log-table thead th,
.admin-log table thead th,
.audit-log-page table thead th,
.log-page table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7fc;
  color: var(--color-heading, #0a2d6f);
  border-bottom: 2px solid var(--color-border, #d7dee8);
  font-weight: 700;
  white-space: nowrap;
}

.admin-log-table th,
.admin-log-table td,
.admin-log table th,
.admin-log table td,
.audit-log-page table th,
.audit-log-page table td,
.log-page table th,
.log-page table td {
  vertical-align: top;
  padding: 0.85rem;
  border-bottom: 1px solid var(--color-border, #d7dee8);
}

.admin-log-table tbody tr:hover,
.admin-log table tbody tr:hover,
.audit-log-page table tbody tr:hover,
.log-page table tbody tr:hover {
  background: #f8fbff;
}

.admin-log-table tbody tr:last-child td,
.admin-log table tbody tr:last-child td,
.audit-log-page table tbody tr:last-child td,
.log-page table tbody tr:last-child td {
  border-bottom: 0;
}

.log-time,
.admin-log-time,
.audit-time {
  font-weight: 700;
  color: var(--color-heading, #0a2d6f);
  white-space: nowrap;
}

.log-user,
.admin-log-user,
.audit-user {
  font-weight: 700;
}

.log-notes,
.admin-log-notes,
.audit-notes {
  max-width: 36rem;
}

.action-badge,
.log-action,
.admin-log-action,
.audit-action,
.badge-action {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.action-badge--taken,
.log-action--taken,
.badge-taken,
.status-taken {
  background: #e8f6ef;
  color: #145c36;
}

.action-badge--refused,
.log-action--refused,
.badge-refused,
.status-refused {
  background: #fde8e8;
  color: #8a1f1f;
}

.action-badge--stock,
.log-action--stock,
.badge-stock,
.status-stock_adjustment,
.status-stock-adjustment {
  background: #eaf2ff;
  color: #0a2d6f;
}

.action-badge--warning,
.log-action--warning,
.badge-warning {
  background: #fff4db;
  color: #7a4b00;
}

.log-empty,
.admin-log-empty,
.audit-empty {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #d7dee8);
  border-radius: var(--radius-lg, 1rem);
  padding: 1.25rem;
  color: var(--color-muted, #475569);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(15, 23, 42, 0.08));
}

@media (max-width: 768px) {
  .admin-log-filters,
  .log-filters,
  .audit-filters,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .admin-log-table th,
  .admin-log-table td,
  .admin-log table th,
  .admin-log table td,
  .audit-log-page table th,
  .audit-log-page table td,
  .log-page table th,
  .log-page table td {
    padding: 0.75rem;
  }
}
