/* DJC-DEMO-MODULE-EXCEPTION-QUEUE-v0.2.0 · exception-queue.css
 *
 * Scoped CSS for the NEW exception-queue.html page.
 *
 * FUG v0.1.8 compliance:
 *   §3.2 font floors    — body 16px / helper 14px on new elements
 *   §3.4 color contrast — severity badges use color + text label + dot
 *                         (never color-only per FUG §3.4)
 *   §3.5 keyboard       — sortable column headers have role="button" tabindex
 *                         from JS; focus-visible outline preserved
 *   §3.6 touch targets  — filter selects + detail links ≥44×44px effective area
 *   §4.1 dense table    — compact rows; allowed by §4.1
 *   §4.3 local overflow — .exception-table-wrap scrolls horizontally on
 *                         narrow widths instead of page-level horizontal scroll
 *
 * Cycle banner styles inherited from annual-order.css (per HTML link order).
 */

/* ════════════════════════════════════════════════════════════════════════
   Access-restricted overlay (role !== admin)
   ════════════════════════════════════════════════════════════════════════ */

.access-restricted {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem 1rem;
}

.access-restricted-card {
  max-width: 32rem;
  background: var(--paper-elevated);
  border: 1px solid var(--rules);
  border-radius: 4px;
  padding: 2rem 1.75rem;
  text-align: left;
}

.access-restricted-title {
  font-size: 1.5rem;             /* 24px — page-level title */
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.access-restricted-body {
  font-size: 1rem;               /* 16px — FUG body floor */
  color: var(--ink);
  line-height: 1.55;
  margin: 0 0 1rem;
}

.access-restricted-body strong {
  font-weight: 600;
}

.access-restricted-current {
  font-size: 0.9375rem;          /* 15px — above helper floor */
  color: var(--ink-secondary);
  background: var(--paper);
  padding: 0.625rem 0.875rem;
  border-radius: 4px;
  border: 1px solid var(--rules);
  margin: 1rem 0;
}

.access-restricted-current .mono {
  font-weight: 600;
  color: var(--ink);
}

.access-restricted-back {
  margin: 1rem 0 0;
  font-size: 1rem;
}

.access-restricted-back-link {
  display: inline-block;
  padding: 0.5rem 0;
  color: var(--ink);
  text-decoration: underline;
  min-height: 44px;              /* FUG §3.6 touch-target floor */
  line-height: 2;
}

.access-restricted-back-link:hover {
  color: var(--ink-secondary);
}

.access-restricted-back-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════════
   Exception summary bar (4 cells)
   ════════════════════════════════════════════════════════════════════════ */

.exception-summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}

.exception-summary-cell {
  background: var(--paper-elevated);
  border: 1px solid var(--rules);
  border-radius: 4px;
  padding: 0.875rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.exception-summary-cell .mono {
  font-size: 0.875rem;           /* 14px — FUG helper-text floor */
  color: var(--ink-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.exception-summary-cell .value {
  font-family: var(--font-app);
  font-weight: 600;
  font-size: 1.75rem;            /* 28px — pronounced count */
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.exception-summary-cell[data-severity-cell="high"]   .value { color: #b91c1c; }
.exception-summary-cell[data-severity-cell="medium"] .value { color: #b45309; }
.exception-summary-cell[data-severity-cell="low"]    .value { color: #047857; }

/* ════════════════════════════════════════════════════════════════════════
   Filter row (4 selects + status text)
   ════════════════════════════════════════════════════════════════════════ */

.exception-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.875rem 1.25rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.125rem;
  background: var(--paper-elevated);
  border: 1px solid var(--rules);
  border-radius: 4px;
}

.exception-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 9rem;
  flex: 1 1 9rem;
}

.exception-filter-label {
  font-size: 0.875rem;           /* 14px — FUG helper-text floor */
  color: var(--ink-secondary);
  letter-spacing: 0.02em;
  font-weight: 500;
}

.exception-filter-select {
  font-family: inherit;
  font-size: 1rem;               /* 16px — FUG body floor */
  padding: 0.55rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--rules);
  border-radius: 4px;
  color: var(--ink);
  min-height: 44px;              /* FUG §3.6 touch-target floor */
  box-sizing: border-box;
  cursor: pointer;
}

.exception-filter-select:hover {
  border-color: var(--ink-secondary);
}

.exception-filter-select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

.exception-filter-status {
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  font-style: italic;
  margin-left: auto;
  align-self: center;
  padding-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .exception-filter-row {
    padding: 0.875rem 1rem;
  }
  .exception-filter-group {
    flex: 1 1 100%;
    min-width: 0;
  }
  .exception-filter-status {
    margin-left: 0;
    text-align: left;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   Exception table (dense; local horizontal scroll on mobile per FUG §4.3)
   ════════════════════════════════════════════════════════════════════════ */

.exception-table-wrap {
  position: relative;
  overflow-x: auto;             /* FUG §4.3: local overflow, NOT page-level */
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1rem;
  background: var(--paper);
  border: 1px solid var(--rules);
  border-radius: 4px;
}

.exception-table {
  width: 100%;
  min-width: 56rem;             /* Forces local scroll below this width */
  border-collapse: collapse;
  font-size: 0.9375rem;         /* 15px — above helper floor; dense per §4.1 */
}

.exception-table thead th {
  background: var(--paper-elevated);
  border-bottom: 2px solid var(--rules);
  text-align: left;
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;           /* 14px — table-header helper floor */
  font-weight: 600;
  color: var(--ink-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.exception-table thead th:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.exception-table tbody td {
  border-bottom: 1px solid var(--rules);
  padding: 0.75rem 0.875rem;
  color: var(--ink);
  vertical-align: top;
  line-height: 1.4;
}

.exception-table tbody tr:hover td {
  background: var(--paper-elevated);
}

.exception-table .col-id        { white-space: nowrap; width: 5rem; }
.exception-table .col-severity  { white-space: nowrap; width: 6.5rem; }
.exception-table .col-source    { white-space: nowrap; width: 8rem; }
.exception-table .col-summary   { min-width: 14rem; }
.exception-table .col-context   { min-width: 9rem; }
.exception-table .col-detected  { white-space: nowrap; width: 9rem; }
.exception-table .col-status    { white-space: nowrap; width: 6.5rem; }
.exception-table .col-detail    { white-space: nowrap; width: 3.5rem; text-align: center; }

.exception-table .col-id .mono,
.exception-table .col-source .mono,
.exception-table .col-detected .mono {
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

/* ════════════════════════════════════════════════════════════════════════
   Severity badges (color + label + dot — never color-only per FUG §3.4)
   ════════════════════════════════════════════════════════════════════════ */

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem 0.2rem 0.4rem;
  border-radius: 1rem;
  font-size: 0.8125rem;          /* 13px — badge microcopy; allowed by FUG §3.2
                                    "by exception" (compact non-essential badge) */
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.severity-badge-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.severity-badge.severity-high {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
.severity-badge.severity-high .severity-badge-dot {
  background: #b91c1c;
}

.severity-badge.severity-medium {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.severity-badge.severity-medium .severity-badge-dot {
  background: #b45309;
}

.severity-badge.severity-low {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.severity-badge.severity-low .severity-badge-dot {
  background: #047857;
}

/* ════════════════════════════════════════════════════════════════════════
   Resolution-state badges (text-based; no color-only)
   ════════════════════════════════════════════════════════════════════════ */

.state-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  background: var(--paper-elevated);
  color: var(--ink-secondary);
  border: 1px solid var(--rules);
}

.state-badge.state-open {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.state-badge.state-acknowledged {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #ddd6fe;
}
.state-badge.state-resolved {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

/* ════════════════════════════════════════════════════════════════════════
   Detail link (compact; ≥44×44 effective via padding)
   ════════════════════════════════════════════════════════════════════════ */

.exception-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;               /* 36px visible; row padding gives ≥44px effective */
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.exception-detail-link:hover {
  background: var(--paper-elevated);
  border-color: var(--rules);
}

.exception-detail-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.exception-detail-empty {
  color: var(--ink-tertiary);
  font-size: 1rem;
}

/* ════════════════════════════════════════════════════════════════════════
   Empty state + clear-filters reset
   ════════════════════════════════════════════════════════════════════════ */

.exception-empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--paper);
  color: var(--ink-tertiary);
}

.exception-empty-state p {
  font-size: 1rem;
  font-style: italic;
  margin: 0 0 1rem;
}

.exception-empty-reset {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.625rem 1.125rem;
  background: var(--paper-elevated);
  border: 1px solid var(--ink-secondary);
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;              /* FUG §3.6 touch-target floor */
  box-sizing: border-box;
}

.exception-empty-reset:hover {
  background: var(--paper);
}

.exception-empty-reset:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════════
   Back link to operating-model
   ════════════════════════════════════════════════════════════════════════ */

.exception-back-link {
  margin: 1.5rem 0 0;
  font-size: 1rem;
}

.exception-back-link a {
  display: inline-block;
  padding: 0.5rem 0;
  color: var(--ink-secondary);
  text-decoration: none;
  min-height: 44px;
  line-height: 2;
}

.exception-back-link a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.exception-back-link a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ── v0.2.1 CP5G: scope/period response (Exception Queue scope + quarter) ── */

.eq-scope-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--rules);
  border-left: 3px solid var(--accent, #3b82f6);
  border-radius: 4px;
  background: var(--paper-elevated);
  color: var(--ink-secondary);
  font-size: 1.4rem;
  line-height: 1.4;
}

.eq-period-note {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--caution-bg);
  color: var(--ink-secondary);
  font-size: 1.3rem;
}

.eq-scope-count-note {
  margin: 8px 0 0;
  font-size: 1.3rem;
  color: var(--ink-tertiary);
}
.eq-scope-count-note[hidden] { display: none; }

@media (max-width: 390px) {
  .eq-scope-banner { font-size: 1.3rem; }
}
