:root {
  /* Customs / shipping-portal palette (navy + gold) */
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --navy: #0b2e4e;
  --navy-deep: #072038;
  --navy-mid: #13406a;
  --gold: #c9a227;
  --gold-soft: #f7efd0;
  --primary: #0b4f7a;
  --primary-hover: #083d5e;
  --primary-soft: #e3eef5;
  --text: #1a2433;
  --text-muted: #5a6b7d;
  --border: #d5dde6;
  --border-strong: #b8c4d1;
  --success: #1a6b3c;
  --success-soft: #e6f4ec;
  --danger: #a32020;
  --danger-soft: #fceaea;
  --warning: #9a5b00;
  --warning-soft: #fff4e0;
  --shadow: 0 1px 3px rgba(11, 46, 78, 0.08);
  --radius: 4px;
  --sidebar-w-expanded: 210px;
  --sidebar-w-collapsed: 74px;
  --sidebar-w: var(--sidebar-w-expanded);
  --sticky-col-1-w: 4.5rem;
  --sticky-col-2-left: 4.5rem;
  --content-max: 100%;
  --content-pad-x: clamp(0.5rem, 1vw, 0.85rem);
  --content-pad-y: clamp(0.4rem, 0.8vw, 0.65rem);
  --table-max-h: min(70dvh, 720px);
  --panel-ease: cubic-bezier(.2, .8, .2, 1);
  --panel-ms: .16s;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(11, 46, 78, 0.04) 0%, transparent 12rem);
  color: var(--text);
  line-height: 1.4;
  font-size: clamp(12.5px, 0.85vw + 10px, 14px);
  min-height: 100dvh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

/* App shell */
.app-shell {
  display: flex;
  min-height: 100dvh;
  width: 100%;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(7, 32, 56, 0.45);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  align-items: center;
  gap: .65rem;
  padding: .65rem var(--content-pad-x);
  background: var(--navy);
  color: #fff;
  border-bottom: 2px solid var(--gold);
}

.mobile-topbar-mark {
  width: 28px;
  height: 28px;
  background: #ffffff;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  flex-shrink: 0;
}

.mobile-brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mobile-topbar-title {
  font-weight: 700;
  font-size: .95rem;
}

.mobile-menu-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: var(--sidebar-w);
  height: 100dvh;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-right: none;
  box-shadow: 2px 0 8px rgba(7, 32, 56, 0.25);
  display: flex;
  flex-direction: column;
  transition: width var(--panel-ms) var(--panel-ease), transform var(--panel-ms) var(--panel-ease);
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--gold) 0%, #a8841a 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem .7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 52px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar-brand-mark {
  width: 30px;
  height: 30px;
  background: #ffffff;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.sidebar-brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-brand-text {
  font-weight: 650;
  font-size: .88rem;
  color: #f0f5fa;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.sidebar-collapse-btn {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
  padding: 0;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: .65rem .45rem;
  overflow: hidden;
}

.sidebar-section-header {
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a5b4fc;
  padding: 0.85rem 0.6rem 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-section-header:first-child {
  padding-top: 0.2rem;
}

html.sidebar-collapsed .sidebar-section-header {
  display: none !important;
}

html.sidebar-collapsed .sidebar-section-header:not(:first-child) {
  display: block !important;
  height: 1px;
  min-height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 10px 6px !important;
  padding: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
  overflow: hidden;
  border: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .55rem;
  border-radius: 3px;
  color: rgba(232, 240, 248, 0.78);
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(201, 162, 39, 0.22);
  color: #ffe9a0;
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-link-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.sidebar-link-label {
  overflow: hidden;
}

html.sidebar-collapsed {
  --sidebar-w: var(--sidebar-w-collapsed);
}

html.sidebar-collapsed .sidebar-brand {
  padding: .75rem .5rem;
  gap: .35rem;
  justify-content: space-between;
}

html.sidebar-collapsed .sidebar-brand-text,
html.sidebar-collapsed .sidebar-link-label {
  display: none !important;
}

html.sidebar-collapsed .sidebar-brand-mark {
  width: 28px;
  height: 28px;
  padding: 2px;
  flex-shrink: 0;
}

html.sidebar-collapsed .sidebar-collapse-btn {
  width: 22px;
  height: 22px;
  margin-left: auto;
  flex-shrink: 0;
}

html.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
  width: 14px;
  height: 14px;
}

html.sidebar-collapsed .sidebar-nav {
  padding: .65rem .4rem;
}

html.sidebar-collapsed .sidebar-link {
  padding: .6rem;
  justify-content: center;
  gap: 0;
}

html.sidebar-collapsed .sidebar-link-icon {
  margin: 0;
}

.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  width: 100%;
  transition: margin-left var(--panel-ms) var(--panel-ease);
}

.main-content {
  padding: var(--content-pad-y) var(--content-pad-x) clamp(0.5rem, 1vw, 0.85rem);
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* Page toolbar */
.page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.page-toolbar>div:first-child {
  min-width: min(100%, 16rem);
  flex: 1 1 14rem;
}

.page-title {
  margin: 0;
  font-size: clamp(1.05rem, 1.2vw + 0.7rem, 1.35rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.01em;
}

.page-subtitle {
  margin: .25rem 0 0;
  color: var(--text-muted);
  font-size: .82rem;
}

.page-toolbar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* Panels */
.portal-main-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.portal-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: .75rem clamp(.75rem, 1.5vw, 1rem);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f7fafc 0%, #eef3f7 100%);
  flex-wrap: wrap;
}

.portal-panel-title {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.portal-panel-sub {
  margin: .25rem 0 0;
  color: var(--text-muted);
  font-size: .78rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.portal-panel-body {
  padding: clamp(.75rem, 1.5vw, 1rem);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .42rem .85rem;
  border-radius: 3px;
  border: 1px solid transparent;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  text-decoration: none;
  background: var(--primary-soft);
  border-color: #8eb4cb;
  color: var(--primary);
}

.btn:hover:not(:disabled) {
  background: #d4e6f0;
  color: var(--primary-hover);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--navy);
  border-color: var(--navy-deep);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-mid);
  border-color: var(--navy);
  color: #fff;
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--navy-mid);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--navy);
  border-color: var(--navy-mid);
}

.btn-sm {
  padding: .25rem .55rem;
  font-size: .78rem;
}

.btn-xs {
  padding: .15rem .45rem;
  font-size: .72rem;
  min-height: 24px;
  line-height: 1.2;
}

.btn-link {
  background: transparent;
  border: 1px solid transparent;
  color: var(--primary);
  text-decoration: underline;
  padding: .15rem .4rem;
  font-size: .72rem;
  cursor: pointer;
}

.btn-link:hover {
  color: var(--navy);
  text-decoration: underline;
}

.btn-lg {
  padding: .65rem 1.25rem;
  font-size: .92rem;
  min-height: 2.75rem;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

/* Prefer comfortable tap targets on touch devices */
@media (pointer: coarse) {

  .btn,
  .file-btn,
  .batch-chip,
  .page-btn,
  .filter-input,
  .per-page-select {
    min-height: 2.75rem;
  }

  .btn-sm {
    min-height: 2.4rem;
    padding: .4rem .7rem;
  }

  .page-btn {
    min-width: 2.4rem;
    height: 2.4rem;
  }
}

/* Form bits */
.file-btn {
  display: inline-flex;
  align-items: center;
  padding: .45rem .9rem;
  border: 1px dashed var(--navy-mid);
  background: var(--primary-soft);
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
}

.file-btn:hover {
  background: #d4e6f0;
  border-style: solid;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  color: var(--text-muted);
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: .85rem;
  flex-wrap: wrap;
}

.muted {
  color: var(--text-muted);
}

/* Status / progress */
.status-line {
  margin: .75rem 0 0;
  min-height: 1.2em;
  color: var(--text-muted);
}

.progress-box {
  margin-top: .85rem;
  display: none;
}

.progress-box.visible {
  display: block;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-mid) 60%, var(--gold) 100%);
  border-radius: 3px;
  animation: progress-indeterminate 1.8s infinite ease-in-out;
  transition: width .25s ease;
}

.progress-bar.determinate {
  animation: none;
  width: 0%;
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(80%);
  }

  100% {
    transform: translateX(250%);
  }
}

.result {
  margin-top: .85rem;
  padding: .75rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  line-height: 1.5;
}

.result.ok {
  border-left: 3px solid var(--success);
  background: var(--success-soft);
}

.result.err {
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
}

.result.partial {
  border-left: 3px solid var(--warning);
  background: var(--warning-soft);
}

.result ul {
  margin: .4rem 0 0;
  padding-left: 1.1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .45rem;
  border-radius: 2px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-done,
.badge-ok {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid #b7dcc6;
}

.badge-failed,
.badge-err {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #e8b4b4;
}

.badge-partial,
.badge-processing,
.badge-pending {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid #efd39a;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
}

.stat-card:nth-child(2) {
  border-left-color: var(--navy-mid);
}

.stat-card:nth-child(3) {
  border-left-color: var(--gold);
}

.stat-label {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 750;
  color: var(--navy);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Tables */
.table-scroll,
.excel-table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: var(--table-max-h);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: clamp(11.5px, 0.2vw + 11px, 13px);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: .45rem .55rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--navy);
  color: #e8f0f7;
  font-weight: 650;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gold);
  padding: .5rem .55rem;
}

.data-table tbody tr:nth-child(even) td {
  background: #f7fafc;
}

.data-table tbody tr:hover td {
  background: #eaf2f8;
}

.data-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: var(--sticky-col-1-w);
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}

.data-table th.sticky-col {
  z-index: 4;
  background: var(--navy);
  color: #e8f0f7;
}

.data-table .sticky-col-2 {
  position: sticky;
  left: var(--sticky-col-2-left);
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border);
}

.data-table th.sticky-col-2 {
  z-index: 4;
  background: var(--navy);
  color: #e8f0f7;
}

.data-table tbody tr:nth-child(even) .sticky-col,
.data-table tbody tr:nth-child(even) .sticky-col-2 {
  background: #f7fafc;
}

.data-table tbody tr:hover .sticky-col,
.data-table tbody tr:hover .sticky-col-2 {
  background: #eaf2f8;
}

.data-table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table .col-desc {
  max-width: clamp(8rem, 18vw, 16rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-panel-body {
  padding: 0;
}

.table-panel-body .excel-table-wrap {
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.batches-table {
  min-width: 40rem;
}

.excel-table {
  min-width: 58rem;
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--text-muted);
  font-size: .8rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: .35rem;
}

.page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 .4rem;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 4px;
  cursor: pointer;
  font-size: .78rem;
  color: var(--text);
  font-family: inherit;
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-2);
}

.page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.page-btn.active {
  background: var(--navy);
  border-color: var(--navy-deep);
  color: #fff;
  font-weight: 650;
}

.per-page-select {
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: .25rem .4rem;
  font-size: .78rem;
  font-family: inherit;
  background: var(--surface);
}

.batch-chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding-top: .75rem !important;
  padding-bottom: .75rem !important;
}

.batch-chip {
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--navy);
  border-radius: 3px;
  padding: .35rem .65rem;
  font-size: .78rem;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
}

.batch-chip:hover {
  background: var(--primary-soft);
  border-color: var(--navy-mid);
}

.batch-chip.active {
  background: var(--navy);
  border-color: var(--navy-deep);
  color: #fff;
}

.records-toolbar {
  align-items: center;
}

.records-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  flex: 1;
  min-width: 0;
}

.records-filter-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.per-page-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.filter-input {
  flex: 1 1 16rem;
  min-width: 12rem;
  max-width: 28rem;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: .4rem .55rem;
  font-size: .85rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

/* Import dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 6px;
  background:
    linear-gradient(180deg, #f8fbfd 0%, var(--surface) 100%);
  padding: 1.35rem 1rem;
  text-align: center;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--navy-mid);
  background: var(--primary-soft);
}

.dropzone.is-dragover {
  border-color: var(--gold);
  border-style: solid;
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}

.dropzone-icon {
  color: var(--navy-mid);
  margin-bottom: .35rem;
}

.dropzone-title {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
}

.dropzone-sub {
  margin: .25rem 0 .85rem;
  font-size: .82rem;
}

.dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-bottom: .65rem;
}

.dropzone-selection {
  margin: 0;
  font-size: .82rem;
  word-break: break-word;
}

.import-actions {
  margin-top: 1rem;
}

.import-actions .btn-lg {
  width: min(100%, 18rem);
}

.desktop-only {
  display: inline-flex;
}

/* Bottom tab bar (phones) */
.bottom-nav {
  display: none;
}

.mobile-topbar-mark {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 800;
  font-size: .72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-topbar-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.mobile-topbar-page {
  font-size: .72rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.mobile-topbar-page:empty {
  display: none;
}

.filter-input:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--navy-mid);
}

.filter-select {
  min-width: 10rem;
  padding: .4rem .45rem;
}

/* Batch meta */
.batch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: .35rem;
}

.batch-meta strong {
  color: var(--text);
  font-weight: 650;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* Dashboard */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding: 0.48rem 0.85rem;
  background:
    linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 55%, #1a5a8a 100%);
  border-radius: var(--radius);
  border-bottom: 2.5px solid var(--gold);
  color: #e8f0f7;
  box-shadow: var(--shadow);
}

.dash-hero .page-title {
  color: #fff;
  font-size: 1.12rem;
  line-height: 1.2;
  margin: 0;
}

.dash-hero .page-subtitle {
  color: rgba(232, 240, 248, 0.78);
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.dash-hero-actions {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}

.dash-hero-actions .btn-primary {
  background: var(--gold);
  border-color: #a8841a;
  color: var(--navy-deep);
  height: 28px;
  padding: 0.2rem 0.6rem;
  font-size: 0.76rem;
}

.dash-hero-actions .btn-primary:hover:not(:disabled) {
  background: #e0b93a;
  border-color: var(--gold);
  color: var(--navy-deep);
}

.dash-hero-actions .btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  height: 28px;
  padding: 0.2rem 0.6rem;
  font-size: 0.76rem;
}

.dash-hero-actions .btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: .45rem;
  margin-bottom: 0.6rem;
}

@media (min-width: 1200px) {
  .dash-kpi-row {
    grid-template-columns: repeat(6, 1fr);
  }
}

.dash-kpi {
  display: flex;
  gap: .45rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2.5px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(11, 46, 78, 0.04);
  padding: .38rem .55rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.dash-kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(11, 46, 78, 0.08);
}

.dash-kpi.accent-gold {
  border-top-color: var(--gold);
}

.dash-kpi .stat-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.1;
}

.dash-kpi .stat-value {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0.08rem 0 0;
}

.dash-kpi-icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.dash-kpi-meta {
  margin: .08rem 0 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: .55rem;
  margin-bottom: 0.75rem;
}

.dash-panel {
  margin-bottom: 0;
}

.dash-health-body {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.dash-ring-wrap {
  flex-shrink: 0;
}

.dash-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#d5dde6 0% 100%);
  display: grid;
  place-items: center;
  position: relative;
}

.dash-ring::before {
  content: '';
  position: absolute;
  inset: 14px;
  background: var(--surface);
  border-radius: 50%;
}

.dash-ring-center {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.dash-ring-center strong {
  font-size: 1.35rem;
  color: var(--navy);
}

.dash-ring-center span {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 1;
  min-width: 140px;
}

.dash-legend li {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .85rem;
}

.dash-legend strong {
  margin-left: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.swatch.done {
  background: #1a6b3c;
}

.swatch.partial {
  background: #c9a227;
}

.swatch.failed {
  background: #a32020;
}

.value-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.value-row-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .3rem;
  font-size: .82rem;
  color: var(--text-muted);
}

.value-row-top strong {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.value-track,
.rank-track {
  height: 8px;
  background: #e8eef3;
  border-radius: 2px;
  overflow: hidden;
}

.value-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width .4s ease;
}

.value-fill.fob {
  background: var(--navy);
}

.value-fill.dbk {
  background: var(--navy-mid);
}

.value-fill.rodtep {
  background: var(--gold);
}

.rank-row {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin-bottom: .75rem;
}

.rank-row:last-child {
  margin-bottom: 0;
}

.rank-idx {
  width: 22px;
  height: 22px;
  border-radius: 2px;
  background: var(--navy);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.rank-body {
  flex: 1;
  min-width: 0;
}

.rank-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .82rem;
  margin-bottom: .25rem;
}

.rank-top span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.rank-top strong {
  color: var(--text-muted);
  font-weight: 650;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.rank-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-mid), var(--gold));
  border-radius: 2px;
  transition: width .4s ease;
}

.activity-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
  gap: .65rem;
}

.activity-card {
  display: block;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--navy-mid);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.activity-card:hover {
  background: #fff;
  border-color: var(--navy-mid);
  box-shadow: var(--shadow);
  color: inherit;
}

.activity-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .4rem;
  margin-bottom: .4rem;
}

.activity-batch {
  font-size: .75rem;
  font-weight: 700;
  color: var(--navy);
}

.activity-folder {
  display: block;
  font-size: .9rem;
  margin-bottom: .45rem;
  color: var(--text);
}

.activity-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
}

.activity-when {
  font-size: .7rem;
  color: var(--text-muted);
}

.port-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px dashed var(--border);
}

.port-chips-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: .25rem;
}

.port-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .5rem;
  background: var(--primary-soft);
  border: 1px solid #b7c9d6;
  border-radius: 2px;
  font-size: .75rem;
  color: var(--navy);
  font-weight: 600;
}

.port-chip em {
  font-style: normal;
  color: var(--text-muted);
  font-weight: 650;
}

.dash-empty-cta {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
}

.dash-empty-cta .btn {
  margin-top: .5rem;
}

/* Dashboard tabs + Insights */
.dash-tabs {
  display: flex;
  gap: .3rem;
  margin: 0 0 0.5rem;
  padding: .18rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  width: fit-content;
  max-width: 100%;
}

.dash-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .76rem;
  font-weight: 700;
  padding: .28rem .75rem;
  border-radius: 4px;
  cursor: pointer;
  min-height: 1.95rem;
  display: inline-flex;
  align-items: center;
}

.dash-tab:hover {
  color: var(--navy);
  background: var(--surface-2);
}

.dash-tab.active {
  background: var(--navy);
  color: #fff;
}

.dash-tab-panel[hidden] {
  display: none !important;
}

.fy-filter {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: rgba(232, 240, 248, 0.85);
  font-size: .78rem;
  font-weight: 650;
}

.fy-filter .per-page-select {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.fy-filter .per-page-select option {
  color: var(--text);
}

.spark-panel .portal-panel-body {
  padding-top: .5rem;
}

.sparkline {
  width: 100%;
  height: 72px;
}

.spark-svg {
  width: 100%;
  height: 72px;
  display: block;
}

/* Insights — glance board (numbers first) */
.signal-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}

.signal-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .85rem .9rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--navy-mid);
  min-height: 6.5rem;
}

.signal-tile.tone-ok {
  border-top-color: var(--success);
}

.signal-tile.tone-warn {
  border-top-color: var(--gold);
}

.signal-tile.tone-critical {
  border-top-color: var(--danger);
}

.signal-tile.tone-info {
  border-top-color: var(--navy);
}

.signal-label {
  margin: 0 0 .35rem;
  font-size: .68rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.signal-big {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.signal-sub {
  margin: .35rem 0 0;
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glance-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: .75rem;
}

.glance-split-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.glance-panel {
  margin-bottom: 0;
}

.share-row {
  margin-bottom: .75rem;
}

.share-row:last-child {
  margin-bottom: 0;
}

.share-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .25rem;
}

.share-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-pct {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.share-track {
  height: 10px;
  background: #e8eef3;
  border-radius: 3px;
  overflow: hidden;
}

.share-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-mid), var(--navy));
  border-radius: 3px;
  min-width: 2px;
}

.share-fill-warn {
  background: linear-gradient(90deg, #c9a227, #a8841a);
}

.share-amt {
  margin-top: .2rem;
  font-size: .72rem;
}

.watch-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.watch-ul li {
  padding: .55rem .65rem;
  border-radius: 4px;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
  border-left: 3px solid var(--gold);
  background: var(--warning-soft);
  color: var(--text);
}

.watch-ul li a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.watch-ul li a:hover {
  color: var(--navy);
}

.watch-ok {
  margin: 0;
  padding: .75rem;
  text-align: center;
  color: var(--success);
  font-weight: 650;
  background: var(--success-soft);
  border-radius: 4px;
}

/* Large desktops: use full width comfortably */
@media (min-width: 1400px) {
  :root {
    --content-max: 1680px;
    --table-max-h: min(72dvh, 860px);
  }

  .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1800px) {
  :root {
    --content-max: 1920px;
    --content-pad-x: 1rem;
  }
}

/* Laptops / tablets landscape */
@media (max-width: 1100px) {
  :root {
    --table-max-h: min(65dvh, 640px);
  }

  .dash-hero {
    flex-wrap: wrap;
    align-items: stretch;
  }
}

/* Phones / small tablets — bottom tabs + stacked cards */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --table-max-h: min(55dvh, 480px);
    --sticky-col-1-w: 3.75rem;
    --sticky-col-2-left: 3.75rem;
    --bottom-nav-h: calc(3.5rem + env(safe-area-inset-bottom, 0px));
    --content-pad-x: 0.85rem;
  }

  .mobile-topbar {
    display: flex;
    padding-top: calc(.55rem + env(safe-area-inset-top, 0px));
  }

  .sidebar,
  .sidebar-overlay,
  .sidebar-collapse-btn {
    display: none !important;
  }

  .main-wrap {
    margin-left: 0;
    padding-bottom: var(--bottom-nav-h);
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    height: var(--bottom-nav-h);
    padding: .35rem .4rem calc(.35rem + env(safe-area-inset-bottom, 0px));
    background: var(--navy-deep);
    border-top: 2px solid var(--gold);
    box-shadow: 0 -4px 16px rgba(7, 32, 56, 0.28);
  }

  .bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    color: rgba(232, 240, 248, 0.65);
    font-size: .68rem;
    font-weight: 650;
    text-decoration: none;
    border-radius: 6px;
    min-height: 2.75rem;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-link:hover {
    color: #fff;
  }

  .bottom-nav-link.active {
    color: #ffe9a0;
    background: rgba(201, 162, 39, 0.18);
  }

  .bottom-nav-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
  }

  .desktop-only {
    display: none !important;
  }

  .dropzone {
    padding: 1.1rem .85rem;
  }

  .dropzone-actions .btn {
    flex: 1 1 8rem;
  }

  .import-actions .btn-lg {
    width: 100%;
  }

  .dash-hero {
    flex-direction: column;
    align-items: stretch;
    padding: .9rem 1rem;
  }

  .dash-hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .dash-hero-actions .btn {
    flex: 1;
    min-height: 2.75rem;
  }

  .fy-filter {
    width: 100%;
    justify-content: space-between;
  }

  .fy-filter .per-page-select {
    flex: 1;
  }

  .dash-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dash-tab {
    width: 100%;
    text-align: center;
  }

  .signal-board {
    grid-template-columns: 1fr 1fr;
  }

  .glance-split,
  .glance-split-3 {
    grid-template-columns: 1fr;
  }

  .signal-big {
    font-size: 1.35rem;
  }

  .dash-kpi-row {
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
  }

  .dash-kpi {
    flex-direction: column;
    gap: .45rem;
    padding: .75rem;
  }

  .dash-kpi .stat-value {
    font-size: 1.2rem;
  }

  .page-toolbar-actions {
    width: 100%;
  }

  .page-toolbar-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .portal-panel-title {
    font-size: .82rem;
  }

  .records-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .records-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-input {
    min-width: 0;
    max-width: none;
    width: 100%;
    font-size: 16px;
    /* avoid iOS zoom on focus */
  }

  .records-filter-actions {
    width: 100%;
  }

  .records-filter-actions .btn {
    flex: 1;
  }

  .per-page-wrap {
    align-self: flex-start;
  }

  .data-table .sticky-col-2 {
    left: var(--sticky-col-2-left);
  }

  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Batches as stacked cards on phone */
  .card-table thead {
    display: none;
  }

  .card-table,
  .card-table tbody,
  .card-table tr,
  .card-table td {
    display: block;
    width: 100%;
  }

  .card-table {
    min-width: 0 !important;
    border: none;
  }

  .card-table tbody {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding: .65rem;
  }

  .card-table tr {
    border: 1px solid var(--border);
    border-left: 3px solid var(--navy);
    border-radius: 6px;
    background: var(--surface);
    padding: .55rem .7rem .65rem;
    box-shadow: var(--shadow);
  }

  .card-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .28rem 0;
    border: none;
    background: transparent !important;
    white-space: normal;
    text-align: right;
  }

  .card-table td::before {
    content: attr(data-label);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
  }

  .card-table td.sticky-col {
    position: static;
    box-shadow: none;
    font-weight: 750;
    color: var(--navy);
    font-size: .95rem;
    padding-bottom: .45rem;
    margin-bottom: .2rem;
    border-bottom: 1px solid var(--border);
  }

  .card-table td.sticky-col::before {
    display: none;
  }

  .card-table td.card-actions {
    justify-content: flex-end;
    padding-top: .55rem;
    margin-top: .25rem;
    border-top: 1px dashed var(--border);
  }

  .card-table td.card-actions::before {
    display: none;
  }

  .card-table .btn-group {
    width: 100%;
  }

  .card-table .btn-group .btn {
    flex: 1;
    justify-content: center;
  }

  .table-scroll:has(.card-table) {
    max-height: none;
    border: none;
    background: transparent;
  }

  .result {
    font-size: .85rem;
    word-break: break-word;
  }

  .result ul {
    padding-left: 1rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .dash-kpi-row {
    grid-template-columns: 1fr;
  }

  .mobile-topbar-title {
    font-size: .88rem;
  }
}

/* ==========================================================================
   Trade Analyst Studio & Cockpit Styles
   ========================================================================== */

/* Hero badge */
.hero-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--navy-mid);
  color: #fff;
  border: 1px solid rgba(201, 162, 39, 0.4);
}

.hero-badge-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Single-line filter bar */
.slicer-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  flex-shrink: 0;
}

.slicer-group {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  flex: 1 1 130px;
  min-width: 120px;
  position: relative;
}

.slicer-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.1;
  margin: 0;
}

.slicer-select {
  width: 100%;
  padding: 0.18rem 0.45rem;
  font-size: 0.76rem;
  font-weight: 500;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: #fff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.slicer-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(11, 79, 122, 0.12);
}

.slicer-date-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  text-align: left;
  white-space: nowrap;
}

.slicer-date-btn svg { color: var(--text-muted); flex-shrink: 0; }

.slicer-group-date { flex: 1.5 1 190px; }

.date-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(11, 46, 78, 0.18);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.date-popover[hidden] { display: none; }

.date-presets { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.date-presets button {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.date-presets button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.date-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.date-inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.date-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }

.slicer-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  height: 28px;
}

.slicer-status {
  display: none;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

@media (min-width: 1500px) {
  .slicer-status { display: inline-flex; }
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(26, 107, 60, 0.2);
}

.active-pills {
  color: var(--primary);
  font-weight: 600;
}

/* Tab Icon */
.dash-tab-icon {
  margin-right: 0.35rem;
}

/* Questions Toolbar */
.questions-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.question-search-wrap {
  position: relative;
  flex: 1 1 240px;
  max-width: 380px;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 13px;
  height: 13px;
}

.question-search-input {
  width: 100%;
  padding: 0.2rem 0.55rem 0.2rem 1.85rem;
  font-size: 0.78rem;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(11, 46, 78, 0.04);
  transition: all 0.18s ease;
}

.question-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(11, 79, 122, 0.12);
}

.question-category-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  flex: 2 1 auto;
}

.cat-pill {
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.25;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.cat-pill.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 1px 3px rgba(11, 46, 78, 0.15);
}

/* Cockpit KPI Cards Row */
.cockpit-highlight-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

@media (min-width: 1024px) {
  .cockpit-highlight-row {
    grid-template-columns: repeat(5, 1fr);
  }
}

.c-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.38rem 0.6rem;
  box-shadow: 0 1px 2px rgba(11, 46, 78, 0.04);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  overflow: hidden;
}

.c-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.c-kpi-card.tone-primary::before {
  background: var(--primary);
}

.c-kpi-card.tone-danger::before {
  background: var(--danger);
}

.c-kpi-card.tone-success::before {
  background: var(--success);
}

.c-kpi-card.tone-warning::before {
  background: var(--gold);
}

.c-kpi-card.tone-info::before {
  background: #6a3d9a;
}

.c-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(11, 46, 78, 0.08);
}

.c-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.1rem;
}

.c-kpi-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.c-kpi-badge {
  font-size: 0.58rem;
  font-weight: 750;
  padding: 0.04rem 0.25rem;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--navy);
  border: 1px solid var(--border);
}

.c-kpi-val {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 0.08rem;
}

.tone-danger .c-kpi-val {
  color: var(--danger);
}

.tone-success .c-kpi-val {
  color: var(--success);
}

.c-kpi-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.15;
}

/* Charts Grid */
.analyst-charts-section {
  margin-bottom: 1.25rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  padding: 0.5rem 0.5rem 0.35rem;
}

.doughnut-wrap {
  height: 200px;
}

/* Section Title Bar */
.section-title-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

.count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--primary);
  border: 1px solid var(--border);
}

/* 21 Questions Cards Grid */
.questions-section {
  margin-bottom: 2.5rem;
}

.questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

@media (max-width: 600px) {
  .questions-grid {
    grid-template-columns: 1fr;
  }
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: 0 1px 4px rgba(11, 46, 78, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.18s ease;
  position: relative;
}

.question-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(11, 46, 78, 0.1);
}

.question-card.sev-critical {
  border-left: 4px solid var(--danger);
}

.question-card.sev-warn {
  border-left: 4px solid var(--gold);
}

.question-card.sev-ok {
  border-left: 4px solid var(--success);
}

.question-card.sev-info {
  border-left: 4px solid var(--primary);
}

.q-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.q-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.q-num-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
}

.q-cat-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.q-title {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--navy);
  margin: 0 0 0.65rem 0;
  line-height: 1.35;
}

.q-metric-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.q-metric-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.q-metric-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
}

.sev-critical .q-metric-val {
  color: var(--danger);
}

.sev-warn .q-metric-val {
  color: var(--warning);
}

.sev-ok .q-metric-val {
  color: var(--success);
}

.q-summary {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.45;
  margin: 0 0 0.65rem 0;
}

.q-details-list {
  margin: 0 0 0.85rem 0;
  padding-left: 1.15rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.q-details-list li {
  margin-bottom: 0.2rem;
}

.q-footer {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.q-tip {
  font-size: 0.74rem;
  color: var(--navy-mid);
  background: var(--primary-soft);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  line-height: 1.35;
}

/* Analytical Tables Section */
.analytical-tables-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(11, 46, 78, 0.05);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mode-badge {
  font-size: 0.72rem;
  font-weight: 750;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.mode-sea {
  background: #e3eef5;
  color: #0b4f7a;
}

.mode-air {
  background: #f7efd0;
  color: #9a5b00;
}

.mode-land {
  background: #e6f4ea;
  color: #137333;
}

.mode-other {
  background: #f1f5f9;
  color: #475569;
}

.table-link {
  color: var(--navy);
  text-decoration: none;
  font-weight: 650;
  transition: color 0.15s ease;
}

.table-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.uqc-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  background: var(--surface-2);
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.link-bold {
  font-weight: 700;
  color: var(--primary);
}

.text-danger {
  color: var(--danger) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.btn-jump-table {
  width: 100%;
  justify-content: center;
  font-weight: 650;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  padding: 0.38rem 0.65rem;
  color: var(--primary);
  border-color: var(--border-strong);
  background: var(--surface-2);
  transition: all 0.16s ease;
}

.btn-jump-table:hover {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(11, 79, 122, 0.25);
}

.highlight-panel {
  animation: panelGlow 2.4s ease-out;
  scroll-margin-top: 80px;
}

@keyframes panelGlow {
  0% {
    box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.7), 0 8px 24px rgba(11, 46, 78, 0.15);
    transform: scale(1.006);
  }

  40% {
    box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.4), 0 4px 14px rgba(11, 46, 78, 0.1);
  }

  100% {
    box-shadow: 0 1px 3px rgba(11, 46, 78, 0.05);
    transform: scale(1);
  }
}

/* CTA Banner on Executive Overview */
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
  margin-bottom: 0.65rem;
  box-shadow: 0 1px 2px rgba(11, 46, 78, 0.04);
}

.cta-copy strong {
  display: block;
  font-size: 0.84rem;
  color: var(--navy);
  margin-bottom: 0.08rem;
}

.cta-copy p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Port Chips on Executive Overview */
.port-chips-box {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.port-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.port-chip-row:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.port-chip-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.port-chip-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.port-chip-code {
  font-size: 0.82rem;
  color: var(--navy);
  font-weight: 750;
}

.port-chip-name {
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.port-chip-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.port-chip-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  flex-shrink: 0;
}

.port-chip-tat {
  font-size: 0.85rem;
  font-weight: 750;
  color: var(--navy);
}

.port-chip-pct {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--success);
}

/* ==========================================
   Clickable Drill-down & SB Links
   ========================================== */
.sb-detail-link {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.sb-detail-link:hover {
  color: var(--navy);
}

.clickable-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.clickable-row:hover {
  background: var(--primary-soft) !important;
}

/* ==========================================
   Shipping Bill Inspector Modal
   ========================================== */
body.modal-open {
  overflow: hidden;
}

.sb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 46, 78, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.18s ease-out;
}

.sb-modal-backdrop[hidden] {
  display: none !important;
}

.sb-modal-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(11, 46, 78, 0.28);
  width: 100%;
  max-width: 920px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.22s ease-out;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sb-modal-head {
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sb-modal-head-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.sb-modal-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
}

.sb-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
}

.sb-modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sb-modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sb-modal-close:hover {
  background: var(--surface-2);
  color: var(--danger);
  border-color: var(--danger);
}

.sb-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Modal KPI Tiles */
.sb-modal-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}

.sb-kpi-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sb-kpi-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.sb-kpi-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy);
}

/* Modal Details Grid */
.sb-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 650px) {
  .sb-modal-grid {
    grid-template-columns: 1fr;
  }
}

.sb-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sb-card-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sb-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sb-val {
  font-size: 0.86rem;
  color: var(--text);
  word-break: break-word;
}

.sb-modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sb-modal-sec-title {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--navy);
  margin: 0;
}

.sb-modal-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* ==========================================
   Active Filter Tags on Records Page
   ========================================== */
.active-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(11, 46, 78, 0.04);
}

.filter-tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-tag-remove:hover {
  color: var(--danger);
}

.btn-clear-all-tags {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  text-decoration: underline;
}

/* Sortable Table Headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

th.sortable:hover,
th.sortable.sticky-col:hover,
th.sortable.sticky-col-2:hover {
  background: #15456f !important;
  color: #ffffff !important;
}

th.sortable::after {
  content: ' ↕';
  font-size: 0.72rem;
  opacity: 0.55;
  margin-left: 0.28rem;
  color: var(--gold);
}

th.sortable:hover::after {
  opacity: 1;
  color: #ffe9a0;
}

th.sortable.sort-asc::after {
  content: ' ▲';
  opacity: 1;
  color: var(--gold);
}

th.sortable.sort-desc::after {
  content: ' ▼';
  opacity: 1;
  color: var(--gold);
}

/* ==========================================================================
   Records Page: Export & Duty Summary Card (matching Tax Summary portal design)
   ========================================================================== */
.records-summary-card {
  margin: 0.6rem 0 0.85rem 0;
  background: #f0f5fa;
  border: 1px solid #bfd5e8;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(11, 46, 78, 0.05);
}

.summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  background: #edf4fa;
  cursor: pointer;
  user-select: none;
  gap: 0.75rem;
  transition: background-color 0.15s ease;
}

.summary-bar:hover {
  background: #e4edf6;
}

.summary-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.83rem;
  color: #1a2a3a;
}

.summary-icon {
  display: inline-flex;
  align-items: center;
  color: #0b3b64;
  opacity: 0.9;
}

.summary-title {
  color: #0b2e4e;
  font-weight: 750;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.summary-badge {
  background: #d4e7f7;
  color: #084370;
  border: 1px solid #b7d6f0;
  border-radius: 12px;
  padding: 0.12rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
}

.summary-inline-stats {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: #334d66;
  margin-left: 0.25rem;
}

.summary-inline-stats .sum-item {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  white-space: nowrap;
}

.summary-inline-stats .sum-lbl {
  color: #556c82;
  font-weight: 550;
}

.summary-inline-stats .sum-val {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.summary-inline-stats .sum-sep {
  color: #9cb1c7;
  font-weight: 700;
  font-size: 0.85rem;
}

.summary-bar-right {
  flex-shrink: 0;
}

.btn-summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #bfd3e6;
  border-radius: 4px;
  padding: 0.24rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: #0b3b64;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-summary-toggle:hover {
  background: #f0f7fd;
  border-color: #8fb6d8;
  color: #062a49;
}

.summary-table-wrap {
  border-top: 1px solid #bfd5e8;
  overflow-x: auto;
  background: #ffffff;
  animation: summaryFadeIn 0.18s ease-out;
}

@keyframes summaryFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.summary-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.summary-breakdown-table thead th {
  background: #0b3b64;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.85rem;
  border: none;
  white-space: nowrap;
}

.summary-breakdown-table thead th.col-num {
  text-align: right;
}

.summary-breakdown-table tbody td {
  padding: 0.52rem 0.85rem;
  border-bottom: 1px solid #e1e9f1;
  color: #1a2a3a;
  white-space: nowrap;
}

.summary-breakdown-table tbody td.col-num {
  text-align: right;
}

.cat-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: middle;
}

.cat-indicator-claimed {
  background: #1a6b3c;
}

.cat-indicator-diff {
  background: #c53030;
}

.cat-indicator-ineligible {
  background: #64748b;
}

/* Row diff styling matching GST portal "As per Diff" row */
.row-diff-highlight {
  background: #fff8e8 !important;
  border-bottom: 1px solid #ebd9b0 !important;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.row-diff-highlight:hover {
  background: #fdf0d2 !important;
}

.row-diff-highlight.row-filter-active {
  background: #fdecc3 !important;
  outline: 2px solid #e2a843;
}

.row-ineligible-highlight {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.row-ineligible-highlight:hover {
  background: #f1f5f9 !important;
}

.row-ineligible-highlight.row-filter-active {
  background: #e2e8f0 !important;
  outline: 2px solid #94a3b8;
}

.cell-diff-pink {
  background: #fde8e8 !important;
  color: #b32424 !important;
  font-weight: 750 !important;
}

.text-diff {
  color: #b32424 !important;
}

.diff-tag-btn {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 650;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: #fce5b5;
  color: #8c4a00;
  border: 1px solid #e5c488;
  vertical-align: middle;
}

.row-total-highlight {
  background: #f1f6fa !important;
  border-top: 2px solid #8eb3d4 !important;
  font-weight: 750;
}

.row-total-highlight td {
  color: #0b2e4e !important;
}
/* Records page: fit table to viewport height (no page scroll) */
@media (min-width: 769px) {
  .main-wrap:has(#records-table) {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .main-content:has(#records-table) {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0.5rem;
  }

  .main-content:has(#records-table) > .page-toolbar {
    flex-shrink: 0;
    margin-bottom: 0.6rem;
  }

  .main-content:has(#records-table) > .portal-main-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
  }

  .main-content:has(#records-table) > .portal-main-panel > .portal-panel-head,
  .main-content:has(#records-table) .active-filters-bar,
  .main-content:has(#records-table) .records-summary-card {
    flex-shrink: 0;
  }

  .main-content:has(#records-table) .table-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .main-content:has(#records-table) .excel-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }

  .main-content:has(#records-table) .pagination-bar {
    flex-shrink: 0;
  }
}

