/* ===== ENTERPRISE AUDIT SYSTEM ===== */
#auditTable tbody tr:hover { background: #f0f4ff; }
#auditTable tbody tr { transition: background 0.1s; }

/* Audit table header */
.ath {
  padding: 10px 12px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; color: #1d4ed8; letter-spacing: 0.3px;
  white-space: nowrap; cursor: pointer; user-select: none;
}
.ath:hover { background: #e0e7ff; }
.ath.sort-asc::after  { content: " ▲"; font-size: 9px; }
.ath.sort-desc::after { content: " ▼"; font-size: 9px; }

/* Action badges */
.audit-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  white-space: nowrap; letter-spacing: 0.3px;
}
.audit-BILL_CREATE    { background:#dcfce7; color:#166534; }
.audit-BILL_EDIT      { background:#fef9c3; color:#854d0e; }
.audit-BILL_DELETE    { background:#fee2e2; color:#991b1b; }
.audit-PAYMENT_RECEIVE{ background:#e0f2fe; color:#075985; }
.audit-PAYMENT_ADD    { background:#dbeafe; color:#1e40af; }
.audit-PAYMENT_DELETE { background:#fce7f3; color:#9d174d; }
.audit-MANUAL_DUE     { background:#ffedd5; color:#9a3412; }
.audit-LOGIN          { background:#f3e8ff; color:#6b21a8; }
.audit-LOGOUT         { background:#f1f5f9; color:#475569; }
.audit-RATE_CHART     { background:#fef3c7; color:#92400e; }
.audit-SESSION_CHANGE { background:#fce7f3; color:#be185d; }

/* Enterprise summary cards grid */
.audit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.audit-kpi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.audit-kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
}
.audit-kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.audit-kpi-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 2px;
}
.audit-kpi-val  { font-size: 18px; font-weight: 800; color: #111827; line-height: 1.2; }
.audit-kpi-lbl  { font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: #6b7280; letter-spacing: 0.3px; }
/* Card color variants */
.akc-blue   { border-color: #bfdbfe; } .akc-blue::before   { background: #3b82f6; } .akc-blue   .audit-kpi-icon { background: #eff6ff; color: #2563eb; }
.akc-green  { border-color: #bbf7d0; } .akc-green::before  { background: #10b981; } .akc-green  .audit-kpi-icon { background: #ecfdf5; color: #059669; }
.akc-yellow { border-color: #fde68a; } .akc-yellow::before { background: #f59e0b; } .akc-yellow .audit-kpi-icon { background: #fffbeb; color: #d97706; }
.akc-red    { border-color: #fecaca; } .akc-red::before    { background: #ef4444; } .akc-red    .audit-kpi-icon { background: #fef2f2; color: #dc2626; }
.akc-purple { border-color: #e9d5ff; } .akc-purple::before { background: #8b5cf6; } .akc-purple .audit-kpi-icon { background: #f5f3ff; color: #7c3aed; }
.akc-cyan   { border-color: #a5f3fc; } .akc-cyan::before   { background: #06b6d4; } .akc-cyan   .audit-kpi-icon { background: #ecfeff; color: #0891b2; }
.akc-indigo { border-color: #c7d2fe; } .akc-indigo::before { background: #6366f1; } .akc-indigo .audit-kpi-icon { background: #eef2ff; color: #4f46e5; }
.akc-orange { border-color: #fed7aa; } .akc-orange::before { background: #f97316; } .akc-orange .audit-kpi-icon { background: #fff7ed; color: #ea580c; }
.akc-teal   { border-color: #99f6e4; } .akc-teal::before   { background: #14b8a6; } .akc-teal   .audit-kpi-icon { background: #f0fdfa; color: #0d9488; }
.akc-rose   { border-color: #fecdd3; } .akc-rose::before   { background: #f43f5e; } .akc-rose   .audit-kpi-icon { background: #fff1f2; color: #e11d48; }

/* Audit filter panel */
.audit-filter-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.audit-filter-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px;
}
.audit-filter-row:last-child { margin-bottom: 0; }
.audit-filter-field {
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px;
}
.audit-filter-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  color: #6b7280; letter-spacing: 0.3px;
}

/* Pagination */
.audit-pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid #e5e7eb;
  background: #f9fafb; border-radius: 0 0 12px 12px;
}
.audit-page-info { font-size: 12px; color: #6b7280; }
.audit-page-btns { display: flex; gap: 6px; }
.audit-page-btn {
  padding: 5px 12px; border: 1px solid #e5e7eb; border-radius: 6px;
  background: #fff; font-size: 12px; cursor: pointer; color: #374151;
  font-weight: 600; transition: all 0.1s;
}
.audit-page-btn:hover { background: #f0f4ff; border-color: #c7d2fe; }
.audit-page-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.audit-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Audit Detail Modal */
.audit-detail-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.audit-detail-modal.hidden { display: none; }
.audit-detail-box {
  background: #fff; border-radius: 16px; width: 700px; max-width: 95vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}
.audit-detail-header {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px 14px; border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: 16px 16px 0 0;
}
.audit-detail-title { font-size: 16px; font-weight: 700; color: #111827; flex: 1; }
.audit-detail-close {
  width: 30px; height: 30px; border: none; background: #f1f5f9;
  border-radius: 8px; cursor: pointer; font-size: 16px; color: #64748b;
  display: flex; align-items: center; justify-content: center;
}
.audit-detail-close:hover { background: #e2e8f0; }
.audit-detail-body { padding: 20px 22px; }
.audit-detail-section { margin-bottom: 18px; }
.audit-detail-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: #6b7280; letter-spacing: 0.5px; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid #f1f5f9;
}
.audit-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.audit-detail-field { display: flex; flex-direction: column; gap: 2px; }
.audit-detail-field-label { font-size: 10.5px; color: #9ca3af; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.audit-detail-field-val { font-size: 13px; color: #111827; font-weight: 500; }
.audit-diff-box {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
}
.audit-diff-side { display: flex; flex-direction: column; gap: 6px; }
.audit-diff-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #6b7280; margin-bottom: 4px; }
.audit-diff-row { font-size: 12px; }
.audit-diff-arrow { font-size: 20px; color: #9ca3af; text-align: center; }
.audit-diff-changed { color: #dc2626; font-weight: 700; }
.audit-diff-new     { color: #059669; font-weight: 700; }

/* View button in audit table */
.audit-view-btn {
  padding: 3px 10px; border: 1px solid #c7d2fe; border-radius: 6px;
  background: #eff6ff; color: #2563eb; font-size: 11px;
  cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: all 0.1s;
}
.audit-view-btn:hover { background: #dbeafe; border-color: #93c5fd; }

/* Export toolbar */
.audit-export-bar {
  display: flex; gap: 8px; align-items: center;
}

