/* =============================================================
   TradeRail — PR242a: Tenant Audit Log
   Namespace : tr242a-*
   Brand     : #FF6B00 primary, #1A1A2E dark
   ============================================================= */

/* ── Module shell ───────────────────────────────────────────── */
.tr242a-module {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1A1A2E;
  background: #f5f6f8;
  min-height: 100%;
  padding-bottom: 40px;
}

/* ── Header ─────────────────────────────────────────────────── */
.tr242a-module-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px 28px 16px;
}
.tr242a-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tr242a-module-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 2px;
}
.tr242a-module-sub {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
}
.tr242a-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

/* ── Stat cards ─────────────────────────────────────────────── */
.tr242a-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px 28px 0;
}
@media (max-width: 900px) {
  .tr242a-stats-row { grid-template-columns: repeat(2, 1fr); }
}
.tr242a-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tr242a-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tr242a-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #1A1A2E;
  line-height: 1;
}
.tr242a-stat-orange { color: #FF6B00; }
.tr242a-stat-red    { color: #dc2626; }
.tr242a-stat-amber  { color: #d97706; }

/* ── Filter / toolbar ───────────────────────────────────────── */
.tr242a-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px 0;
  flex-wrap: wrap;
}
.tr242a-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px 8px 34px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  outline: none;
  font-family: inherit;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%239ca3af' stroke-width='2'/%3E%3Cpath d='m16 16 4 4' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 10px center;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.tr242a-search:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.1);
}
.tr242a-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 28px 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.14s;
}
.tr242a-select:focus { border-color: #FF6B00; }
.tr242a-date-input {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  outline: none;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.14s;
}
.tr242a-date-input:focus { border-color: #FF6B00; }

/* ── Buttons ────────────────────────────────────────────────── */
.tr242a-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.14s, box-shadow 0.14s;
  white-space: nowrap;
  outline: none;
}
.tr242a-btn-primary { background: #FF6B00; color: #fff; }
.tr242a-btn-primary:hover { background: #e55f00; box-shadow: 0 2px 8px rgba(255,107,0,0.25); }
.tr242a-btn-ghost { background: transparent; color: #6b7280; border: 1px solid #e5e7eb; }
.tr242a-btn-ghost:hover { background: #f9fafb; color: #374151; }
.tr242a-btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.tr242a-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Log list ───────────────────────────────────────────────── */
.tr242a-log-wrap {
  padding: 16px 28px 0;
}
.tr242a-log-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

/* Session group header */
.tr242a-session-group {
  border-bottom: 1px solid #f3f4f6;
}
.tr242a-session-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f9fafb;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.tr242a-session-header:hover { background: #f3f4f6; }
.tr242a-session-chevron {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.tr242a-session-group.open .tr242a-session-chevron {
  transform: rotate(90deg);
}
.tr242a-session-user {
  font-size: 13px;
  font-weight: 700;
  color: #1A1A2E;
}
.tr242a-session-meta {
  font-size: 12px;
  color: #9ca3af;
}
.tr242a-session-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 2px 8px;
}
.tr242a-session-rows {
  display: none;
}
.tr242a-session-group.open .tr242a-session-rows {
  display: block;
}

/* Individual log row */
.tr242a-log-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 16px 11px 32px;
  border-bottom: 1px solid #f9fafb;
  transition: background 0.1s;
}
.tr242a-log-row:last-child { border-bottom: none; }
.tr242a-log-row:hover { background: #fafafa; }

/* Severity indicator */
.tr242a-sev {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.tr242a-sev-info     { background: #93c5fd; }
.tr242a-sev-warning  { background: #fbbf24; }
.tr242a-sev-critical { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

.tr242a-log-body {
  flex: 1;
  min-width: 0;
}
.tr242a-log-action {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 2px;
}
.tr242a-log-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tr242a-log-module {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 6px;
  text-transform: capitalize;
}
.tr242a-log-entity {
  font-size: 12px;
  color: #6b7280;
}
.tr242a-log-right {
  text-align: right;
  flex-shrink: 0;
}
.tr242a-log-time {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}

/* Badges */
.tr242a-sev-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tr242a-badge-info     { background: #dbeafe; color: #1d4ed8; }
.tr242a-badge-warning  { background: #fef3c7; color: #92400e; }
.tr242a-badge-critical { background: #fee2e2; color: #dc2626; }
.tr242a-badge-reversed {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #f3f4f6;
  color: #6b7280;
  text-decoration: line-through;
}
.tr242a-badge-pin {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fff3e8;
  color: #FF6B00;
  border: 1px solid #ffb366;
  cursor: pointer;
  transition: background 0.12s;
}
.tr242a-badge-pin:hover { background: #ffe0c2; }

/* ── PIN overlay ────────────────────────────────────────────── */
.tr242a-pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.55);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.tr242a-pin-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  width: 320px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  text-align: center;
}
.tr242a-pin-title {
  font-size: 16px;
  font-weight: 700;
  color: #1A1A2E;
  margin: 0 0 6px;
}
.tr242a-pin-sub {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 18px;
}
.tr242a-pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.tr242a-pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.tr242a-pin-dot.filled {
  background: #FF6B00;
  border-color: #FF6B00;
}
.tr242a-pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.tr242a-pin-key {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #1A1A2E;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, border-color 0.1s;
}
.tr242a-pin-key:hover { background: #f9fafb; border-color: #d1d5db; }
.tr242a-pin-key-del {
  font-size: 13px;
  color: #6b7280;
}
.tr242a-pin-cancel {
  font-size: 13px;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  transition: color 0.12s;
}
.tr242a-pin-cancel:hover { color: #374151; }
.tr242a-pin-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 6px;
  min-height: 18px;
}

/* ── Empty state ────────────────────────────────────────────── */
.tr242a-empty {
  text-align: center;
  padding: 48px 24px;
  color: #9ca3af;
  font-size: 14px;
}
.tr242a-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

/* ── Muted ──────────────────────────────────────────────────── */
.tr242a-muted { color: #9ca3af; }
.tr242a-ml-auto { margin-left: auto; }
