/* ==========================================================================
   Action & Audit Logs Stylesheet
   Color-coded log badges, filter toolbar, responsive data table, and JSON modal
   ========================================================================== */

.action-logs-container {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 0.25rem 0 2rem 0;
}

/* KPI Overview Grid */
.action-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.action-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.action-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.action-kpi-card.is-create {
  border-left: 4px solid #10b981;
}

.action-kpi-card.is-update {
  border-left: 4px solid #0284c7;
}

.action-kpi-card.is-delete {
  border-left: 4px solid #ef4444;
}

.action-kpi-card.is-failed {
  border-left: 4px solid #f59e0b;
}

/* Filter Card */
.action-filter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.action-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.action-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
  flex: 1;
}

.action-filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.action-filter-select,
.action-filter-input {
  height: 34px;
  padding: 0.25rem 0.65rem;
  font-size: 0.785rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease;
}

.action-filter-select:focus,
.action-filter-input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

/* Quick Action Type Filter Pills */
.action-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.action-type-pill {
  padding: 0.25rem 0.65rem;
  font-size: 0.725rem;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.action-type-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.action-type-pill.active {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.action-type-pill.active.pill-delete {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.action-type-pill.active.pill-failed {
  background: #d97706;
  border-color: #d97706;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

/* Action Log Badges with Vibrant Color Semantics */
.log-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Delete Action: Red */
.log-action-badge.badge-delete {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Create Action: Green */
.log-action-badge.badge-create {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Update / Edit Action: Blue */
.log-action-badge.badge-update {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Failure / Rejection: Amber / Orange */
.log-action-badge.badge-failed {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Auth / Security: Purple */
.log-action-badge.badge-auth {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

/* Neutral / Default: Gray */
.log-action-badge.badge-default {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

/* Table Card */
.action-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.action-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.action-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.action-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.action-table tr:hover {
  background: #f8fafc;
}

/* User Avatar & Info inside Row */
.action-user-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.action-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-user-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.8rem;
  line-height: 1.2;
}

.action-user-role {
  font-size: 0.68rem;
  color: #64748b;
  text-transform: capitalize;
}

/* Pagination & Summary Bar */
.action-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.775rem;
  color: #64748b;
}

.action-page-btns {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.action-page-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.725rem;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #334155;
  cursor: pointer;
}

.action-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-page-btn:not(:disabled):hover {
  background: #f1f5f9;
  color: #0f172a;
}
