:root {
  color-scheme: light;
  --ink: oklch(23% 0.036 247);
  --muted: oklch(48% 0.028 247);
  --page: oklch(96.5% 0.012 226);
  --surface: oklch(99.2% 0.005 225);
  --paper: oklch(98.6% 0.008 224);
  --header: oklch(27% 0.095 251);
  --header-2: oklch(22% 0.085 254);
  --line: oklch(88% 0.018 235);
  --hairline: oklch(91% 0.012 235);
  --band: oklch(94.5% 0.01 230);
  --band-blue: oklch(92.5% 0.04 210);
  --blue: oklch(56% 0.14 225);
  --blue-soft: oklch(92.5% 0.05 224);
  --green: oklch(59% 0.13 164);
  --green-soft: oklch(93% 0.052 164);
  --red: oklch(55% 0.16 25);
  --red-soft: oklch(94% 0.045 25);
  --amber: oklch(75% 0.14 78);
  --amber-soft: oklch(95% 0.052 82);
  --shadow: 0 16px 45px oklch(35% 0.04 247 / 0.12);
  --radius: 8px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.agency-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.agency-shell.is-sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.agency-sidebar {
  padding: 20px 14px;
  color: oklch(96% 0.012 250);
  background: linear-gradient(180deg, var(--header-2), oklch(24% 0.078 250));
  border-right: 1px solid oklch(35% 0.075 248);
}

.agency-shell.is-sidebar-collapsed .agency-sidebar {
  padding-inline: 10px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.nav-item,
.nav-child {
  width: 100%;
  border: 0;
  color: oklch(90% 0.018 248);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-weight: 650;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.86;
}

.nav-item:hover,
.nav-parent.is-active {
  color: oklch(99% 0.005 250);
  background: oklch(36% 0.08 248);
}

.nav-children {
  display: grid;
  gap: 5px;
  margin: 4px 0 12px 24px;
}

.nav-child {
  position: relative;
  min-height: 38px;
  padding: 0 12px 0 28px;
  border-radius: var(--radius);
  color: oklch(78% 0.028 248);
  font-weight: 650;
}

.nav-child::before {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 99px;
  background: currentColor;
  transform: translateY(-50%);
  opacity: 0.58;
}

.nav-child.is-active {
  color: oklch(99% 0.005 250);
  background: oklch(97% 0.012 235 / 0.12);
  box-shadow: inset 0 0 0 1px oklch(92% 0.035 235 / 0.45);
}

.agency-shell.is-sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding-inline: 0;
  font-size: 0;
}

.agency-shell.is-sidebar-collapsed .nav-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.agency-shell.is-sidebar-collapsed .nav-children {
  margin: 8px 0 12px;
}

.agency-shell.is-sidebar-collapsed .nav-child {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0;
}

.agency-shell.is-sidebar-collapsed .nav-child::before {
  position: static;
  width: 8px;
  height: 8px;
  transform: none;
}

.agency-main {
  min-width: 0;
  background: var(--page);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.system-context,
.topbar-actions,
.role-menu {
  display: flex;
  align-items: center;
}

.system-context {
  gap: 12px;
}

.system-context p,
.system-context strong {
  display: block;
  margin: 0;
}

.system-context p {
  color: var(--muted);
  font-size: 12px;
}

.system-context strong {
  margin-top: 2px;
  font-size: 16px;
}

.icon-button,
.density-button,
.language-toggle button,
.action-button,
.table-tool-button,
.tab-button,
.reminder-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.icon-button {
  width: 36px;
  height: 36px;
  font-size: 17px;
}

.topbar-actions {
  gap: 10px;
}

.density-button {
  min-width: 38px;
  height: 34px;
}

.language-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(96% 0.01 230);
}

.language-toggle button {
  min-width: 48px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.language-toggle .is-active {
  color: var(--blue);
  background: var(--surface);
  box-shadow: 0 5px 16px oklch(38% 0.05 240 / 0.1);
}

.role-menu {
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
}

.role-menu span {
  color: var(--muted);
  font-weight: 750;
}

.role-menu select {
  min-width: 116px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.workspace-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 32px 14px;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.agency-view {
  padding: 0 32px 36px;
}

.sheet-board {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sheet-board.fpc-sheet {
  overflow: visible;
}

.sheet-title-row {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 20px;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.sheet-title-row-actions {
  justify-content: space-between;
  gap: 16px;
}

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

.fpc-toolbar {
  flex-wrap: wrap;
}

.fpc-toolbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.fpc-tool-button,
.fpc-icon-button {
  min-width: 86px;
  border-color: oklch(36% 0.09 247);
  color: oklch(97% 0.006 245);
  background: var(--header);
}

.fpc-icon-button {
  min-width: 36px;
  width: 36px;
  padding: 0;
}

[data-fpc-placeholder] {
  cursor: default;
}

.sheet-search {
  display: grid;
  grid-template-columns: auto minmax(180px, 360px);
  align-items: center;
  gap: 8px;
  width: min(420px, 100%);
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(98% 0.006 225);
}

.sheet-search span {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.sheet-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}

.sheet-search input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.sheet-search:focus-within {
  border-color: oklch(70% 0.09 225);
  box-shadow: 0 0 0 3px oklch(84% 0.055 225 / 0.35);
}

.sheet-header,
.sheet-row {
  display: grid;
  align-items: stretch;
}

.selection-columns {
  grid-template-columns:
    minmax(132px, 1.08fr)
    minmax(82px, 0.62fr)
    minmax(92px, 0.7fr)
    minmax(84px, 0.68fr)
    minmax(72px, 0.5fr)
    minmax(108px, 0.74fr)
    minmax(108px, 0.74fr)
    minmax(250px, 2fr)
    minmax(150px, 1fr)
    minmax(92px, 0.62fr);
}

.detail-columns {
  grid-template-columns:
    minmax(132px, 1.12fr)
    minmax(78px, 0.62fr)
    minmax(92px, 0.7fr)
    minmax(84px, 0.64fr)
    minmax(68px, 0.48fr)
    minmax(140px, 1.05fr)
    minmax(142px, 1.05fr)
    minmax(220px, 1.5fr)
    minmax(88px, 0.58fr);
}

.orders-columns {
  grid-template-columns:
    minmax(132px, 1.08fr)
    minmax(82px, 0.62fr)
    minmax(92px, 0.7fr)
    minmax(84px, 0.68fr)
    minmax(72px, 0.5fr)
    minmax(108px, 0.74fr)
    minmax(108px, 0.74fr)
    minmax(250px, 2fr)
    minmax(128px, 0.86fr);
}

.dispatch-columns {
  grid-template-columns:
    minmax(132px, 1fr)
    minmax(82px, 0.62fr)
    minmax(96px, 0.72fr)
    minmax(128px, 0.92fr)
    minmax(140px, 1fr)
    minmax(144px, 1fr)
    minmax(218px, 1.5fr)
    minmax(90px, 0.62fr);
}

.fpc-columns {
  grid-template-columns:
    minmax(156px, 1.14fr)
    minmax(96px, 0.72fr)
    minmax(88px, 0.62fr)
    minmax(76px, 0.54fr)
    minmax(138px, 0.96fr)
    minmax(146px, 1fr)
    minmax(220px, 1.5fr)
    minmax(124px, 0.86fr)
    minmax(108px, 0.76fr)
    minmax(146px, 1fr);
}

.order-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background: oklch(18% 0.035 247 / 0.38);
  backdrop-filter: blur(4px);
}

.order-modal-panel {
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid oklch(82% 0.028 230);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px oklch(22% 0.045 247 / 0.28);
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: oklch(18% 0.035 247 / 0.36);
  backdrop-filter: blur(4px);
}

.confirm-modal-panel {
  width: min(460px, 100%);
  border: 1px solid oklch(83% 0.03 230);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 22px 58px oklch(22% 0.045 247 / 0.28);
}

.confirm-modal-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--hairline);
  background: oklch(97% 0.014 224);
}

.confirm-modal-header p,
.confirm-modal-header h2,
.confirm-modal-message {
  margin: 0;
}

.confirm-modal-header p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.confirm-modal-header h2 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.25;
}

.confirm-modal-message {
  padding: 18px 20px 8px;
  color: var(--ink);
  font-weight: 850;
}

.confirm-modal-preview {
  margin: 0 20px;
  min-height: 42px;
  max-height: 132px;
  overflow: auto;
  border: 1px solid oklch(84% 0.024 230);
  border-radius: 6px;
  padding: 10px 12px;
  color: oklch(36% 0.05 235);
  background: oklch(98.2% 0.008 230);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 18px;
}

.order-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: oklch(96.5% 0.016 224);
}

.order-modal-header p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.order-modal-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.order-modal-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  padding: 20px 22px 22px;
}

.order-modal-layout {
  grid-template-areas:
    "number number"
    "vessel imo"
    "date customer"
    "deadline location"
    ". products"
    "actions actions";
}

.field-order-no {
  grid-area: number;
}

.field-vessel {
  grid-area: vessel;
}

.field-imo {
  grid-area: imo;
}

.field-date {
  grid-area: date;
}

.field-customer {
  grid-area: customer;
}

.field-deadline {
  grid-area: deadline;
}

.field-location {
  grid-area: location;
}

.field-products {
  grid-area: products;
}

.order-modal-form label,
.modal-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.order-modal-form label span,
.modal-field > span,
.order-number-preview span,
.order-form-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.order-modal-form input,
.order-modal-form select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 650;
}

.order-modal-form input:focus,
.order-modal-form select:focus,
.segmented-choice button:focus-visible {
  outline: 3px solid oklch(78% 0.09 225 / 0.35);
  outline-offset: 1px;
  border-color: var(--blue);
}

.date-input-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
}

.date-input-control input[readonly] {
  cursor: pointer;
}

.date-picker-trigger {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.date-picker-trigger:hover {
  background: var(--blue-soft);
}

.date-picker-shell {
  position: fixed;
  top: var(--date-picker-top, 258px);
  left: var(--date-picker-left, 22px);
  z-index: 80;
  width: 326px;
  max-height: var(--date-picker-max-height, 326px);
  overflow: hidden;
  padding: 0 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: oklch(99.8% 0.002 230);
  box-shadow: 0 18px 35px oklch(34% 0.04 240 / 0.16);
}

.date-picker-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid var(--hairline);
}

.date-picker-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  color: oklch(48% 0.025 240);
  background: transparent;
  font-size: 30px;
  line-height: 1;
}

.date-picker-arrow:hover {
  color: var(--ink);
  background: oklch(96% 0.012 230);
}

.date-picker-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: oklch(34% 0.025 245);
  font-weight: 850;
}

.date-picker-title span {
  color: oklch(43% 0.025 245);
  font-size: 14px;
  font-weight: 800;
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.date-picker-weekdays {
  padding: 14px 12px 8px;
  color: oklch(36% 0.018 240);
  font-weight: 850;
}

.date-picker-weekdays span {
  display: grid;
  place-items: center;
  height: 22px;
}

.date-picker-grid {
  max-height: calc(var(--date-picker-max-height, 326px) - 96px);
  overflow-y: auto;
  padding: 0 12px;
  row-gap: 13px;
  overscroll-behavior: contain;
}

.date-picker-day {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: oklch(39% 0.022 245);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.date-picker-day:hover {
  background: oklch(94% 0.018 225);
}

.date-picker-day.is-muted {
  color: oklch(51% 0.018 245);
}

.date-picker-day.is-selected {
  color: oklch(36% 0.07 220);
  background: oklch(90.5% 0.045 220);
}

.order-number-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(96.8% 0.012 224);
}

.order-number-preview strong {
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

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

.segmented-choice button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  font-weight: 850;
}

.segmented-choice button.is-active {
  border-color: oklch(74% 0.095 170);
  color: oklch(35% 0.09 170);
  background: var(--green-soft);
}

.segmented-choice button[data-location-choice="港區"].is-active {
  border-color: oklch(74% 0.095 170);
  color: oklch(35% 0.09 170);
  background: var(--green-soft);
}

.segmented-choice button[data-location-choice="錨地"].is-active {
  border-color: oklch(82% 0.12 78);
  color: oklch(45% 0.1 70);
  background: var(--amber-soft);
}

.product-quantity-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(97.2% 0.012 224);
}

.product-quantity-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.product-quantity-row .product-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: var(--radius);
  font-weight: 850;
}

.product-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 56px;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid oklch(99% 0.003 230 / 0.82);
  border-radius: 999px;
  color: oklch(14% 0.04 250);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 900;
  box-shadow: 0 0 0 2px oklch(99% 0.003 230 / 0.72), 0 2px 5px oklch(35% 0.06 240 / 0.12);
}

.product-lsfo {
  color: #0E3327;
  background: rgb(58, 212, 115);
}

.product-hsfo {
  color: #0B1F33;
  background: rgb(85, 154, 249);
}

.product-mgo {
  color: #3A2408;
  background: rgb(245, 126, 44);
}

.product-cell {
  justify-items: center;
}

.product-cell .stack-values {
  align-items: center;
  justify-items: center;
  gap: 6px;
}

.order-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  grid-area: actions;
  gap: 8px;
  min-width: 0;
  padding-top: 4px;
}

.sheet-header {
  min-height: 58px;
  color: oklch(98.5% 0.005 245);
  background: var(--header);
}

.sheet-header > div {
  display: grid;
  place-items: center;
  padding: 9px 8px;
  text-align: center;
  font-weight: 800;
  line-height: 1.25;
}

.sheet-header span {
  display: block;
}

.sheet-header span + span {
  margin-top: 4px;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.sheet-body {
  display: grid;
  background: var(--surface);
}

.sheet-row {
  position: relative;
  min-height: 66px;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.selection-row:nth-of-type(even),
.detail-row:nth-of-type(even),
.order-row:nth-of-type(even),
.dispatch-row:nth-of-type(even),
.fpc-row:nth-of-type(even) {
  background: var(--band);
}

.sheet-row.is-expanded {
  background: var(--blue-soft);
}

.sheet-row:hover {
  background: oklch(94% 0.028 220);
}

.sheet-cell {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 11px 10px;
  text-align: center;
  line-height: 1.35;
}

.ship-cell strong,
.agency-person strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ship-cell .imo-text,
.agency-person span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fpc-ship-cell {
  position: relative;
  justify-items: center;
}

.fpc-vessel-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.general-agent-star {
  position: absolute;
  left: 10px;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid oklch(73% 0.075 232);
  border-radius: 999px;
  color: oklch(34% 0.1 235);
  background: oklch(94% 0.035 232);
  transform: translateY(-50%);
  z-index: 5;
}

.general-agent-star-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: currentColor;
}

.general-agent-star-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.7;
}

.general-agent-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 9px);
  z-index: 95;
  display: grid;
  gap: 9px;
  width: max-content;
  min-width: 360px;
  max-width: min(720px, calc(100vw - 64px));
  padding: 12px 14px;
  border: 1px solid oklch(42% 0.055 245);
  border-radius: 7px;
  color: oklch(96% 0.01 235);
  background: oklch(28% 0.035 245);
  box-shadow: 0 18px 38px oklch(20% 0.035 245 / 0.28);
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.general-agent-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 12px;
  width: 10px;
  height: 10px;
  border-top: 1px solid oklch(42% 0.055 245);
  border-left: 1px solid oklch(42% 0.055 245);
  background: inherit;
  transform: rotate(45deg);
}

.general-agent-star:hover .general-agent-tooltip,
.general-agent-star:focus-within .general-agent-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.general-agent-tooltip-title {
  display: block;
  color: oklch(98% 0.008 235);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.general-agent-tooltip-grid {
  display: grid;
  gap: 6px;
}

.general-agent-tooltip-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.92fr) minmax(132px, 1fr) minmax(112px, 0.9fr);
  align-items: center;
  gap: 12px;
}

.general-agent-tooltip-row {
  min-height: 28px;
  border-top: 1px solid oklch(48% 0.034 245 / 0.7);
  padding-top: 6px;
  color: oklch(92% 0.009 235);
  font-size: 12px;
  font-weight: 730;
  line-height: 1.25;
}

.general-agent-tooltip-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.general-agent-tooltip-row.is-pending {
  grid-template-columns: minmax(92px, 0.92fr) minmax(0, 1fr);
  color: oklch(78% 0.018 240);
}

.general-agent-tooltip-row strong {
  color: oklch(98% 0.008 235);
  font-weight: 900;
}

.general-agent-tooltip-pending {
  justify-self: start;
  border: 1px solid oklch(58% 0.03 240);
  border-radius: 999px;
  padding: 2px 8px;
  color: oklch(83% 0.016 240);
  background: oklch(36% 0.028 245);
  font-size: 11px;
  font-weight: 820;
}

.mono-cell,
.date-cell,
.qty-cell {
  font-variant-numeric: tabular-nums;
}

.place-pill {
  display: inline-flex;
  justify-content: center;
  justify-self: center;
  min-width: 54px;
  padding: 4px 9px;
  border-radius: 999px;
  color: oklch(35% 0.08 185);
  background: var(--green-soft);
  font-weight: 800;
}

.place-pill.anchor {
  color: oklch(45% 0.1 70);
  background: var(--amber-soft);
}

.place-cell {
  justify-items: center;
}

.stack-values {
  display: grid;
  gap: 8px;
}

.stack-values span {
  display: block;
  min-height: 18px;
}

.progress-cell {
  justify-items: center;
}

.progress-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid oklch(74% 0.11 156);
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.progress-badge.danger {
  border-color: oklch(68% 0.18 25);
  color: var(--red);
  background: var(--red-soft);
}

.remark-cell span {
  overflow-wrap: anywhere;
}

.dispatch-control-cell {
  justify-items: stretch;
}

.schedule-barge-view,
.dispatch-schedule-view {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 44px;
}

.schedule-barge-time,
.schedule-barge-name,
.dispatch-schedule-time,
.dispatch-schedule-barge {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 18px;
  font-weight: 400;
  line-height: 1.35;
}

.schedule-barge-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.dispatch-schedule-time span,
.dispatch-schedule-barge span {
  display: block;
}

.schedule-barge-name,
.dispatch-schedule-barge {
  font-weight: 400;
}

.dispatch-schedule-editor {
  display: grid;
  gap: 8px;
  width: 100%;
}

.dispatch-datetime-editor {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) 34px minmax(68px, 0.58fr);
  gap: 6px;
}

.dispatch-control {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: oklch(98% 0.006 225);
  font: inherit;
  font-weight: 750;
}

.dispatch-control:focus {
  outline: 0;
  border-color: oklch(70% 0.09 225);
  box-shadow: 0 0 0 3px oklch(84% 0.055 225 / 0.35);
}

.dispatch-product-list {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.dispatch-product-line {
  display: grid;
  grid-template-columns: minmax(56px, auto) minmax(44px, auto);
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dispatch-actions {
  justify-items: center;
}

.customer-cell {
  text-align: center;
}

.customer-cell span {
  overflow-wrap: anywhere;
}

.agency-person {
  gap: 2px;
}

.port-agent-cell {
  position: relative;
  justify-items: center;
  overflow: visible;
}

.port-agent-cell.has-tooltip {
  cursor: help;
}

.port-agent-cell.has-tooltip:focus-visible {
  outline: 3px solid oklch(78% 0.09 225 / 0.32);
  outline-offset: -3px;
}

.port-agent-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 40;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  margin-top: 0 !important;
  padding: 7px 10px;
  border: 1px solid oklch(45% 0.105 238);
  border-radius: 6px;
  color: oklch(98% 0.006 230) !important;
  background: oklch(28% 0.075 238);
  box-shadow: 0 10px 18px oklch(30% 0.06 240 / 0.22);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.port-agent-tooltip::before {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  content: "";
  border-top: 1px solid oklch(45% 0.105 238);
  border-left: 1px solid oklch(45% 0.105 238);
  background: oklch(28% 0.075 238);
  transform: translateX(-50%) rotate(45deg);
}

.port-agent-cell.has-tooltip:hover .port-agent-tooltip,
.port-agent-cell.has-tooltip:focus-within .port-agent-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fpc-row:nth-last-of-type(-n + 2) .port-agent-tooltip {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
}

.fpc-row:nth-last-of-type(-n + 2) .port-agent-tooltip::before {
  top: auto;
  bottom: -6px;
  border-top: 0;
  border-right: 1px solid oklch(45% 0.105 238);
  border-bottom: 1px solid oklch(45% 0.105 238);
  border-left: 0;
}

.fpc-row:nth-last-of-type(-n + 2) .port-agent-cell.has-tooltip:hover .port-agent-tooltip,
.fpc-row:nth-last-of-type(-n + 2) .port-agent-cell.has-tooltip:focus-within .port-agent-tooltip {
  transform: translate(-50%, 0);
}

.agency-empty {
  min-height: 22px;
}

.action-cell {
  justify-items: center;
}

.reminder-cell {
  min-height: 1px;
}

.reminder-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 5px 10px;
  border: 1px solid oklch(78% 0.1 25);
  border-radius: 999px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.order-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.action-button {
  min-width: 74px;
  height: 32px;
  border-color: oklch(74% 0.095 220);
  color: oklch(36% 0.11 220);
  background: var(--blue-soft);
  font-weight: 800;
}

.table-tool-button {
  min-width: 64px;
  height: 32px;
  border-color: oklch(74% 0.095 220);
  color: oklch(36% 0.11 220);
  background: var(--blue-soft);
  font-weight: 800;
}

.table-tool-button.primary {
  min-width: 86px;
}

.table-tool-button.danger {
  border-color: oklch(75% 0.09 25);
  color: var(--red);
  background: var(--red-soft);
}

.action-button.danger {
  border-color: oklch(75% 0.09 25);
  color: var(--red);
  background: var(--red-soft);
}

.action-button.muted,
.action-button:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface-muted);
  box-shadow: none;
  cursor: default;
}

.action-button:disabled {
  opacity: 1;
}

.reminder-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  height: 32px;
  border-color: oklch(78% 0.07 170);
  color: oklch(35% 0.09 170);
  background: var(--green-soft);
  font-weight: 800;
}

.reminder-button.hold {
  border-color: oklch(75% 0.08 25);
  color: var(--red);
  background: var(--red-soft);
}

.reminder-button::before {
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 99px;
  background: currentColor;
}

.detail-time {
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.detail-time span {
  display: block;
}

.expanded-sheet {
  padding: 12px 12px 14px;
  background: oklch(95.8% 0.014 220);
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.fpc-expanded-sheet {
  padding: 12px 14px 16px;
  background: oklch(95.8% 0.014 220);
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.fpc-detail-shell {
  width: 100%;
  padding: 12px 14px 14px;
  border: 1px solid oklch(88% 0.018 230);
  border-radius: 6px;
  background: linear-gradient(180deg, oklch(99% 0.003 230), oklch(98.2% 0.006 230));
  box-shadow: 0 8px 18px oklch(45% 0.04 230 / 0.08);
}

.fpc-tab-strip {
  display: flex;
  align-items: end;
  overflow-x: auto;
  border-bottom: 2px solid oklch(38% 0.13 238);
}

.fpc-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid oklch(78% 0.022 230);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: oklch(38% 0.075 235);
  background: oklch(97.5% 0.006 230);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.fpc-tab-button + .fpc-tab-button {
  margin-left: -1px;
}

.fpc-tab-button.is-active {
  border-color: oklch(38% 0.13 238);
  color: oklch(98.5% 0.005 230);
  background: linear-gradient(180deg, oklch(43% 0.14 238), oklch(36% 0.13 239));
}

.fpc-tab-button:not(.is-active):hover,
.fpc-tab-button:not(.is-active):focus-visible {
  color: oklch(32% 0.1 235);
  background: oklch(94% 0.026 230);
}

.fpc-tab-panel {
  min-height: 118px;
  border: 1px solid oklch(82% 0.026 230);
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: oklch(99% 0.003 230);
}

.fpc-tab-placeholder {
  min-height: 118px;
}

.fpc-remark-panel {
  display: grid;
  gap: 14px;
  min-height: 168px;
  padding: 16px;
}

.fpc-remark-compose {
  display: grid;
  grid-template-columns: minmax(520px, 0.66fr) minmax(260px, 0.28fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.fpc-remark-input,
.fpc-remark-edit-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid oklch(78% 0.035 230);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: oklch(99.4% 0.004 230);
  font: inherit;
  font-weight: 720;
  box-shadow: inset 0 1px 2px oklch(35% 0.04 240 / 0.08);
}

.fpc-remark-input:focus,
.fpc-remark-edit-input:focus {
  outline: 3px solid oklch(78% 0.09 225 / 0.3);
  outline-offset: 1px;
  border-color: var(--blue);
}

.fpc-remark-submit {
  min-width: 260px;
  height: 38px;
  border-color: oklch(36% 0.09 247);
  border-radius: 4px;
  color: oklch(98% 0.006 245);
  background: var(--header);
  font-weight: 900;
}

.fpc-remark-submit:hover,
.fpc-remark-submit:focus-visible {
  background: oklch(33% 0.11 240);
}

.fpc-remark-board {
  overflow: visible;
  border: 1px solid oklch(86% 0.018 230);
  border-radius: 5px;
  background: oklch(99.2% 0.004 230);
}

.fpc-remark-header,
.fpc-remark-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.78fr);
}

.fpc-remark-header {
  min-height: 36px;
  align-items: center;
  color: oklch(98.5% 0.005 230);
  background: var(--header);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.fpc-remark-row {
  min-height: 38px;
  border-top: 1px solid oklch(88% 0.016 230);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.fpc-remark-row:nth-child(even) {
  background: oklch(97.2% 0.008 230);
}

.fpc-remark-row.is-editing {
  background: oklch(96.5% 0.018 225);
}

.fpc-remark-note,
.fpc-remark-audit {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 8px 12px;
}

.fpc-remark-note {
  gap: 12px;
}

.fpc-remark-note > span:not(.fpc-remark-action-spacer) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.fpc-remark-audit {
  justify-content: center;
  gap: 12px;
  color: oklch(42% 0.035 235);
  font-size: 13px;
  font-weight: 720;
}

.fpc-remark-actions {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.fpc-remark-action-spacer,
.fpc-remark-menu-button {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.fpc-remark-menu-button {
  border: 0;
  border-radius: 6px;
  color: oklch(36% 0.045 235);
  background: transparent;
  font-size: 19px;
  line-height: 1;
}

.fpc-remark-menu-button:hover,
.fpc-remark-menu-button:focus-visible {
  color: var(--accent);
  background: oklch(94% 0.026 230);
}

.fpc-remark-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 42;
  display: none;
  min-width: 92px;
  border: 1px solid oklch(84% 0.018 230);
  border-radius: 5px;
  padding: 5px;
  background: oklch(99% 0.004 230);
  box-shadow: 0 10px 22px oklch(35% 0.04 240 / 0.18);
}

.fpc-remark-actions:hover .fpc-remark-menu,
.fpc-remark-actions:focus-within .fpc-remark-menu {
  display: grid;
  gap: 3px;
}

.fpc-remark-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  padding: 0 8px;
  color: oklch(32% 0.055 235);
  background: transparent;
  font-size: 13px;
  font-weight: 780;
  text-align: left;
}

.fpc-remark-menu button:hover,
.fpc-remark-menu button:focus-visible {
  background: var(--blue-soft);
}

.fpc-remark-menu button.danger {
  color: var(--red);
}

.fpc-remark-menu button.danger:hover,
.fpc-remark-menu button.danger:focus-visible {
  background: var(--red-soft);
}

.fpc-remark-menu-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  color: currentColor;
}

.fpc-remark-menu-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fpc-remark-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.fpc-remark-empty {
  display: grid;
  place-items: center;
  min-height: 54px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.remark-cell {
  justify-items: center;
  overflow: visible;
}

.remark-count-wrapper {
  position: relative;
  display: inline-flex;
  justify-content: center;
  overflow: visible;
}

.remark-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 5px 10px;
  border: 1px solid oklch(76% 0.05 230);
  border-radius: 999px;
  color: oklch(34% 0.075 235);
  background: oklch(94.5% 0.026 230);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.remark-count-tooltip {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 90;
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 260px;
  max-width: min(980px, calc(100vw - 64px));
  max-height: min(360px, 70vh);
  overflow: auto;
  padding: 11px 13px;
  border: 1px solid oklch(78% 0.03 230);
  border-radius: 7px;
  color: var(--ink);
  background: oklch(99.5% 0.004 230);
  box-shadow: 0 16px 34px oklch(30% 0.045 240 / 0.2);
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.remark-count-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  width: 10px;
  height: 10px;
  border-top: 1px solid oklch(78% 0.03 230);
  border-left: 1px solid oklch(78% 0.03 230);
  background: inherit;
  transform: rotate(45deg);
}

.remark-tooltip-item {
  display: block;
  min-width: 0;
  white-space: nowrap;
}

.remark-tooltip-item strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 840;
  line-height: 1.35;
}

.remark-count-wrapper:hover .remark-count-tooltip,
.remark-count-wrapper:focus-within .remark-count-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.fpc-row:nth-last-of-type(-n + 3) .remark-count-tooltip {
  top: auto;
  bottom: calc(100% + 9px);
  transform: translateY(-4px);
}

.fpc-row:nth-last-of-type(-n + 3) .remark-count-tooltip::before {
  top: auto;
  bottom: -6px;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid oklch(78% 0.03 230);
  border-bottom: 1px solid oklch(78% 0.03 230);
}

.fpc-row:nth-last-of-type(-n + 3) .remark-count-wrapper:hover .remark-count-tooltip,
.fpc-row:nth-last-of-type(-n + 3) .remark-count-wrapper:focus-within .remark-count-tooltip {
  transform: translateY(0);
}

.fpc-sales-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
  gap: 16px;
  min-height: 218px;
  padding: 16px;
}

.fpc-sales-layout.is-general-agent-off {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
}

.fpc-sales-section {
  position: relative;
  min-width: 0;
  border: 1px solid oklch(88% 0.018 230);
  border-radius: 6px;
  padding: 14px 16px;
  background: oklch(99.2% 0.004 230);
  box-shadow: inset 0 -1px 0 oklch(89% 0.014 230 / 0.72);
}

.fpc-sales-section.is-disabled {
  border-style: dashed;
  background:
    linear-gradient(135deg, oklch(99.2% 0.004 230 / 0.94), oklch(97.2% 0.008 230 / 0.94)),
    repeating-linear-gradient(135deg, oklch(92% 0.012 230 / 0.34) 0 8px, transparent 8px 16px);
}

[data-fpc-sales-disabled] .fpc-sales-field,
[data-fpc-sales-disabled] .fpc-sales-readonly-field,
[data-fpc-sales-disabled] .fpc-step-main,
[data-fpc-sales-disabled] .fpc-step-note-field,
[data-fpc-sales-disabled] .fpc-step-note,
[data-fpc-sales-disabled] .fpc-step-actions {
  opacity: 0.58;
}

[data-fpc-sales-disabled] input,
[data-fpc-sales-disabled] button:not([data-fpc-general-agent-toggle]) {
  cursor: not-allowed;
}

.fpc-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  margin-bottom: 12px;
  color: var(--ink);
}

.fpc-section-heading strong {
  font-size: 16px;
  font-weight: 900;
}

.fpc-section-heading .fpc-role-switch,
.fpc-section-heading .fpc-general-agent-status {
  margin-left: auto;
}

.fpc-section-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--accent);
  background: oklch(94% 0.028 230);
}

.fpc-section-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fpc-general-agent-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0 12px;
  border-bottom: 1px solid oklch(89% 0.014 230);
  font-weight: 780;
}

.fpc-general-agent-status {
  justify-self: end;
  min-width: 52px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.fpc-general-agent-status.is-yes {
  border-color: oklch(72% 0.12 164);
  color: var(--green);
  background: var(--green-soft);
}

.fpc-general-agent-status.is-no {
  border-color: oklch(76% 0.12 25);
  color: var(--red);
  background: var(--red-soft);
}

.fpc-role-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.fpc-role-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fpc-role-switch-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 78px;
  height: 30px;
  border: 1px solid oklch(82% 0.025 230);
  border-radius: 999px;
  color: oklch(42% 0.03 240);
  background: oklch(93% 0.018 230);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
}

.fpc-role-switch-track::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 34px;
  height: 22px;
  content: "";
  border-radius: 999px;
  background: oklch(99% 0.004 230);
  box-shadow: 0 2px 5px oklch(35% 0.05 240 / 0.18);
  transition: transform 160ms ease, background-color 160ms ease;
}

.fpc-role-switch-track span {
  position: relative;
  z-index: 1;
  text-align: center;
}

.fpc-role-switch input:checked + .fpc-role-switch-track {
  border-color: oklch(72% 0.12 164);
  color: var(--green);
  background: var(--green-soft);
}

.fpc-role-switch input:not(:checked) + .fpc-role-switch-track {
  border-color: oklch(76% 0.12 25);
  color: var(--red);
  background: var(--red-soft);
}

.fpc-role-switch input:not(:checked) + .fpc-role-switch-track::before {
  transform: translateX(38px);
}

.fpc-role-switch input:not(:checked) + .fpc-role-switch-track span:first-child,
.fpc-role-switch input:checked + .fpc-role-switch-track span:last-child {
  opacity: 0;
}

.fpc-sales-field-grid {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.fpc-sales-field,
.fpc-sales-readonly-field {
  display: grid;
  grid-template-columns: minmax(86px, 0.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: oklch(35% 0.035 235);
  font-size: 15px;
  font-weight: 760;
}

.fpc-sales-readonly-field strong {
  justify-self: end;
  color: oklch(21% 0.055 240);
  font-weight: 820;
}

.fpc-sales-field input {
  width: 100%;
  height: 34px;
  min-width: 0;
  border: 1px solid oklch(78% 0.035 230);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: oklch(99.4% 0.004 230);
  font: inherit;
  font-weight: 760;
  box-shadow: inset 0 1px 2px oklch(35% 0.04 240 / 0.08);
}

.fpc-sales-field input:focus {
  outline: 3px solid oklch(78% 0.09 225 / 0.3);
  outline-offset: 1px;
  border-color: var(--blue);
}

.fpc-stepper {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fpc-step {
  display: grid;
  grid-template-columns: 34px minmax(122px, 0.8fr) minmax(190px, 1.35fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid oklch(89% 0.014 230);
  border-radius: 6px;
  padding: 8px 10px;
  background: oklch(98.8% 0.004 230);
}

.fpc-step-marker {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: oklch(98.5% 0.005 230);
  background: oklch(62% 0.03 235);
  font-size: 13px;
  font-weight: 900;
}

.fpc-step-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.fpc-step-main strong {
  font-size: 15px;
  font-weight: 880;
}

.fpc-step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.fpc-step-note {
  margin: 0;
  color: oklch(34% 0.035 235);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.fpc-step-note.is-empty {
  min-height: 20px;
}

.fpc-step-note-field {
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.fpc-step-note-field span {
  overflow: hidden;
  width: 0;
  height: 0;
}

.fpc-note-input {
  width: 100%;
  height: 30px;
  min-width: 0;
  border: 1px solid oklch(78% 0.035 230);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--ink);
  background: oklch(99.4% 0.004 230);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 2px oklch(35% 0.04 240 / 0.08);
}

.fpc-note-input:focus {
  outline: 3px solid oklch(78% 0.09 225 / 0.3);
  outline-offset: 1px;
  border-color: var(--blue);
}

.fpc-step.is-current {
  border-color: oklch(72% 0.065 225);
  background: oklch(96% 0.018 225);
}

.fpc-step.is-current .fpc-step-marker {
  background: var(--blue);
}

.fpc-step.is-complete {
  border-color: oklch(80% 0.058 155);
  background: oklch(96% 0.026 155);
}

.fpc-step.is-complete .fpc-step-marker {
  background: var(--green);
}

.fpc-step.is-locked {
  color: var(--muted);
  background: oklch(97.2% 0.006 230);
}

.fpc-step-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.fpc-step-action {
  min-width: 64px;
}

.detail-card-shell {
  --detail-field-height: 44px;
  --detail-panel-min-height: calc((var(--detail-field-height) * 4) + 24px);
  width: 100%;
  padding: 16px 18px 18px;
  border: 1px solid oklch(88% 0.018 230);
  border-radius: 6px;
  background: linear-gradient(180deg, oklch(99% 0.003 230), oklch(98.2% 0.006 230));
  box-shadow: 0 8px 18px oklch(45% 0.04 230 / 0.08);
}

.detail-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.detail-card-title-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.detail-title-icon,
.detail-card-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent);
  background: oklch(94% 0.028 230);
  border-radius: 999px;
}

.detail-title-icon {
  width: 38px;
  height: 38px;
}

.detail-card-icon {
  width: 32px;
  height: 32px;
}

.detail-title-icon svg,
.detail-card-icon svg,
.tab-icon svg,
.detail-action-icon svg,
.bunker-field-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-title-icon svg {
  width: 24px;
  height: 24px;
}

.detail-card-title {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
}

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

.detail-panel-action {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 84px;
  padding: 0 14px;
  border: 1px solid oklch(83% 0.018 230);
  border-radius: 6px;
  color: var(--accent);
  background: oklch(99% 0.003 230);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.detail-panel-action:not(.primary):hover,
.detail-panel-action:not(.primary):focus-visible {
  border-color: oklch(78% 0.1 25);
  color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 3px oklch(78% 0.1 25 / 0.18);
}

.detail-panel-action.primary {
  border-color: oklch(42% 0.13 235);
  color: oklch(98% 0.006 230);
  background: linear-gradient(180deg, oklch(43% 0.15 237), oklch(36% 0.13 238));
  box-shadow: 0 8px 16px oklch(36% 0.1 238 / 0.16);
}

.detail-action-icon,
.tab-icon,
.bunker-field-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: currentColor;
}

.detail-action-icon svg,
.tab-icon svg,
.bunker-field-icon svg {
  width: 17px;
  height: 17px;
}

.detail-tabs {
  display: flex;
  gap: 0;
  align-items: end;
  margin-left: 0;
}

.tab-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  height: 36px;
  border: 1px solid oklch(78% 0.022 230);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: oklch(98.5% 0.005 230);
  background: linear-gradient(180deg, oklch(44% 0.14 238), oklch(37% 0.13 239));
  font-size: 15px;
  font-weight: 800;
}

.tab-button:not(.is-active) {
  color: var(--muted);
  background: oklch(98% 0.004 230);
}

.tab-button + .tab-button {
  margin-left: -1px;
}

.detail-tab-rule {
  height: 1px;
  background: oklch(55% 0.12 236);
}

.detail-panel {
  min-height: var(--detail-panel-min-height);
  padding-top: 14px;
}

.detail-card-grid {
  display: grid;
  gap: 8px 16px;
  min-width: 0;
}

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

.detail-info-card {
  display: grid;
  grid-template-columns: 42px minmax(84px, 0.46fr) minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: var(--detail-field-height);
  padding: 7px 14px;
  border: 1px solid oklch(88% 0.018 230);
  border-radius: 6px;
  background: oklch(99% 0.003 230);
  box-shadow: inset 0 -1px 0 oklch(89% 0.014 230 / 0.8);
}

.detail-card-spacer {
  min-height: var(--detail-field-height);
}

.detail-card-label {
  color: oklch(35% 0.035 235);
  font-size: 15px;
  font-weight: 740;
}

.detail-card-label::after {
  content: "：";
}

.detail-card-value {
  justify-self: end;
  color: oklch(21% 0.055 240);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.detail-edit-input {
  justify-self: end;
  width: min(190px, 100%);
  height: 32px;
  min-width: 0;
  border: 1px solid oklch(78% 0.035 230);
  border-radius: 6px;
  padding: 0 9px;
  color: var(--ink);
  background: oklch(99.4% 0.004 230);
  font: inherit;
  font-size: 15px;
  font-weight: 760;
  text-align: right;
  box-shadow: inset 0 1px 2px oklch(35% 0.04 240 / 0.08);
}

.detail-edit-input:focus {
  outline: 3px solid oklch(78% 0.09 225 / 0.3);
  outline-offset: 1px;
  border-color: var(--blue);
}

.bunker-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.bunker-order-card,
.bunker-shared-card {
  min-width: 0;
  min-height: var(--detail-panel-min-height);
  padding: 11px 14px 10px;
  border: 1px solid oklch(88% 0.018 230);
  border-radius: 6px;
  background: oklch(99% 0.003 230);
  box-shadow: inset 0 -1px 0 oklch(89% 0.014 230 / 0.85);
}

.bunker-card-heading,
.bunker-field-row {
  display: grid;
  grid-template-columns: 34px minmax(96px, 0.65fr) minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: var(--detail-field-height);
}

.bunker-card-heading.icon-only {
  grid-template-columns: 34px 1fr;
}

.bunker-field-row.is-note {
  grid-template-columns: 34px minmax(0, 1fr);
}

.bunker-field-row.is-switch {
  grid-template-columns: 34px minmax(132px, 1fr) auto;
}

.bunker-field-row.is-actual-place {
  grid-template-columns: 34px minmax(96px, 0.55fr) minmax(0, 1.25fr);
}

.bunker-field-row.is-note .detail-card-label::after {
  content: "";
}

.bunker-card-rule {
  height: 1px;
  margin: 6px 0 7px;
  background: oklch(58% 0.12 236);
}

.bunker-field-row {
  border-bottom: 1px solid oklch(89% 0.014 230);
}

.bunker-field-row:last-child {
  border-bottom: 0;
}

.bunker-field-icon {
  color: var(--accent);
}

.bunker-field-row .detail-card-value:empty {
  display: none;
}

.actual-place-value.is-missing {
  color: var(--red);
}

.actual-place-editor {
  display: grid;
  grid-template-columns: minmax(74px, 0.78fr) minmax(74px, 0.78fr) minmax(92px, 1fr);
  align-items: center;
  justify-self: end;
  width: min(390px, 100%);
  gap: 6px;
}

.actual-place-type-button {
  height: 32px;
  border: 1px solid oklch(80% 0.025 230);
  border-radius: 14px;
  color: oklch(32% 0.045 238);
  background: oklch(98% 0.006 230);
  font-size: 13px;
  font-weight: 850;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.actual-place-type-button:hover,
.actual-place-type-button:focus-visible {
  border-color: oklch(69% 0.09 225);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px oklch(74% 0.08 225 / 0.22);
}

.actual-place-type-button.is-active {
  border-color: oklch(68% 0.11 160);
  color: oklch(30% 0.09 160);
  background: var(--green-soft);
}

.actual-place-input {
  width: 100%;
}

.yes-no-switch {
  position: relative;
  display: inline-grid;
  justify-self: end;
}

.yes-no-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.switch-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 86px;
  height: 30px;
  border: 1px solid oklch(82% 0.025 230);
  border-radius: 999px;
  background: oklch(93% 0.018 230);
  color: oklch(42% 0.03 240);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  box-shadow: inset 0 1px 2px oklch(35% 0.04 240 / 0.08);
}

.switch-track::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 39px;
  height: 22px;
  content: "";
  border-radius: 999px;
  background: oklch(99% 0.004 230);
  box-shadow: 0 2px 5px oklch(35% 0.05 240 / 0.18);
  transition: transform 160ms ease, background-color 160ms ease;
}

.switch-track span {
  position: relative;
  z-index: 1;
  text-align: center;
}

.yes-no-switch input:checked + .switch-track {
  border-color: oklch(72% 0.12 164);
  color: var(--green);
  background: var(--green-soft);
}

.yes-no-switch input:not(:checked) + .switch-track {
  border-color: oklch(76% 0.12 25);
  color: var(--red);
  background: var(--red-soft);
}

.yes-no-switch input:not(:checked) + .switch-track::before {
  transform: translateX(41px);
}

.yes-no-switch input:not(:checked) + .switch-track span:first-child,
.yes-no-switch input:checked + .switch-track span:last-child {
  opacity: 0;
}

.yes-no-switch.is-readonly {
  pointer-events: none;
}

@media (max-width: 1240px) {
  .selection-columns,
  .detail-columns,
  .dispatch-columns,
  .fpc-columns {
    min-width: 1120px;
  }

  .dispatch-columns {
    min-width: 1220px;
  }

  .fpc-columns {
    min-width: 1320px;
  }

  .fpc-expanded-sheet {
    min-width: 1320px;
  }

  .sheet-board {
    overflow-x: auto;
  }
}

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

  .topbar,
  .workspace-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 16px;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .workspace-header,
  .agency-view {
    padding-right: 16px;
    padding-left: 16px;
  }

  .detail-card-shell {
    padding: 18px 16px;
  }

  .detail-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-card-actions {
    justify-content: flex-end;
  }

  .detail-tabs {
    overflow-x: auto;
  }

  .tab-button {
    min-width: 156px;
  }

  .ship-card-grid,
  .bunker-card-grid,
  .fpc-sales-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .fpc-remark-compose {
    grid-template-columns: minmax(0, 1fr);
  }

  .fpc-remark-submit {
    min-width: 0;
  }

  .fpc-step {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .fpc-step-note-field,
  .fpc-step-note,
  .fpc-step-actions {
    grid-column: 2;
  }

  .detail-card-spacer {
    display: none;
  }

  .detail-info-card {
    grid-template-columns: 48px minmax(82px, 0.5fr) minmax(0, 1fr);
    padding-right: 14px;
    padding-left: 14px;
  }

  .bunker-card-heading,
  .bunker-field-row {
    grid-template-columns: 36px minmax(96px, 0.7fr) minmax(0, 1fr);
  }

  .bunker-field-row.is-note {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .order-modal {
    padding: 14px;
  }

  .order-modal-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-modal-layout {
    grid-template-areas:
      "number"
      "vessel"
      "imo"
      "date"
      "customer"
      "deadline"
      "location"
      "products"
      "actions";
  }

  .date-picker-shell {
    width: min(326px, calc(100% - 28px));
  }
}

@media print {
  .port-agent-tooltip {
    display: none !important;
  }
}
