/* =========================================================
   LAAU — Credential Asset Audit
   ---------------------------------------------------------
   Version: 1.0.0
   Status: ACTIVE

   PURPOSE
   ---------------------------------------------------------
   Visual governance for credential asset readiness.

   Responsibilities
   ---------------------------------------------------------
   - Asset status presentation
   - Ownership status presentation
   - Overall readiness presentation
   - Row state differentiation
   - Sorting/filter control presentation

   Architecture
   ---------------------------------------------------------
   Credential Registry
        ↓
   Credential Asset Audit
        ↓
   Read-only Operational Intelligence

   Governance
   ---------------------------------------------------------
   - CSS owns presentation only
   - No Firestore logic
   - No asset-state calculation
   - No credential mutation
========================================================= */


/* =========================================================
   🔷 AUDIT SUMMARY CARDS
========================================================= */

.audit-summary-card {
  position: relative;
}

.audit-summary-card .data-label {
  display: block;
  margin-bottom: 8px;
}

.audit-summary-card .audit-summary-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}


/* =========================================================
   🎯 STATUS TOKENS
========================================================= */

.audit-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 4px 9px;

  border-radius: 999px;

  font-size: 12px;
  font-weight: 600;

  line-height: 1.2;

  white-space: nowrap;
}


/* =========================================================
   ✅ PUBLISHED
========================================================= */

.audit-status-published {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}


/* =========================================================
   ❌ MISSING
========================================================= */

.audit-status-missing {
  background: rgba(239, 68, 68, 0.10);
  color: #b91c1c;
}


/* =========================================================
   🔗 LEARNER LINKED
========================================================= */

.audit-status-linked {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}


/* =========================================================
   ⏳ ACTIVATION PENDING
========================================================= */

.audit-status-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}


/* =========================================================
   ✅ OVERALL COMPLETE
========================================================= */

.audit-status-complete {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;

  font-weight: 700;
}


/* =========================================================
   ⚠️ ACTION REQUIRED
========================================================= */

.audit-status-action-required {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;

  font-weight: 700;
}


/* =========================================================
   🟢 ROW STATE — COMPLETE
========================================================= */

.audit-row-complete {
  background: rgba(34, 197, 94, 0.025);
}


/* =========================================================
   🟠 ROW STATE — ACTION REQUIRED
========================================================= */

.audit-row-action-required {
  background: rgba(245, 158, 11, 0.025);
}


/* =========================================================
   🔗 ROW STATE — LINKED
========================================================= */

.audit-row-linked td:first-child {
  box-shadow:
    inset 3px 0 0 rgba(34, 197, 94, 0.65);
}


/* =========================================================
   ⏳ ROW STATE — OWNERSHIP PENDING
========================================================= */

.audit-row-ownership-pending td:first-child {
  box-shadow:
    inset 3px 0 0 rgba(245, 158, 11, 0.7);
}


/* =========================================================
   🔎 AUDIT FILTER TOOLBAR
========================================================= */

.audit-toolbar {
  display: grid;

  grid-template-columns:
    minmax(220px, 2fr)
    repeat(4, minmax(150px, 1fr));

  gap: 14px;

  align-items: end;
}


.audit-filter-group {
  display: flex;
  flex-direction: column;

  gap: 6px;
}


.audit-filter-group label {
  font-size: 12px;
  font-weight: 600;

  color: var(--text-muted);
}


.audit-filter-group input,
.audit-filter-group select {
  width: 100%;
}


/* =========================================================
   🔃 SORT CONTROL
========================================================= */

.audit-sort-control {
  min-width: 180px;
}


/* =========================================================
   📋 TABLE
========================================================= */

.audit-table-wrapper {
  overflow-x: auto;
}


.audit-table {
  width: 100%;
  border-collapse: collapse;
}


.audit-table th {
  white-space: nowrap;
}


.audit-table tbody tr {
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}


.audit-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.035);
}


/* =========================================================
   👤 LEARNER
========================================================= */

.audit-learner-name {
  font-weight: 500;
}


.audit-learner-email {
  margin-top: 3px;

  font-size: 12px;

  color: var(--text-muted);
}


/* =========================================================
   🪪 CREDENTIAL ID
========================================================= */

.audit-credential-id {
  font-weight: 600;
  letter-spacing: 0.01em;
}


/* =========================================================
   📊 OVERALL STATUS
========================================================= */

.audit-overall {
  font-weight: 700;
}


/* =========================================================
   📭 EMPTY STATE
========================================================= */

.audit-empty-state {
  padding: 36px 20px;

  text-align: center;

  color: var(--text-muted);
}


/* =========================================================
   🌙 DARK THEME
========================================================= */

:root[data-theme="dark"] .audit-status-published,
:root[data-theme="dark"] .audit-status-linked,
:root[data-theme="dark"] .audit-status-complete {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}


:root[data-theme="dark"] .audit-status-missing {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}


:root[data-theme="dark"] .audit-status-pending,
:root[data-theme="dark"] .audit-status-action-required {
  background: rgba(245, 158, 11, 0.20);
  color: #fcd34d;
}


:root[data-theme="dark"] .audit-row-complete {
  background: rgba(34, 197, 94, 0.035);
}


:root[data-theme="dark"] .audit-row-action-required {
  background: rgba(245, 158, 11, 0.035);
}


/* =========================================================
   📱 RESPONSIVE
========================================================= */

@media (max-width: 1200px) {

  .audit-toolbar {
    grid-template-columns:
      repeat(2, minmax(180px, 1fr));
  }

}


@media (max-width: 700px) {

  .audit-toolbar {
    grid-template-columns: 1fr;
  }

  .audit-sort-control {
    min-width: 0;
  }

}