/* TabLink Validation Service — Light Mode */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: #f8f9fa;
  color: #212529;
}

.main-content {
  margin-top: 52px;
  padding: 0.75rem 0;
  min-height: calc(100vh - 52px);
}

.page {
  display: none;
}
.page.active {
  display: block;
}

/* Compact upload bar */
.upload-bar {
  border-radius: 6px;
}

.upload-zone-compact {
  cursor: pointer;
  padding: 0.25rem 0;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.upload-zone-compact:hover {
  background-color: rgba(13, 110, 253, 0.05);
}
.upload-zone-compact.drag-over {
  background-color: rgba(13, 110, 253, 0.08);
  outline: 2px dashed #0d6efd;
  outline-offset: -2px;
}

/* Nav pills compact */
.nav-link-sm {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
}

.badge-sm {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

/* Results summary strip */
.summary-strip {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.82rem;
}
.summary-strip .label {
  color: #6c757d;
}
.summary-strip .value {
  font-weight: 600;
}
.cache-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cache-hit {
  background: #d1ecf1;
  color: #0c5460;
}
.cache-coalesced {
  background: #e2d5f1;
  color: #4a2072;
}
.cache-simple {
  background: #fff3cd;
  color: #664d03;
}

/* Compact rules table */
.rules-table {
  font-size: 0.8rem;
}
.rules-table th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 1;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
}
.rules-table td {
  padding: 0.3rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
}

/* Row backgrounds for validation status */
.rules-table tr.row-error td {
  background-color: #fff0f0;
}
.rules-table tr.row-warning td {
  background-color: #fffbeb;
}
.rules-table tr.row-pass td {
  background-color: #ffffff;
}
.rules-table tr.row-na td {
  background-color: #f8f9fa;
}

.rules-table tr:hover td {
  filter: brightness(0.97);
}

/* Status icons */
.icon-error {
  color: #dc3545;
}
.icon-warning {
  color: #d29922;
}
.icon-pass {
  color: #198754;
}
.icon-na {
  color: #6c757d;
}
.icon-skip {
  color: #6c757d;
}

/* Severity badge */
.sev-error {
  background-color: #f8d7da;
  color: #842029;
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}
.sev-warning {
  background-color: #fff3cd;
  color: #664d03;
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

/* Table containers */
.table-scroll {
  max-height: calc(100vh - 250px);
  overflow-y: auto;
}

/* History table */
.history-table {
  font-size: 0.8rem;
}
.history-table th {
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
}
.history-table td {
  padding: 0.3rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid #e9ecef;
}

/* Error details */
.err-detail {
  font-size: 0.75rem;
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.3rem;
}
.err-detail-error {
  background: #fff5f5;
  border: 1px solid #f5c2c7;
}
.err-detail-warning {
  background: #fffbeb;
  border: 1px solid #ffe69c;
}
.err-group {
  margin-bottom: 0.6rem;
}
.err-group-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  border-radius: 5px 5px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.err-group-header + .err-group-body {
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 5px 5px;
  padding: 0.3rem;
}
.err-group-body .err-detail:last-child {
  margin-bottom: 0;
}
.err-group-count {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
}

.cursor-pointer {
  cursor: pointer;
}

/* Pagination */
.pagination-sm .page-link {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
}

/* Card compact */
.card-header.py-2 h6 {
  font-size: 0.85rem;
}

/* Scrollbar styling */
.table-scroll::-webkit-scrollbar {
  width: 6px;
}
.table-scroll::-webkit-scrollbar-track {
  background: #f8f9fa;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 3px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* Tab content panels */
.tab-panel {
  border: 1px solid #dee2e6;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  padding: 0.5rem;
  background: #ffffff;
}

/* HTML Preview iframe */
.preview-frame {
  width: 100%;
  height: calc(100vh - 280px);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #fff;
}

/* ===================== Tables Tab ===================== */
.tbl-accordion {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tbl-card {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.tbl-card-error {
  border-left: 3px solid #dc3545;
}
.tbl-card-warning {
  border-left: 3px solid #ffc107;
}
.tbl-card-pass {
  border-left: 3px solid #198754;
}

.tbl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
}
.tbl-card-header:hover {
  background-color: #f8f9fa;
}
.tbl-card-header code {
  font-size: 0.85rem;
}
.tbl-card-name {
  word-break: break-word;
}

.tbl-chevron {
  font-size: 0.7rem;
  color: #6c757d;
  transition: transform 0.2s;
  transform: rotate(180deg);
}
.tbl-card-header.collapsed .tbl-chevron {
  transform: rotate(0deg);
}

.tbl-stat {
  font-size: 0.75rem;
  color: #6c757d;
  white-space: nowrap;
}

.tbl-card-body {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e9ecef;
}

/* Sections inside expanded card */
.tbl-section {
  margin-bottom: 0.75rem;
}
.tbl-section:last-child {
  margin-bottom: 0;
}
.tbl-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e9ecef;
}

/* Error items */
.tbl-err {
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}
.tbl-err-error {
  background: #fff5f5;
  border: 1px solid #f5c2c7;
}
.tbl-err-warning {
  background: #fffbeb;
  border: 1px solid #ffe69c;
}
.tbl-err-code {
  font-family: SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #495057;
  background: #e9ecef;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
}
.tbl-err-sev {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  white-space: nowrap;
}
.tbl-err-error .tbl-err-sev {
  background: #f8d7da;
  color: #842029;
}
.tbl-err-warning .tbl-err-sev {
  background: #fff3cd;
  color: #664d03;
}
.tbl-err-msg {
  font-size: 0.76rem;
  color: #495057;
  word-break: break-word;
}
.tbl-err-detail {
  font-size: 0.74rem;
  margin-top: 0.2rem;
  padding-left: 0.25rem;
}
.tbl-err-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6c757d;
  margin-right: 0.25rem;
}

/* Value display */
.tbl-val-reported {
  color: #842029;
  background: #f8d7da;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.74rem;
}
.tbl-val-expected {
  color: #0a5838;
  background: #d1e7dd;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.74rem;
}

/* Cells table inside expanded card */
.tbl-cells-table {
  font-size: 0.76rem;
}
.tbl-cells-table th {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 1;
  padding: 0.3rem 0.4rem;
  font-weight: 600;
  font-size: 0.72rem;
  white-space: nowrap;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
}
.tbl-cells-table td {
  padding: 0.25rem 0.4rem;
  vertical-align: top;
  border-bottom: 1px solid #e9ecef;
}

/* Stats grid */
.tbl-stats-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.tbl-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  padding: 0.4rem 0.6rem;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}
.tbl-stat-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: #212529;
}
.tbl-stat-label {
  font-size: 0.66rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Row backgrounds for cells table */
.tbl-cells-table tr.row-error td {
  background-color: #fff0f0;
}
.tbl-cells-table tr.row-warning td {
  background-color: #fffbeb;
}

/* Column badges */
.tbl-col-badge {
  font-size: 0.68rem;
  background: #e9ecef;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  color: #495057;
}
