:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #64748b;
  --line: #dbe3ee;
  --blue: #3a93ff;
  --navy: #102a4c;
  --gold: #f4c542;
  --red: #b42318;
  --green: #1d7a46;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, var(--bg) 55%);
}

.login-card,
.panel,
.stat,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 42, 76, 0.08);
}

.login-card {
  width: min(440px, 100%);
  padding: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
}

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

.btn.danger {
  border-color: var(--red);
  color: var(--red);
}

.btn.warning {
  border-color: #d97706;
  background: #f59e0b;
  color: #111827;
}

.btn.warning:hover:not(:disabled) {
  background: #d97706;
  color: #fff;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 16px;
}

.inline-x {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-weight: 900;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.icon-btn.edit {
  border-color: #bfd0e6;
  color: var(--blue);
}

.icon-btn.edit:hover {
  background: #eaf2fb;
}

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

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 2px 12px;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 156px;
  height: auto;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  border-radius: 6px;
  color: #334155;
  padding: 10px 12px;
  font-weight: 700;
}

.nav a.nav-child {
  margin-left: 14px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  background: #eef3f9;
  color: var(--navy);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voyage-header-indicator {
  min-width: 0;
}

.shift-header-indicator {
  min-width: 0;
}

.voyage-header-indicator:not(.visible) {
  display: none;
}

.shift-header-indicator:not(.visible) {
  display: none;
}

.voyage-header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(58, 147, 255, 0.28);
  border-radius: 999px;
  background: rgba(58, 147, 255, 0.08);
  color: var(--blue);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.voyage-header-link:hover {
  border-color: rgba(58, 147, 255, 0.44);
  background: rgba(58, 147, 255, 0.14);
}

.voyage-header-label {
  opacity: 0.82;
}

.shift-header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.shift-header-link:hover {
  border-color: #bfd0e6;
  background: #eef3f9;
  color: var(--navy);
}

.shift-header-link.pending {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
  animation: shiftHeaderPulse 1.25s ease-in-out infinite;
}

.voyage-page-grid,
.voyage-config-grid {
  display: grid;
  gap: 16px;
}

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

.voyage-card-grid {
  display: grid;
  gap: 12px;
}

.voyage-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  box-shadow: 0 8px 20px rgba(16, 42, 76, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.voyage-card h3 {
  margin: 0;
}

.voyage-card:hover,
.voyage-card:focus-visible {
  border-color: rgba(58, 147, 255, 0.4);
  background: #f8fbff;
  box-shadow: 0 12px 24px rgba(58, 147, 255, 0.12);
  transform: translateY(-1px);
}

.voyage-card-top,
.voyage-card-meta,
.voyage-card-footer,
.voyage-card-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.voyage-card-line strong,
.voyage-card-line span:last-child {
  text-align: right;
}

.voyage-card-top h3 {
  margin-bottom: 4px;
}

.voyage-card-stack {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.voyage-card-meta {
  color: var(--muted);
  font-size: 13px;
}

.voyage-card-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.voyage-card-stack.compact {
  gap: 2px;
}

.voyage-card-compact .voyage-card-line {
  justify-content: flex-start;
  align-items: flex-start;
}

.voyage-card-line-primary {
  align-items: center;
  justify-content: space-between;
}

.voyage-card-title-wrap {
  min-width: 0;
}

.voyage-card-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.voyage-card-compact .voyage-card-line span {
  color: #31465d;
  line-height: 1.35;
  text-align: left;
}

.voyage-card-compact .voyage-card-line:not(.voyage-card-line-primary) span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.voyage-card.is-in-port {
  border-color: #d6e0eb;
  background: #fbfcfd;
}

.voyage-modal {
  width: min(1180px, calc(100vw - 40px));
}

.voyage-warning {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  border-color: rgba(217, 119, 6, 0.28);
  background: #fff9eb;
}

.voyage-warning.compact {
  padding: 10px 12px;
}

.voyage-column-panel {
  min-height: 100%;
}

.voyage-empty-state {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px dashed #d7e1eb;
  border-radius: 8px;
  background: #fbfdff;
}

.voyage-toolbar-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-input-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tag-input-shell input {
  flex: 1;
  min-width: 160px;
  border: 0;
  outline: none;
  padding: 4px 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(58, 147, 255, 0.22);
  background: rgba(58, 147, 255, 0.09);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.tag-chip small {
  color: var(--muted);
  font-weight: 600;
}

.tag-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.search-results {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.search-results:empty {
  display: none;
}

.voyage-table input,
.voyage-table select {
  width: 100%;
}

.voyage-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.75fr);
  gap: 14px;
  align-items: stretch;
  min-height: clamp(420px, calc(100vh - 300px), 560px);
}

.voyage-main-stack,
.voyage-side-panel {
  display: grid;
  gap: 14px;
  align-content: stretch;
  align-self: stretch;
}

.voyage-overview-panel,
.voyage-table-panel,
.voyage-side-panel {
  min-width: 0;
}

.voyage-earnings-list {
  display: grid;
  gap: 6px;
}

.voyage-earning-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.voyage-earning-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.voyage-earning-values {
  display: grid;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
  align-content: start;
}

.voyage-earnings-list > :first-child {
  border-top: 0;
  padding-top: 0;
}

.voyage-earnings-list > :last-child {
  padding-bottom: 0;
}

.voyage-table-wrap {
  margin-top: 6px;
  max-height: clamp(320px, 44vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid var(--line);
  flex: 1 1 auto;
  min-height: 0;
}

.voyage-table {
  table-layout: fixed;
}

.voyage-table th {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.voyage-table tbody tr {
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.voyage-table tbody tr:hover {
  background: #f8fbff;
}

.voyage-table tbody tr:focus-within {
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px rgba(58, 147, 255, 0.22);
}

.voyage-table th,
.voyage-table td {
  padding-top: 4px;
  padding-bottom: 4px;
  vertical-align: middle;
}

.voyage-table input,
.voyage-table select {
  min-height: 28px;
  padding-top: 3px;
  padding-bottom: 3px;
}

.voyage-tote-number {
  width: 62px;
  white-space: nowrap;
}

.voyage-quantity-cell {
  width: 92px;
}

.voyage-row-total {
  width: 104px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.voyage-tote-save-state {
  display: block;
  margin-top: 2px;
}

.voyage-delete-cell {
  width: 34px;
  text-align: right;
}

.voyage-delete-btn {
  width: 26px;
  height: 26px;
  min-height: 26px;
  font-size: 12px;
}

.voyage-catch-grid {
  display: grid;
  gap: 12px;
}

.voyage-catch-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.voyage-catch-card.full-catch {
  border-left: 5px solid var(--blue);
}

.voyage-catch-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.voyage-catch-card-head small,
.voyage-catch-locked small,
.voyage-catch-owner-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.voyage-catch-delete {
  min-width: 116px;
}

.voyage-catch-delete span {
  display: inline-block;
  margin-right: 5px;
  font-size: 16px;
  line-height: 0;
  font-weight: 900;
}

.voyage-catch-locked,
.voyage-catch-owner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.voyage-catch-locked {
  padding: 10px;
  border-radius: 8px;
  background: #f8fbff;
}

.voyage-catch-owner-grid label {
  margin: 0;
}

.voyage-col-tote {
  width: 62px;
}

.voyage-col-crew {
  width: 24%;
}

.voyage-col-cargo {
  width: 24%;
}

.voyage-col-qty {
  width: 96px;
}

.voyage-col-total {
  width: 108px;
}

.voyage-col-delete {
  width: 34px;
}

.voyage-review-table .voyage-col-crew {
  width: 31%;
}

.voyage-review-table .voyage-col-cargo {
  width: 24%;
}

.voyage-review-table .voyage-col-qty {
  width: 88px;
}

.voyage-review-table .voyage-col-total {
  width: 104px;
}

.voyage-stats-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 12px;
  padding: 6px 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.voyage-stats-inline span {
  position: relative;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
}

.voyage-stats-inline span strong {
  color: var(--navy);
}

.voyage-stats-inline span + span::before {
  content: "|";
  color: #bfd0e6;
  margin-right: 14px;
}

.voyage-underway {
  border-left: 3px solid rgba(58, 147, 255, 0.32);
}

.voyage-in-port {
  border-left: 3px solid rgba(100, 116, 139, 0.35);
}

.voyage-operational-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.segmented-toggle {
  display: inline-flex;
  border: 1px solid #cfdbe8;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.segmented-toggle-btn {
  border: 0;
  background: transparent;
  color: #52657b;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.segmented-toggle-btn.active {
  background: #1c4f91;
  color: #fff;
}

.segmented-toggle-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.voyage-vessel-stat strong {
  font-size: 20px;
}

.voyage-side-panel {
  padding: 12px;
  display: grid;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.voyage-table-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.voyage-table-panel .section-heading,
.voyage-side-panel .section-heading {
  margin-bottom: 10px;
}

.voyage-table-panel .actions .btn,
.voyage-table-panel .actions .btn.primary {
  min-height: 36px;
}

.voyage-table-panel .section-heading {
  flex: 0 0 auto;
}

.voyage-tote-limit-note {
  display: block;
  margin-top: 4px;
}

.voyage-log-table {
  table-layout: fixed;
}

.voyage-log-table select,
.voyage-log-table input {
  width: 100%;
}

.voyage-quantity-input {
  max-width: 88px;
  text-align: right;
}

.voyage-notes-panel {
  align-content: stretch;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.voyage-notes-textarea {
  min-height: 0;
  height: 100%;
  resize: none;
  font-family: inherit;
}

.voyage-notes-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.error-text {
  color: var(--red);
}

.voyage-workspace-tabs {
  display: flex;
  gap: 6px;
}

.voyage-workspace-tabs .tab {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

.voyage-workspace-tab-panels {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
}

.voyage-workspace-tab-panel {
  display: none;
  gap: 10px;
  align-content: stretch;
  min-height: 0;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.voyage-workspace-tab-panel.active {
  display: grid;
}

.voyage-fish-guide-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.voyage-fish-guide-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.voyage-fish-guide-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.voyage-drawing-shell {
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.voyage-drawing-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  background: linear-gradient(#ffffff, #ffffff) padding-box,
    repeating-linear-gradient(0deg, #eef4fa 0, #eef4fa 1px, transparent 1px, transparent 28px),
    repeating-linear-gradient(90deg, #f3f7fb 0, #f3f7fb 1px, transparent 1px, transparent 28px);
}

.voyage-closeout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  gap: 18px;
  min-height: 0;
  height: 100%;
}

.voyage-closeout-main,
.voyage-closeout-side {
  min-width: 0;
}

.voyage-closeout-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.voyage-closeout-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-content: stretch;
  min-height: 0;
  overflow: hidden;
}

.voyage-closeout-table-wrap {
  height: 100%;
  max-height: clamp(400px, 52vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.voyage-closeout-table-wrap .voyage-table,
.voyage-review-table {
  table-layout: fixed;
}

.voyage-end-modal {
  width: min(92vw, 1400px);
  max-width: 92vw;
  min-width: min(1050px, calc(100vw - 32px));
  height: clamp(620px, 80vh, 720px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.voyage-end-modal .modal-body {
  display: flex;
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
}

.voyage-review-table th,
.voyage-review-table td {
  white-space: nowrap;
}

.voyage-review-table td {
  overflow: visible;
  text-overflow: clip;
}

.voyage-review-table .voyage-tote-number,
.voyage-review-table .voyage-row-total,
.voyage-review-table .voyage-lost-toggle-cell {
  white-space: nowrap;
}

.voyage-review-crew,
.voyage-review-cargo {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.voyage-review-crew span,
.voyage-review-cargo span {
  display: inline-block;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  vertical-align: bottom;
}

.voyage-col-lost {
  width: 72px;
}

.voyage-lost-toggle-cell {
  text-align: center;
}

.voyage-lost-toggle {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid #f1b6b6;
  background: #fff;
  color: #dc2626;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.voyage-lost-toggle:hover {
  border-color: #ef4444;
  background: #fef2f2;
  transform: translateY(-1px);
}

.voyage-lost-toggle.is-lost {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

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

.voyage-dues-note {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
}

.finance-bar-list {
  display: grid;
  gap: 12px;
}

.finance-bar-row {
  display: grid;
  gap: 8px;
}

.finance-bar-row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.finance-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e8eff9;
  overflow: hidden;
}

.finance-bar-fill {
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.finance-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.finance-toolbar {
  align-items: flex-end;
}

.finance-range-actions,
.finance-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-dashboard-panel {
  display: grid;
  gap: 6px;
}

.finance-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.finance-kpi-grid-wide {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.summary-grid.finance-kpi-grid-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  align-items: stretch;
}

.summary-grid.finance-kpi-grid-finances {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.finance-kpi-grid-cashflow {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.finance-kpi-card {
  display: grid;
  gap: 1px;
  align-content: start;
  min-height: 0;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}

.finance-kpi-card strong {
  display: block;
  margin-top: 0;
  font-size: clamp(12px, 0.95vw, 18px);
  line-height: 1.1;
}

.finance-kpi-card.negative strong {
  color: #b91c1c;
}

.finance-kpi-card.positive strong {
  color: #166534;
}

.finance-kpi-card.neutral strong {
  color: #475569;
}

.finance-kpi-meta {
  color: #64748b;
  font-size: 9px;
  line-height: 1.15;
}

.finance-kpi-pill {
  min-height: 40px;
  padding: 4px 6px;
  background: #f8fbff;
}

.finance-kpi-pill .muted {
  font-size: 10px;
  line-height: 1.1;
}

.finance-kpi-pill strong {
  font-size: clamp(13px, 0.95vw, 18px);
  line-height: 1.05;
  word-break: break-word;
}

.finance-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.finance-chart-grid-analytics {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  grid-template-rows: auto auto;
  min-height: 0;
  height: auto;
}

.finance-chart-card {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
  min-height: 0;
  padding: 8px;
}

.finance-chart-card-wide {
  min-height: 0;
}

.finance-chart-card-trend {
  grid-row: auto;
  grid-column: 1 / -1;
}

.finance-chart-inline {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.finance-chart-inline-compact {
  grid-template-columns: 124px minmax(0, 1fr);
}

.finance-chart-legend {
  display: grid;
  gap: 8px;
}

.finance-legend-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
  font-size: 12px;
}

.finance-legend-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.chart-svg {
  width: 100%;
  height: 146px;
  display: block;
}

.chart-svg-tall {
  height: 260px;
}

.chart-grid-line {
  stroke: #dbe4ef;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #64748b;
  font-size: 10px;
  font-family: inherit;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: #64748b;
  text-align: center;
  font-size: 12px;
}

.donut-chart-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  overflow: visible;
}

.donut-chart {
  width: 120px;
  height: 120px;
  display: block;
  overflow: visible;
}

.donut-slice {
  cursor: pointer;
  stroke-linecap: butt;
  transition: stroke-width 0.16s ease, filter 0.16s ease;
}

.donut-slice:hover,
.donut-slice:focus {
  filter: drop-shadow(0 5px 8px rgba(15, 23, 42, 0.18));
  stroke-width: 28;
}

.donut-chart-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 2px;
  pointer-events: none;
}

.finance-page-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
  height: auto;
  min-height: 0;
}

.finance-main-tabs {
  align-items: center;
}

.finance-workspace-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
  overflow: hidden;
  padding: 4px;
}

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

.finance-debts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, 300px);
  gap: 10px;
  min-height: 0;
  height: 610px;
  overflow: hidden;
}

.finance-panel-fixed {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}

.cashflow-audit-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.debt-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.debt-panel {
  display: grid;
  gap: 2px;
  align-content: stretch;
  min-width: 0;
}

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

.finance-table-scroll {
  overflow: auto;
  min-height: 0;
  height: 100%;
  scrollbar-gutter: stable;
}

.finance-debts-grid th,
.finance-debts-grid td {
  font-size: 12.5px;
  line-height: 1.32;
}

.finance-debts-grid th {
  font-size: 12px;
}

.finance-debts-grid td.muted {
  text-align: center;
  color: #64748b;
  padding: 16px 8px;
}

.debt-table-scroll {
  max-height: none;
}

.cashflow-table-scroll {
  max-height: none;
}

.debt-settler-table-scroll {
  max-height: none;
}

.cashflow-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
  padding: 2px 0 8px;
  margin: 0 0 6px;
}

.cashflow-filters label {
  min-width: 0;
}

.cashflow-filters input,
.cashflow-filters select {
  height: 36px;
}

.table-load-more {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.debt-cashflow-chart-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr) minmax(280px, 0.85fr);
}

.debt-cashflow-lower {
  align-items: start;
}

.finance-modal {
  width: min(760px, 100%);
}

body.finance-workspace-body {
  overflow: auto;
}

body.finance-workspace-body .shell {
  min-height: 100vh;
  overflow: visible;
}

body.finance-workspace-body .shell > div {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: visible;
}

body.finance-workspace-body .content {
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}

.btn-sm {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.finance-workspace-panel th,
.finance-workspace-panel td {
  padding: 7px 9px;
  font-size: 12px;
}

.finance-workspace-panel th {
  font-size: 11.5px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.finance-workspace-panel .badge {
  padding: 2px 6px;
  font-size: 10px;
}

.finance-workspace-panel .section-heading {
  margin-bottom: 2px;
  min-height: 28px;
}

.finance-workspace-panel .compact-heading h2 {
  font-size: 14px;
}

.finance-range-actions .btn,
.finance-main-tabs .btn {
  min-height: 30px;
  padding: 5px 10px;
}

.finance-toolbar h1 {
  margin-bottom: 2px;
}

.finance-chart-tooltip[hidden] {
  display: none !important;
  opacity: 0;
}

.content {
  background: var(--bg);
}

.finance-stat-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  min-height: 78px;
  height: auto;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  align-items: center;
}

.finance-stat-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.finance-stat-item:last-child {
  border-right: 1px solid var(--line);
}

.finance-stat-label {
  color: #64748b;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-stat-item strong {
  display: block;
  margin: 0;
  font-size: clamp(16px, 1vw, 22px);
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-stat-meta {
  color: #64748b;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finance-stat-item.negative strong {
  color: #b91c1c;
}

.finance-stat-item.positive strong {
  color: #166534;
}

.finance-stat-strip-finances .finance-stat-item:nth-child(5) strong,
.finance-stat-strip-finances .finance-stat-item:nth-child(6) strong {
  font-size: clamp(14px, 0.92vw, 18px);
}

.summary-grid.finance-kpi-grid-strip .finance-kpi-pill {
  min-height: 36px;
  padding: 4px 6px;
}

.summary-grid.finance-kpi-grid-strip .finance-kpi-pill strong {
  font-size: clamp(12px, 0.9vw, 17px);
}

.summary-grid.finance-kpi-grid-strip .finance-kpi-meta {
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-grid.finance-kpi-grid-strip .muted {
  letter-spacing: 0;
}

.summary-grid.finance-kpi-grid-finances .finance-kpi-pill {
  min-height: 38px;
}

.finance-toolbar .muted {
  font-size: 12px;
}

.finance-mini-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-height: 22px;
}

.finance-mini-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.finance-mini-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.finance-chart-combo {
  display: grid;
  gap: 6px;
}

.finance-loading-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(58, 147, 255, 0.22);
  border-radius: 999px;
  background: rgba(58, 147, 255, 0.08);
  color: #1d4f91;
  font-size: 11px;
  font-weight: 700;
}

.restricted-access-banner {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  border-color: rgba(58, 147, 255, 0.22);
  background: #f8fbff;
}

.finance-chart-tooltip {
  position: fixed;
  z-index: 50;
  display: grid;
  gap: 3px;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.finance-chart-tooltip div:first-child {
  font-weight: 700;
  color: #163c6a;
}

.chart-hover-guide {
  stroke: rgba(58, 147, 255, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

.finance-table-scroll {
  overflow: auto;
  min-height: 0;
  scrollbar-gutter: stable;
}

@media (max-width: 1600px) {
  .finance-kpi-grid-wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-grid.finance-kpi-grid-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .finance-stat-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .summary-grid.finance-kpi-grid-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 1320px) {
  .finance-chart-grid-analytics {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .finance-chart-card-trend {
    grid-row: auto;
  }
}

.debt-status-current {
  color: #2563eb;
}

.debt-status-due_soon {
  color: #b45309;
}

.debt-status-overdue {
  color: #dc2626;
}

.debt-status-expired {
  color: #6b7280;
}

.debt-status-claimed,
.debt-status-settled {
  color: #15803d;
}

.voyage-closeout-earnings {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.voyage-closeout-earnings h3 {
  margin: 0;
  font-size: 17px;
}

.voyage-closeout-summary-block {
  display: grid;
  gap: 8px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.voyage-closeout-summary-block p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.voyage-lost-row {
  opacity: 0.62;
  background: #f8fafc;
}

.voyage-review-strike {
  display: inline;
}

.voyage-lost-row .voyage-review-strike {
  text-decoration: line-through;
  color: #64748b;
}

.voyage-closeout-actions {
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  background: #fff;
  align-self: end;
}

.voyage-closeout-actions h3 {
  margin: 0;
  font-size: 17px;
}

.voyage-closeout-footer {
  margin-top: 0;
  padding: 0;
  border: 0;
  justify-content: stretch;
}

.voyage-closeout-footer .btn {
  flex: 1 1 0;
}

.hold-action-btn {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18));
  background-repeat: no-repeat;
  background-size: var(--hold-progress, 0%) 100%;
  transition: background-size 0.06s linear, transform 0.12s ease;
}

.hold-action-btn.is-holding {
  transform: translateY(-1px);
}

.btn.hold-action-btn.danger {
  background-image: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14));
}

.voyage-closeout-footer #cancelEndVoyage:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.voyage-header-link.pending {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
  animation: shiftHeaderPulse 1.25s ease-in-out infinite;
}

.voyage-header-link.pending:hover {
  border-color: #ef4444;
  background: #ffe4e6;
}

.crew-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.fleet-member-list {
  max-height: 420px;
  overflow-y: auto;
}

.shipyard-card-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.shipyard-card-grid-main {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 0;
}

.shipyard-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.shipyard-card-button {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.shipyard-card-button:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.shipyard-card.active {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(58, 147, 255, 0.12);
}

.shipyard-card-head,
.shipyard-card-stats {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.shipyard-card-head strong,
.shipyard-card-stats strong {
  display: block;
  color: var(--navy);
}

.shipyard-card-head small,
.shipyard-card-stats small {
  display: block;
  color: var(--muted);
}

.shipyard-card-stats {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.shipyard-modal {
  width: min(820px, 100%);
}

.shipyard-detail-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.shipyard-member-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 1100px) {
  .voyage-page-grid,
  .voyage-workspace,
  .voyage-config-grid,
  .voyage-closeout-layout {
    grid-template-columns: 1fr;
  }
}

.shift-header-link.pending:hover {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.shift-header-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.shift-header-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content {
  padding: 14px 16px;
  background: var(--bg);
}

.voyage-lockout-banner {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  border-color: rgba(24, 24, 27, 0.16);
  background: #f8fafc;
}

.voyage-lockout-visual {
  filter: grayscale(1);
  opacity: 0.84;
  pointer-events: none;
}

.voyage-lockout-visual .btn,
.voyage-lockout-visual input,
.voyage-lockout-visual select,
.voyage-lockout-visual textarea,
.voyage-lockout-visual canvas {
  pointer-events: none;
}

body.workspace-locked {
  overflow: hidden;
}

body.workspace-locked .shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

body.workspace-locked .shell > div {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

body.workspace-locked .content {
  min-height: 0;
  height: calc(100vh - 66px);
  overflow: hidden;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.stat {
  padding: 18px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 30px;
}

.stat small {
  display: block;
  margin-top: 8px;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-intro h1 {
  margin-bottom: 6px;
}

.intro-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
}

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

.span-3-cols {
  grid-column: span 3;
}

.span-4-cols {
  grid-column: span 4;
}

.span-6-cols {
  grid-column: span 6;
}

.span-8-cols {
  grid-column: span 8;
}

.span-12-cols {
  grid-column: span 12;
}

.metric {
  padding: 12px 14px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 24px;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-actions a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font-weight: 800;
}

.quick-actions a:hover {
  border-color: var(--blue);
  background: #eaf2fb;
}

.panel {
  padding: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.compact-table-wrap {
  overflow-x: visible;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  text-align: left;
}

.compact-table {
  min-width: 0;
  table-layout: fixed;
}

.compact-table th,
.compact-table td {
  overflow-wrap: anywhere;
}

.wrap-cell {
  white-space: normal;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.badge.danger-soft {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.badge.pill-pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.badge.pill-open {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.badge.pill-fail {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.badge.pill-review {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.badge.pill-retry {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.badge.pill-neutral {
  border-color: #d1d5db;
  background: #f8fafc;
  color: #475569;
}

.badge.pill-warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-form {
  align-items: end;
  grid-template-columns: minmax(180px, 1fr) 170px minmax(260px, 2fr) auto;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.action-cell {
  display: flex;
  gap: 8px;
}

.table-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.effect-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.effect-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.effect-option input {
  width: 16px;
  height: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.compact-form textarea {
  min-height: 42px;
}

input[type="color"] {
  min-height: 42px;
  padding: 4px;
  cursor: pointer;
}

.color-field {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: center;
}

.color-field input[type="color"] {
  min-width: 54px;
}

.color-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.span-2 {
  grid-column: 1 / -1;
}

.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.admin-tools {
  margin-top: 16px;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-row {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  overflow-wrap: anywhere;
}

.ia-page-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.ia-list-scroll {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 10px;
  align-content: start;
}

.ia-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  padding: 9px 10px;
}

.ia-filter-bar input,
.ia-filter-bar select,
.ia-filter-bar .btn {
  min-height: 36px;
}

.ia-filter-bar label {
  min-width: 150px;
}

.ia-search-input {
  width: 168px;
}

.ia-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 12px;
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ia-main,
.ia-side {
  min-width: 0;
  min-height: 0;
}

.ia-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ia-column-scroll {
  overflow: visible;
}

.ia-side {
  align-self: start;
  overflow-y: auto;
}

.ia-header-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.ia-search-shell {
  position: relative;
}

.ia-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 4;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  padding: 8px;
}

.ia-modal {
  width: min(680px, 100%);
}

.ia-subtle-btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.ia-preview-image,
.ia-preview-frame {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 8px;
}

.ia-preview-image {
  max-height: 240px;
  object-fit: cover;
}

.ia-preview-frame {
  min-height: 220px;
}

.ia-section-stack {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.ia-main-section-stack {
  gap: 12px;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ia-timeline-list {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.ia-scroll-box {
  max-height: clamp(180px, 18vh, 220px);
  overflow-y: auto;
  padding-right: 4px;
}

.ia-scroll-box.evidence-box,
.ia-scroll-box.statements-box,
.ia-scroll-box.notes-box {
  max-height: clamp(180px, 18vh, 220px);
}

.ia-scroll-box.timeline-box {
  max-height: clamp(220px, 24vh, 260px);
}

.ia-scroll-box.team-box {
  max-height: 180px;
}

.ia-table-box {
  max-height: 280px;
  overflow: auto;
}

.ia-case-table th,
.ia-case-table td {
  padding: 9px 10px;
}

.ia-case-table thead th {
  background: #f5f8fc;
  border-bottom-color: #cfd8e6;
}

.ia-case-row {
  cursor: pointer;
  transition: background-color 120ms ease;
}

.ia-case-row.alt {
  background: rgba(248, 250, 252, 0.58);
}

.ia-case-row:hover {
  background: rgba(37, 99, 235, 0.06);
}

.ia-case-row:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: -2px;
  background: rgba(37, 99, 235, 0.08);
}

.ia-subject-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ia-case-date-cell {
  white-space: nowrap;
}

.ia-list-badge,
.ia-status-badge,
.ia-count-badge {
  padding: 3px 7px;
  font-size: 11px;
}

.ia-count-badge {
  min-height: 22px;
}

.ia-create-case-btn {
  min-height: 34px;
  padding: 6px 10px;
}

.ia-card-compact {
  padding: 10px 12px;
  border-color: #cfd8e6;
}

.ia-side .ia-card-compact {
  padding: 9px 10px;
}

.ia-summary-card {
  padding-top: 8px;
  padding-bottom: 8px;
}

.ia-details-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}

.ia-details-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ia-details-item small,
.ia-details-item strong,
.ia-details-item .badge {
  min-width: 0;
}

.ia-details-item small {
  margin: 0;
}

.ia-summary-copy {
  margin: 0;
  line-height: 1.5;
  max-width: 90ch;
}

.ia-summary-block {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #d3ddec;
}

.ia-summary-block h3 {
  margin: 0 0 8px;
}

.ia-status-form textarea {
  min-height: 72px;
}

.ia-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}

.ia-table th,
.ia-table td {
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.2;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ia-table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ia-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ia-table .muted {
  font-size: 12px;
}

.ia-cell-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ia-actions-inline {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.ia-meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ia-top-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.ia-top-meta-compact {
  align-items: center;
}

.ia-top-meta-item {
  min-width: 0;
}

.ia-top-meta-item small {
  display: block;
  margin-bottom: 4px;
}

.ia-case-heading {
  margin-bottom: 2px;
}

.ia-case-heading h1 {
  margin: 0;
}

.ia-action-col {
  width: 126px;
}

.ia-link-col {
  width: 82px;
}

.ia-date-col {
  width: 132px;
}

.ia-user-col {
  width: 120px;
}

.ia-btn-nowrap {
  white-space: nowrap;
}

.ia-task-toggle {
  width: 92px;
  justify-content: center;
  flex: 0 0 92px;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.ia-remove-btn {
  min-height: 30px;
  width: 30px;
  padding: 0;
  opacity: 0.4;
}

.ia-remove-btn:hover:not(:disabled) {
  opacity: 1;
}

.ia-inline-meta {
  font-weight: 600;
}

.ia-entry-list {
  display: grid;
  gap: 0;
}

.ia-workspace-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.ia-tabs {
  margin-bottom: 8px;
}

.ia-tab-heading {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.ia-tab-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.ia-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #cbd7e6;
  padding: 10px 2px;
  min-width: 0;
  background: rgba(255, 255, 255, 0);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.ia-entry-row:last-child {
  border-bottom: 0;
}

.ia-entry-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ia-entry-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  min-width: 0;
}

.ia-entry-preview {
  margin: 0 0 4px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ia-entry-actions {
  min-width: 0;
}

.ia-entry-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
}

.ia-entry-date {
  white-space: nowrap;
  text-align: right;
}

.ia-task-list {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
}

.ia-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #cbd7e6;
  padding: 5px 2px;
  transition: background-color 90ms ease, opacity 90ms ease, color 90ms ease;
}

.ia-task-row:last-child {
  border-bottom: 0;
}

.ia-task-row.clickable {
  cursor: pointer;
}

.ia-task-row.clickable:hover {
  background: rgba(37, 99, 235, 0.04);
}

.ia-task-row.is-complete {
  background: rgba(148, 163, 184, 0.08);
}

.ia-task-row.is-complete.clickable:hover {
  background: rgba(148, 163, 184, 0.12);
}

.ia-task-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ia-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  transition: color 70ms ease, opacity 70ms ease, text-decoration-color 70ms ease;
}

.ia-task-row.is-complete .ia-task-title,
.ia-task-row.is-complete .ia-task-main .muted {
  color: #64748b;
  opacity: 0.68;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.ia-task-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-items: end;
  gap: 8px;
  min-width: 42px;
}

.ia-task-actions {
  min-width: 42px;
  gap: 8px;
}

.ia-card-compact .section-heading.compact-heading {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #d3ddec;
}

.ia-side .section-heading.compact-heading {
  margin-bottom: 8px;
  padding-bottom: 6px;
}

.ia-card-compact .section-heading.compact-heading h2 {
  font-size: 17px;
  font-weight: 700;
}

.ia-view-body {
  max-width: 100%;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ia-view-body p,
.ia-view-body a,
.ia-view-body iframe,
.ia-view-body img {
  max-width: 100%;
}

.selectable-row {
  width: 100%;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.selectable-row:hover {
  border-color: var(--blue);
  background: #eaf2fb;
}

.role-editor {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.role-list-panel {
  padding: 12px;
}

.role-editor-panel {
  padding: 18px;
}

.role-list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.role-list-item.active,
.role-list-item:hover {
  border-color: var(--blue);
  background: #eaf2fb;
}

.permission-editor {
  display: grid;
  gap: 10px;
}

.permission-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
}

.permission-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.syllabus-outcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  gap: 10px;
}

.syllabus-grid {
  table-layout: auto;
}

.syllabus-abbr,
.grid-cell {
  width: 64px;
  text-align: center;
}

.grid-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.status-pass {
  background: #dcfce7;
  color: #166534;
}

.status-fail {
  background: #fee2e2;
  color: #b91c1c;
}

.status-retry {
  background: #ffedd5;
  color: #c2410c;
}

.dashboard-lower {
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-lower-grid {
  margin-top: 16px;
}

.dashboard-compact-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.dashboard-record-grid {
  margin-top: 14px;
}

.dashboard-record-panel {
  gap: 10px;
}

.dashboard-record-panel-empty {
  padding-top: 12px;
  padding-bottom: 12px;
}

.me-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.25fr) minmax(300px, 0.8fr);
  grid-template-areas:
    "profile notices actions"
    "record notices leaderboard";
  gap: 10px;
  align-items: stretch;
}

.me-page-intro {
  margin-bottom: 6px;
  padding-bottom: 0;
}

.me-page-intro h1 {
  margin-bottom: 2px;
}

.me-stat-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 8px;
  min-height: 58px;
}

.me-status-panel {
  grid-area: status;
  display: grid;
  gap: 10px;
  align-content: start;
}

.me-status-panel > strong {
  color: var(--navy);
  font-size: 24px;
  line-height: 1.05;
}

.me-profile-panel {
  grid-area: profile;
}

.me-feed-panel {
  grid-area: notices;
  min-height: 0;
  overflow: hidden;
}

.me-actions-panel {
  grid-area: actions;
  min-height: 0;
}

.me-leaderboard-panel {
  grid-area: leaderboard;
  min-height: 0;
  overflow: hidden;
}

.me-record-panel {
  grid-area: record;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.leaderboard-row span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eaf2fb;
  color: var(--blue);
  font-weight: 800;
}

body.me-dashboard-body .content {
  height: calc(100vh - 66px);
  overflow: hidden;
}

body.me-dashboard-body .finance-stat-item {
  min-height: 58px;
  padding: 8px 12px;
}

body.me-dashboard-body .finance-stat-value {
  font-size: 18px;
}

body.me-dashboard-body .me-dashboard {
  height: calc(100vh - 66px - 116px);
  min-height: 0;
  grid-template-rows: minmax(130px, 0.75fr) minmax(190px, 1fr);
}

body.me-dashboard-body .dashboard-compact-panel {
  gap: 8px;
  padding: 12px 14px;
}

body.me-dashboard-body .dashboard-compact-panel h2 {
  margin-bottom: 0;
  font-size: 20px;
}

body.me-dashboard-body .notice-list,
body.me-dashboard-body .action-required-list,
body.me-dashboard-body .disciplinary-dashboard-list {
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
}

body.me-dashboard-body .leaderboard-list {
  max-height: 100%;
  overflow: auto;
}

body.me-dashboard-body .me-actions-panel {
  min-height: 0;
}

body.me-dashboard-body .notice-card {
  padding: 8px 10px;
}

body.me-dashboard-body .notice-card p {
  margin-bottom: 6px;
}

body.me-dashboard-body .profile-inline-list {
  gap: 8px;
}

body.me-dashboard-body .profile-inline-list > div {
  padding-bottom: 8px;
}

.leaderboard-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.public-application-shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 16px;
  background: var(--bg);
}

.public-application-card {
  width: min(860px, 100%);
}

.training-doc-frame {
  width: 100%;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.legal-page {
  width: min(860px, calc(100% - 32px));
  margin: 32px auto;
}

.legal-page h2 {
  margin-top: 20px;
}

.oauth-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.profile-inline-list {
  display: grid;
  gap: 10px;
}

.profile-inline-list > div {
  display: grid;
  gap: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.profile-inline-list > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.rank-row {
  cursor: grab;
}

.compact-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
}

.compact-controls label {
  min-width: 180px;
}

.card {
  padding: 16px;
}

.embedded-panel {
  padding: 16px;
}

.progress-inline {
  display: grid;
  gap: 6px;
  min-width: 90px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #1c4f91;
}

.chat-shell {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  min-height: 0;
}

.chat-header {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe4ef;
}

.chat-messages {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px 4px 2px 0;
}

.chat-bubble-row {
  display: flex;
}

.chat-bubble-row.own {
  justify-content: flex-end;
}

.chat-bubble-row.other {
  justify-content: flex-start;
}

.chat-message {
  display: grid;
  gap: 6px;
  max-width: min(78%, 560px);
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-message.other {
  background: #ffffff;
}

.chat-message.own {
  background: #eaf2fb;
  border-color: #bfd3ec;
}

.chat-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.cohort-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.cohort-search,
.cohort-filter {
  width: auto;
  min-width: 0;
}

.cohort-search {
  min-width: 180px;
  max-width: 220px;
  padding: 8px 10px;
}

.cohort-filter {
  min-width: 150px;
  padding: 8px 10px;
}

.btn.subtle-remove {
  min-height: 30px;
  width: 30px;
  padding: 0;
  opacity: 0.45;
  border-color: #f3d0d0;
  color: var(--red);
  transition: opacity 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.btn.subtle-remove:hover:not(:disabled) {
  opacity: 1;
  background: #fff1f2;
  border-color: #fecaca;
}

tr.clickable {
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

tr.clickable:hover,
tr.clickable:focus,
tr.clickable.row-active {
  background: #eaf2fb;
  box-shadow: inset 4px 0 0 var(--blue);
  outline: none;
}

tr.clickable:hover td,
tr.clickable:focus td,
tr.clickable.row-active td {
  border-bottom-color: #bfd0e6;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(15, 23, 42, 0.36);
}

.drawer-backdrop.open {
  display: block;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 21;
  width: min(720px, 100%);
  transform: translateX(100%);
  transition: transform 180ms ease;
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: -20px 0 40px rgba(15, 23, 42, 0.18);
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-body {
  padding: 18px;
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 18px;
}

.drawer-body {
  padding: 18px;
}

.drawer-issue-form {
  margin-bottom: 14px;
}

.drawer-issue-form h2 {
  margin-bottom: 0;
}

.disciplinary-history {
  display: grid;
  gap: 8px;
}

.compact-heading {
  margin: 4px 0 6px;
}

.disciplinary-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
}

.disciplinary-record-row.revoked {
  background: #f8fafc;
}

.disciplinary-record-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.disciplinary-record-main p {
  margin: 0 0 5px;
}

.disciplinary-record-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 800;
  min-height: 34px;
}

.tab.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.detail-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-list div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  vertical-align: middle;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer {
  font-size: 48px;
  font-weight: 900;
  color: var(--navy);
}

.notice {
  border: 1px solid #bfd0e6;
  border-radius: 6px;
  background: #eaf2fb;
  color: var(--navy);
  padding: 10px 12px;
}

.notice.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
}

.notice-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.action-required-list {
  display: grid;
  gap: 8px;
}

.disciplinary-dashboard-list {
  display: grid;
  gap: 10px;
}

.disciplinary-dashboard-list.is-empty {
  gap: 0;
}

.disciplinary-dashboard-row {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.disciplinary-dashboard-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.action-required-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
}

.action-required-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.action-required-main strong,
.action-required-main small {
  min-width: 0;
}

.action-marker {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 9px;
}

.action-marker.danger {
  background: #dc2626;
}

.action-marker.warning {
  background: #d97706;
}

.action-marker.normal {
  background: #2563eb;
}

.action-required-row.danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.action-required-row.warning {
  border-color: #fed7aa;
  background: #fffaf3;
}

.notice-card,
.audit-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.notice-card p,
.compact-row p,
.compact-row span,
.compact-row small {
  overflow-wrap: anywhere;
}

.notice-card.urgent {
  border-color: #fecaca;
  background: #fff1f2;
}

.audit-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-row p {
  margin: 5px 0;
  overflow-wrap: anywhere;
}

.notice-stack,
.active-duty-popup {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.notice-popup,
.active-duty-popup {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: var(--ink);
  padding: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.notice-popup p,
.active-duty-popup p {
  margin: 8px 0 12px;
}

.active-duty-popup.urgent {
  border-color: #fca5a5;
  background: #fff1f2;
  box-shadow: 0 18px 48px rgba(127, 29, 29, 0.24);
}

.active-duty-popup.urgent strong {
  color: #991b1b;
}

.active-duty-popup.urgent .btn.danger {
  min-width: 132px;
  background: #dc2626;
  color: #fff;
}

.active-duty-popup.urgent .btn.danger:hover:not(:disabled) {
  background: #b91c1c;
}

@keyframes shiftHeaderPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.16);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.04);
  }
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .stats,
  .form-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .page-intro,
  .dashboard-grid,
  .dashboard-split,
  .me-dashboard,
  .role-editor,
  .ia-layout,
  .ia-header-grid {
    grid-template-columns: 1fr;
  }

  .me-dashboard {
    grid-template-areas:
      "profile"
      "leaderboard"
      "actions"
      "notices"
      "record";
  }

  body.me-dashboard-body .content {
    height: auto;
    overflow: auto;
  }

  body.me-dashboard-body .me-dashboard {
    height: auto;
  }

  .voyage-page-grid,
  .voyage-closeout-layout {
    grid-template-columns: 1fr;
  }

  .voyage-catch-locked,
  .voyage-catch-owner-grid {
    grid-template-columns: 1fr;
  }

  .finance-chart-grid,
  .finance-chart-grid-compact,
  .finance-debts-grid,
  .debt-two-column,
  .debt-cashflow-chart-grid {
    grid-template-columns: 1fr;
  }

  .finance-chart-card-trend {
    grid-column: auto;
  }

  .finance-chart-inline,
  .finance-chart-inline-compact {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .debt-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .voyage-operational-control {
    margin-left: 0;
  }

  .voyage-closeout-footer .btn {
    flex: 1 1 auto;
  }

  .ia-top-meta,
  .ia-entry-row {
    grid-template-columns: 1fr;
  }

  .ia-details-inline {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ia-details-item {
    flex-wrap: wrap;
  }

  .ia-entry-side {
    justify-items: start;
  }

  body.workspace-locked,
  body.workspace-locked .shell,
  body.workspace-locked .shell > div,
  body.workspace-locked .content,
  .ia-page-shell,
  .ia-layout,
  .ia-column-scroll,
  .ia-list-scroll {
    overflow: visible;
    height: auto;
    max-height: none;
  }

  .ia-search-results {
    position: static;
    margin-top: 6px;
  }

  .page-intro {
    display: grid;
  }

  .span-3-cols,
  .span-4-cols,
  .span-6-cols,
  .span-8-cols,
  .span-12-cols {
    grid-column: span 1;
  }

  .disciplinary-record-row {
    grid-template-columns: 1fr;
  }

  .disciplinary-record-side {
    justify-items: start;
  }
}
