.panel {
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--color-primary) 16%, #ffffff);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(21, 96, 182, 0.16);
  padding: var(--space-4);
}

.section-surface {
  background: color-mix(in srgb, var(--color-primary) 8%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--color-primary) 14%, #ffffff);
  border-radius: 18px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  min-height: 40px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--color-primary-strong);
  border-color: var(--color-primary-strong);
}

.btn-danger {
  background: #c62828;
  color: #ffffff;
  border-color: #c62828;
}

.btn-danger:hover {
  background: #a91f1f;
  border-color: #a91f1f;
}

.btn-secondary {
  background: var(--color-surface-soft);
  color: var(--color-ink-soft);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: color-mix(in srgb, var(--color-secondary) 45%, white);
  background: color-mix(in srgb, var(--color-secondary) 12%, white);
  color: var(--color-secondary);
}

.btn-accent {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #ffffff;
}

.btn-accent:hover {
  background: color-mix(in srgb, var(--color-secondary) 86%, black);
  border-color: color-mix(in srgb, var(--color-secondary) 86%, black);
}

.btn-warning {
  background: #f2b544;
  border-color: #f2b544;
  color: #1f2937;
}

.btn-warning:hover {
  background: #de9f2f;
  border-color: #de9f2f;
}

.btn-block {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.detail-card h3 {
  margin-bottom: var(--space-2);
}

.detail-card p {
  margin-bottom: 0;
  color: var(--color-muted);
}

.stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.stat-list strong {
  display: block;
  font-size: 1.2rem;
  font-family: var(--font-heading);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--color-ink-soft);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
  background: #ffffff;
  color: var(--color-ink-soft);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 30%, white);
  border-color: var(--color-primary);
}

.feedback {
  margin-top: var(--space-3);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  display: none;
  border: 1px solid transparent;
}

.feedback.is-visible {
  display: block;
}

.feedback.is-success {
  background: color-mix(in srgb, var(--color-success) 12%, white);
  color: var(--color-success);
  border-color: color-mix(in srgb, var(--color-success) 24%, white);
}

.feedback.is-error {
  background: color-mix(in srgb, var(--color-danger) 12%, white);
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 24%, white);
}

.skeleton-shell {
  position: relative;
  overflow: hidden;
}

.skeleton-line {
  display: block;
  height: 0.85rem;
  border-radius: 8px;
  background: #e8edf5;
  position: relative;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.72) 50%, rgba(255, 255, 255, 0) 100%);
  animation: skeletonShimmer 1.2s linear infinite;
}

.skeleton-w-35 {
  width: 35%;
}

.skeleton-w-45 {
  width: 45%;
}

.skeleton-w-55 {
  width: 55%;
}

.skeleton-w-60 {
  width: 60%;
}

.skeleton-w-70 {
  width: 70%;
}

.skeleton-w-80 {
  width: 80%;
}

.skeleton-w-90 {
  width: 90%;
}

.link-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.link-list a {
  display: block;
  padding: 0.7rem 0.9rem;
  border: none;
  border-radius: 10px;
  background: #f8fbfe;
  color: var(--color-ink-soft);
  font-weight: 600;
}

.link-list a:hover {
  background: #f1f7ff;
  color: var(--color-primary);
  text-decoration: none;
}

.role-list {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}

.role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.75rem 0.1rem;
  border: none;
  border-bottom: 1px solid #edf2f6;
  border-radius: 0;
  background: transparent;
}

.role-list .role-item:last-child {
  border-bottom: none;
}

.role-id {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-ink-soft);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--space-2);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

.data-table th {
  background: var(--color-surface-soft);
  color: var(--color-ink);
  font-weight: 700;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 37, 48, 0.42);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.modal-card-wide {
  width: min(1360px, 100%);
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.end-voyage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.78fr);
  gap: 1.5rem;
  align-items: start;
}

.end-voyage-layout > section {
  min-height: 0;
  min-width: 0;
}

.end-voyage-layout .section-surface {
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
}

.btn-compact {
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.align-right {
  text-align: right !important;
}

.end-settlement-panel h4 {
  margin: 0.25rem 0 0.45rem;
}

.end-settlement-head {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  margin-bottom: 0.35rem;
}

.end-multiplier-field {
  width: min(260px, 100%);
}

.end-multiplier-field label {
  margin-bottom: 0.2rem;
}

.end-multiplier-field input {
  margin-bottom: 0;
}

.end-settlement-wrap {
  max-height: none;
  overflow: hidden;
  width: 100%;
}

.end-settlement-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.end-settlement-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: normal;
  font-size: 0.86rem;
  line-height: 1.2;
}

.end-settlement-table th,
.end-settlement-table td {
  padding-top: 0.36rem;
  padding-bottom: 0.36rem;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.end-settlement-table td {
  white-space: nowrap;
}

.end-settlement-table .col-cargo {
  width: 34%;
}

.end-settlement-table .col-qty {
  width: 14%;
}

.end-settlement-table .col-loss {
  width: 16%;
}

.end-settlement-table .col-buy {
  width: 17%;
}

.end-settlement-table .col-base {
  width: 19%;
}

.end-settlement-table .cargo-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.end-settlement-table input {
  margin-bottom: 0;
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
}

.end-settlement-table input[data-field='lostQty'] {
  width: 100%;
  min-width: 0;
}

.end-settlement-table input[data-field='baseSellPrice'] {
  width: 100%;
  min-width: 0;
  text-align: right;
}

.end-breakdown-totals {
  border-top: 1px solid var(--color-border);
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  display: grid;
  gap: 0.3rem;
}

.end-total-row {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.end-total-row span {
  text-align: right;
  min-width: 140px;
}

.end-total-row-net {
  margin-top: 0.1rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--color-border);
}

.end-total-row-net strong {
  font-size: 1.02rem;
}

.end-total-row-net span {
  font-size: 1.12rem;
  font-weight: 800;
}

.profit-positive {
  color: #15803d;
}

.profit-negative {
  color: #b91c1c;
}

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

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

.input-inline-error {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--color-danger);
  line-height: 1.2;
}

.quantity-main {
  font-weight: 600;
  line-height: 1.1;
}

.quantity-meta {
  margin-top: 0.12rem;
  font-size: 0.78rem;
  line-height: 1.1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.employee-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: var(--space-3);
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.employee-modal-panel {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  background: #fbfdff;
  min-height: 0;
  overflow: hidden;
}

.employee-modal-panel h3,
.employee-modal-panel h4 {
  margin-bottom: var(--space-2);
}

.employee-modal-panel-activity {
  display: flex;
  flex-direction: column;
}

.employee-activity-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

#selectedEmployee {
  margin: 0 0 var(--space-2);
}

.employee-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  gap: var(--space-3);
  min-height: clamp(620px, 72vh, 860px);
}

.voyage-detail-grid {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.3fr);
}

.voyage-right-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--space-3);
  min-height: 0;
}

.employee-page-panel {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  background: #fbfdff;
  min-height: 0;
  overflow: hidden;
}

.employee-page-panel-activity {
  display: flex;
  flex-direction: column;
}

.employee-page-panel-activity .employee-activity-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.archived-voyage .employee-page-panel-activity .employee-activity-scroll {
  flex: 0 0 auto;
  max-height: min(30vh, 300px);
  overflow-y: auto;
}

.archived-breakdown-panel {
  padding: 0.9rem 1rem;
  align-self: start;
}

.archived-breakdown-panel h3 {
  margin-bottom: 0.5rem;
}

.archived-breakdown-panel .table-wrap {
  margin-bottom: 0.55rem;
}

.voyage-detail-grid .employee-page-panel,
.voyage-detail-grid .employee-page-panel-activity {
  max-height: min(76vh, 860px);
  overflow: hidden;
}

.voyage-detail-grid .employee-page-panel {
  overflow-y: auto;
}

.voyage-detail-grid .voyage-right-column .employee-page-panel {
  overflow: hidden;
}

.modal-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.details-split {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: var(--space-4);
}

.details-block {
  border: none;
  border-radius: 10px;
  padding: 0.2rem 0.2rem 0.9rem;
  background: transparent;
}

.details-grid {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  row-gap: 0.6rem;
  column-gap: 0.9rem;
}

.details-grid dt,
.details-grid dd {
  margin: 0;
}

.details-grid dt {
  font-weight: 600;
  color: var(--color-ink-soft);
}

.details-grid dd {
  color: var(--color-ink);
}

.details-subhead {
  margin-top: var(--space-4);
}

.roles-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.34fr) minmax(0, 0.66fr);
  gap: var(--space-3);
}

.roles-list-panel,
.roles-details-panel {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.roles-list-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.roles-list-panel .role-list {
  margin-top: 0;
  max-height: min(68vh, 720px);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.7rem 0.15rem;
  text-align: left;
}

.role-row-main {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  width: 100%;
  justify-items: start;
}

.role-row-main span,
.role-row-main small {
  text-align: left;
}

.role-row-selected {
  border-bottom-color: var(--color-primary);
}

.permissions-grid {
  display: grid;
  gap: var(--space-2);
}

.permissions-grid-scroll {
  max-height: min(52vh, 560px);
  overflow-y: auto;
  padding-right: 0.2rem;
}

.permissions-group {
  padding: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fbfdff;
}

.permissions-list {
  display: grid;
  gap: 0.45rem;
}

.permissions-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0;
  font-weight: 500;
}

.permissions-item input {
  width: auto;
  margin: 0.2rem 0 0;
}

.rank-permissions-actions {
  margin-top: 1.65rem;
}

.roles-members-panel {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.roles-members-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.roles-members-candidates,
.roles-members-list {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.55rem;
  background: #fbfdff;
  max-height: 220px;
  overflow-y: auto;
}

.roles-member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #fff;
}

.roles-member-row > div {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.roles-member-row strong,
.roles-member-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voyage-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.78rem 0.84rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.voyage-card-static {
  cursor: default;
  pointer-events: none;
}

.voyage-card:hover,
.voyage-card:focus-visible {
  border-color: color-mix(in srgb, var(--color-secondary) 45%, white);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
  text-decoration: none;
}

.voyage-card-static:hover,
.voyage-card-static:focus-visible {
  border-color: var(--color-border);
  box-shadow: none;
  transform: none;
}

.voyage-card h3 {
  margin: 0;
  font-size: 0.97rem;
}

.voyage-card-ongoing {
  border-color: color-mix(in srgb, var(--color-secondary) 28%, white);
  box-shadow: 0 10px 24px rgba(37, 52, 117, 0.07);
}

.voyage-card-ongoing:hover,
.voyage-card-ongoing:focus-visible {
  box-shadow: 0 14px 30px rgba(37, 52, 117, 0.1);
}

.voyage-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.voyage-route-line {
  margin: 0.5rem 0 0.45rem;
  font-size: 1.03rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.25;
}

.voyage-card-meta {
  display: grid;
  gap: 0.2rem;
}

.voyage-meta-line {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.voyage-meta-line span {
  color: var(--color-ink-soft);
  font-weight: 600;
  min-width: 3.2rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.19rem 0.54rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-pill-underway {
  position: relative;
  background: #dc2626;
  color: #ffffff;
  border: 1px solid #b91c1c;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  animation: shipUnderwayPulse 1.8s ease-out infinite;
}

.status-pill-in-port {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.status-pill-ended {
  background: #eef2f8;
  color: #4f6486;
  border: 1px solid #d8e1ef;
}

@keyframes shipUnderwayPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-pill-underway {
    animation: none;
  }
}

.voyage-empty-state {
  grid-column: 1 / -1;
  min-height: 170px;
  border: 1px dashed #d8e1ef;
  border-radius: 12px;
  background: #fbfdff;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1rem;
}

.voyage-empty-state h3 {
  margin: 0;
  font-size: 1rem;
}

.voyage-empty-state p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.voyage-empty-icon {
  margin-inline: auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #eef3fb;
  color: #5776b7;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
}

.voyage-empty-state-muted .voyage-empty-icon {
  background: #f3f5f8;
  color: #90a0b8;
}

.voyage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (min-width: 1024px) {
  body.page-intranet.intranet-no-scroll .voyage-grid {
    gap: 0.6rem;
  }

  body.page-intranet.intranet-no-scroll .voyage-card {
    border-radius: 10px;
    padding: 0.58rem 0.62rem;
  }

  body.page-intranet.intranet-no-scroll .voyage-card h3 {
    font-size: 0.88rem;
  }

  body.page-intranet.intranet-no-scroll .voyage-route-line {
    margin: 0.32rem 0 0.3rem;
    font-size: 0.92rem;
    line-height: 1.18;
  }

  body.page-intranet.intranet-no-scroll .voyage-card-meta {
    gap: 0.1rem;
  }

  body.page-intranet.intranet-no-scroll .voyage-meta-line {
    font-size: 0.76rem;
  }
}

.pagination-row {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.finance-line-svg {
  width: 100%;
  height: 170px;
  display: block;
}

.finance-line-svg polyline {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-line-svg.line-primary polyline {
  stroke: var(--color-primary);
}

.finance-line-svg.line-accent polyline {
  stroke: var(--color-secondary);
}

.finance-line-svg.line-muted polyline {
  stroke: #667892;
}

.finance-chart-label-row {
  margin-top: 0.34rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.4rem;
}

.finance-chart-label-row span {
  font-size: 0.8rem;
  color: #475569;
  text-align: center;
}

.finance-stacked-bars {
  min-height: 170px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 0.5rem;
}

.finance-stacked-col {
  display: grid;
  gap: 0.2rem;
  align-items: end;
}

.finance-stacked-col small {
  color: #475569;
  font-size: 0.77rem;
  text-align: center;
}

.finance-stacked-track {
  min-height: 18px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #eef2f7;
}

.finance-stacked-segment {
  display: block;
  width: 100%;
}

.finance-stacked-company {
  background: #253475;
}

.finance-stacked-crew {
  background: #5776b7;
}

.finance-chart-shell {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.4rem;
  padding: 0 0.2rem 1.2rem;
  font-family: var(--font-body);
  box-sizing: border-box;
}

.finance-cartesian-svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  display: block;
}

.finance-axis-line {
  stroke: #94a3b8;
  stroke-width: 1;
}

.finance-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.finance-axis-y-label,
.finance-axis-x-label {
  font-family: var(--font-body);
  fill: #475569;
  font-size: 12.5px;
  font-weight: 500;
}

.finance-axis-y-label {
  dominant-baseline: middle;
}

.finance-axis-x-label {
  dominant-baseline: hanging;
}

.finance-line-path {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-line-point {
  stroke: #ffffff;
  stroke-width: 1.2;
}

.finance-hover-line {
  stroke: #64748b;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.finance-hover-line.hidden {
  display: none;
}

.finance-chart-tooltip {
  position: absolute;
  z-index: 8;
  min-width: 170px;
  max-width: 280px;
  border: 1px solid #d7e2f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  padding: 0.55rem 0.65rem;
  pointer-events: none;
  font-family: var(--font-body);
  box-sizing: border-box;
}

.finance-chart-tooltip.hidden {
  display: none;
}

.finance-tooltip-title {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

.finance-tooltip-row {
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.8rem;
  color: #334155;
}

.finance-tooltip-row strong {
  color: #0f172a;
  font-weight: 700;
  white-space: nowrap;
}

.finance-tooltip-key {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.finance-tooltip-key i,
.finance-legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.finance-chart-legend {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  align-items: center;
  align-content: flex-start;
  max-height: 74px;
  overflow-y: auto;
  padding: 0.4rem 0.14rem 0.12rem;
  border-top: 1px solid #edf2f7;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.finance-legend-item {
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #334155;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.finance-chart-empty {
  min-height: 220px;
  border: 1px dashed #d7e2f0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 0.85rem;
}

.finance-bar-rect {
  transition: opacity 0.14s ease;
}

.finance-bar-rect:hover {
  opacity: 0.86;
}

.ship-status-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.status-switch {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-flex;
}

.status-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.status-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d8e2ef;
  border: 1px solid #c8d5e6;
  transition: background-color 0.2s ease;
}

.status-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.status-switch input:checked + .status-slider {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}

.status-switch input:checked + .status-slider::before {
  transform: translateX(18px);
}

.status-switch input:disabled + .status-slider {
  opacity: 0.6;
}

.autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 220px;
  overflow-y: auto;
  gap: 0.25rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
  padding: 0.3rem;
}

.autocomplete-list.is-open {
  display: grid;
}

.autocomplete-item {
  width: 100%;
  text-align: left;
  padding: 0.42rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: var(--color-ink-soft);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.autocomplete-item:hover {
  border-color: color-mix(in srgb, var(--color-secondary) 38%, white);
  background: color-mix(in srgb, var(--color-secondary) 8%, white);
}

.autocomplete-item.is-active {
  border-color: color-mix(in srgb, var(--color-secondary) 36%, white);
  background: color-mix(in srgb, var(--color-secondary) 13%, white);
}

.autocomplete-item small {
  color: var(--color-muted);
}

.autocomplete-empty {
  padding: 0.45rem 0.55rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.combobox-wrap {
  position: relative;
  margin-bottom: var(--space-2);
}

.combobox-wrap > input {
  margin-bottom: 0;
}

.combobox-wrap-multi {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #ffffff;
  padding: 0.45rem;
}

.combobox-wrap-multi input {
  margin-bottom: 0;
  border: none;
  padding: 0.35rem 0.2rem;
  border-radius: 0;
}

.combobox-wrap-multi input:focus {
  outline: none;
  border: none;
}

.combobox-wrap-multi .pill-list {
  margin-bottom: 0.4rem;
}

.manifest-table tr.row-error td {
  background: color-mix(in srgb, var(--color-danger) 6%, white);
}

.field-error {
  border-color: var(--color-danger) !important;
  background: color-mix(in srgb, var(--color-danger) 6%, white);
}

.inline-feedback {
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.inline-feedback.is-error {
  background: color-mix(in srgb, var(--color-danger) 9%, white);
  border-color: color-mix(in srgb, var(--color-danger) 30%, white);
  color: var(--color-danger);
}

.inline-feedback.is-success {
  background: color-mix(in srgb, var(--color-success) 10%, white);
  border-color: color-mix(in srgb, var(--color-success) 30%, white);
  color: var(--color-success);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  background: #ffffff;
  color: var(--color-ink-soft);
}

.pill-close {
  border: none;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}

.manifest-table-wrap {
  max-height: min(44vh, 520px);
  overflow: auto;
}

.manifest-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.manifest-table th,
.manifest-table td {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.manifest-table input,
.manifest-table select {
  margin-bottom: 0;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.manifest-head-row {
  margin-bottom: 0.6rem;
}

.manifest-head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.manifest-save-state {
  min-width: 64px;
  text-align: right;
  font-size: 0.85rem;
}

.manifest-save-state.is-saving {
  color: var(--color-muted);
}

.manifest-save-state.is-saved {
  color: var(--color-success);
}

.manifest-save-state.is-error {
  color: var(--color-danger);
}

.btn-plus {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.end-actions-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.end-actions-right {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.voyage-field-list {
  margin-bottom: var(--space-3);
}

.voyage-profile-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem 0.65rem;
}

.voyage-field-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  border-bottom: 1px solid #edf2f6;
  padding: 0.35rem 0;
}

.voyage-field-row-departure,
.voyage-field-row-destination,
.voyage-field-row-oow,
.voyage-field-row-crew {
  grid-column: span 3;
}

.voyage-field-row-vessel-name,
.voyage-field-row-vessel-class,
.voyage-field-row-vessel-callsign {
  grid-column: span 2;
}

.voyage-field-row-state,
.voyage-field-row-started,
.voyage-field-row-ended {
  grid-column: span 2;
}

.voyage-field-row-started,
.voyage-field-row-ended {
  grid-column: span 3;
}

.voyage-field-label {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.voyage-field-value {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 0.93rem;
}

.btn-pencil {
  min-height: 30px;
  min-width: 34px;
  padding: 0.2rem 0.35rem;
}

.hold-sweep {
  --hold-pct: 0%;
  transition: filter 0.16s ease;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.btn-submit-hold {
  color: #ffffff;
  border-color: #2e7d32;
  background-color: #43a047;
  background-image: linear-gradient(
    to right,
    #2e7d32 0 var(--hold-pct),
    #43a047 var(--hold-pct) 100%
  );
}

.btn-submit-hold:hover {
  filter: brightness(0.98);
}

.btn-cancel-hold {
  color: #1f2937;
  border-color: #dd9f33;
  background-color: #f2b544;
  background-image: linear-gradient(
    to right,
    #c98d28 0 var(--hold-pct),
    #f2b544 var(--hold-pct) 100%
  );
}

.btn-cancel-hold:hover {
  filter: brightness(0.98);
}

.voyage-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-ink-soft);
}

.voyage-status::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--color-muted);
}

.voyage-status-active {
  color: var(--color-secondary);
}

.voyage-status-active::before {
  background: var(--color-secondary);
  animation: voyagePulse 1.6s ease-in-out infinite;
}

@keyframes voyagePulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-secondary) 45%, transparent);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    opacity: 0.7;
  }
}

@keyframes skeletonShimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 1023px) {
  .employee-modal-grid,
  .employee-page-grid,
  .roles-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .employee-page-panel {
    overflow: visible;
  }

  .voyage-right-column {
    grid-template-rows: auto;
  }

  .end-voyage-layout {
    grid-template-columns: 1fr;
  }

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

  .voyage-field-row {
    grid-column: span 1 !important;
  }

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

@media (max-width: 760px) {
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .details-split {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .details-grid {
    grid-template-columns: 1fr;
    row-gap: 0.25rem;
  }

  .details-grid dt {
    margin-top: 0.5rem;
  }

  .details-grid dt:first-child {
    margin-top: 0;
  }

  .data-table {
    min-width: 680px;
  }

  .voyage-profile-grid {
    grid-template-columns: 1fr;
  }

  .voyage-grid {
    grid-template-columns: 1fr;
  }
}

.live-notifications-root {
  position: fixed;
  top: 88px;
  right: 16px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.live-notification-toast {
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 36px rgba(17, 24, 39, 0.18);
  padding: 10px 12px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.live-notification-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.live-notification-toast.is-urgent {
  border-color: rgba(220, 38, 38, 0.4);
  box-shadow: 0 12px 36px rgba(220, 38, 38, 0.2);
}

.live-notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-notification-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(17, 45, 114, 0.14);
  color: rgba(17, 45, 114, 0.95);
}

.live-notification-toast.is-urgent .live-notification-badge {
  background: rgba(220, 38, 38, 0.14);
  color: rgba(153, 27, 27, 1);
}

.live-notification-close {
  border: 0;
  background: transparent;
  color: rgba(17, 24, 39, 0.65);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.live-notification-toast h4 {
  margin: 8px 0 4px;
  font-size: 15px;
}

.live-notification-toast p {
  margin: 0 0 6px;
  font-size: 14px;
  color: rgba(17, 24, 39, 0.85);
}

.live-notification-toast small {
  color: rgba(17, 24, 39, 0.62);
}
