:root {
  --bg: #f3ecdf;
  --bg-deep: #e8decf;
  --ink: #1a2633;
  --muted: #5c6773;
  --card: #ffffff;
  --border: #dbd2c6;
  --accent: #ef6d3a;
  --accent-dark: #cb5326;
  --accent-2: #1f7b6d;
  --danger: #b64040;
  --shadow: 0 24px 50px rgba(26, 38, 51, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Sora", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-sheen,
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-sheen {
  background:
    radial-gradient(circle at 8% 18%, rgba(155, 213, 246, 0.22), transparent 54%),
    radial-gradient(circle at 92% 8%, rgba(31, 123, 109, 0.16), transparent 50%),
    linear-gradient(125deg, rgba(255, 255, 255, 0.72), rgba(243, 236, 223, 0.5));
}

.bg-grid {
  background-image:
    linear-gradient(rgba(26, 38, 51, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 38, 51, 0.04) 1px, transparent 1px);
  background-size: 140px 140px;
  opacity: 0.34;
}

.shell {
  position: relative;
  z-index: 1;
  padding: 34px 4vw 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  animation: rise 0.65s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 118px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(155, 213, 246, 0.34), rgba(31, 123, 109, 0.26));
  box-shadow: 0 10px 24px rgba(26, 38, 51, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 5px 8px;
  flex: 0 0 auto;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
}


.brand-title {
  font-size: 19px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

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

.app-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1400;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1f7b6d, #2a9d8f);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 18px 34px rgba(31, 123, 109, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-toast.toast-enter {
  animation: toast-rise 0.28s ease both;
}

.user-label {
  font-size: 12px;
  color: var(--muted);
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  animation: rise 0.65s ease both;
}

.login {
  display: grid;
  gap: 18px;
}

.login-grid {
  display: grid;
  gap: 14px;
  max-width: 430px;
}

.stack {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.stack input,
.stack select,
.stack textarea {
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 9px 11px;
  font-family: var(--font);
  background: #fff;
  color: var(--ink);
}

.mini {
  max-width: 180px;
}

.tabbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}

.main-tabbar {
  margin-bottom: 8px;
}

.workspace-nav {
  margin-bottom: 14px;
}

.workspace-tabbar {
  margin: 0;
  padding-left: 14px;
}

.tab-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn-right {
  margin-left: auto;
}

.tab-btn.active {
  background: #1e2f42;
  border-color: #1e2f42;
  color: #fff;
}

.year-tabbar {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  width: max-content;
  margin: 0 0 0 auto;
  position: relative;
  z-index: 2;
  justify-content: flex-end;
}

.year-tab {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fbf7f1, #efe5d4);
  color: var(--ink);
  padding: 7px 14px;
  min-width: 72px;
  border-radius: 12px 12px 8px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(26, 38, 51, 0.06);
}

.year-tab.active {
  background: #dbeeff;
  border-color: #9fc6ec;
  color: #163b69;
}

.year-tab-add {
  min-width: 34px;
  padding-inline: 0;
  font-size: 15px;
  line-height: 1;
}

.year-tab.year-tab-editing {
  padding: 4px 8px;
}

.year-tab-input {
  width: 68px;
  min-width: 68px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: center;
  outline: none;
}

.year-tab-menu {
  position: fixed;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(26, 38, 51, 0.16);
  z-index: 200;
}

.year-tab-transfer-targets {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.year-transfer-target-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.without-bus-value-menu {
  align-items: flex-end;
}

.without-bus-value-menu .stack {
  min-width: 110px;
}

.without-bus-value-menu input {
  width: 100%;
}

.tab-panel {
  display: block;
}

.muted-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.breakdown-year-table th,
.breakdown-year-table td {
  vertical-align: top;
}

.breakdown-year-table th:nth-child(1),
.breakdown-year-table td:nth-child(1) {
  min-width: 110px;
}

.breakdown-year-table th:nth-child(2),
.breakdown-year-table td:nth-child(2) {
  min-width: 80px;
}

.breakdown-year-table th:nth-child(3),
.breakdown-year-table td:nth-child(3) {
  min-width: 220px;
}

.breakdown-year-table th:nth-child(4),
.breakdown-year-table td:nth-child(4) {
  min-width: 70px;
}

.breakdown-year-table th:nth-child(5),
.breakdown-year-table td:nth-child(5) {
  min-width: 84px;
}

.breakdown-year-table th:nth-child(6),
.breakdown-year-table td:nth-child(6),
.breakdown-year-table th:nth-child(7),
.breakdown-year-table td:nth-child(7) {
  min-width: 470px;
}

.breakdown-real-input {
  width: 78px;
  min-width: 78px;
  text-align: right;
}

.breakdown-cell {
  padding-top: 10px;
}

.breakdown-summary-row td {
  vertical-align: middle;
}

.breakdown-summary-row.inactive-breakdown-tour-row td:nth-child(1),
.breakdown-summary-row.inactive-breakdown-tour-row td:nth-child(2),
.breakdown-summary-row.inactive-breakdown-tour-row td:nth-child(3) {
  color: #b42318;
}

.breakdown-summary-row.copied-tour-row td,
.breakdown-detail-row.copied-tour-row td {
  background: #fde8e8;
  color: #842020;
}

.breakdown-summary-row.copied-tour-row .breakdown-toggle-btn {
  border-color: #d8a5a5;
  background: #fff5f5;
  color: #842020;
}

.breakdown-detail-row.copied-tour-row .breakdown-detail-spacer {
  background: #fde8e8;
  border-right-color: #d8a5a5;
}

.price-list-section-row td {
  padding: 10px 12px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: #f7f2e6;
  border-top: 1px solid var(--line);
}

.breakdown-toggle-btn {
  width: 24px;
  min-width: 24px;
  height: 24px;
  margin-right: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.breakdown-collapsed-note {
  color: var(--muted);
  text-align: center;
}

.breakdown-detail-row td {
  background: #fcfaf6;
}

.breakdown-detail-spacer {
  border-right: 1px solid var(--border);
  background: #fff;
}

.breakdown-inline-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fbf8f2;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.breakdown-inline-table th,
.breakdown-inline-table td {
  padding: 6px 7px;
  border-bottom: 1px solid rgba(208, 197, 177, 0.6);
  font-size: 12px;
  vertical-align: top;
}

.breakdown-inline-table th {
  background: rgba(223, 211, 190, 0.45);
  font-weight: 600;
  text-align: left;
}

.breakdown-inline-table td.num,
.breakdown-inline-table th.num {
  text-align: right;
}

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

.breakdown-inline-table th:nth-child(3),
.breakdown-inline-table td:nth-child(3) {
  font-weight: 700;
  color: #163b69;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
}

.master-layout {
  grid-template-columns: minmax(0, 1.46fr) minmax(0, 0.84fr);
}

.block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #fff;
}

.block h2,
.block h3 {
  margin: 0 0 10px;
}

.block h3 {
  margin-top: 14px;
  font-size: 14px;
}

.breakdown-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 10px;
}

.breakdown-head h3 {
  margin: 0;
}

.breakdown-head-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.breakdown-mini.stack {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: auto;
}

.breakdown-mini span {
  white-space: nowrap;
}

.breakdown-mini input {
  width: 72px;
  min-width: 72px;
  padding: 6px 8px;
}

.breakdown-mini input[readonly] {
  background: #f4efe6;
  color: #5d6671;
  border-style: dashed;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.block-head-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.block-head-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.tour-year-stack {
  min-width: 180px;
}

.tour-year-stack select {
  min-width: 180px;
}

.calc-doc-meta,
.tour-inline-meta {
  margin-bottom: 10px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.tour-inline-meta {
  margin-top: 4px;
  margin-bottom: 0;
}

.tour-inline-meta span {
  display: block;
}

.field-grid {
  display: grid;
  gap: 10px;
}

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

.field-grid.field-grid-tour-options {
  grid-template-columns: 180px 132px 110px 110px 110px;
  column-gap: 8px;
  align-items: end;
}

.field-grid-6 {
  grid-template-columns:
    minmax(48px, 64px) 24px
    minmax(48px, 84px) 24px
    minmax(48px, 84px) 12px
    minmax(48px, 84px) 16px
    minmax(48px, 84px) 24px
    minmax(48px, 84px) 12px
    minmax(48px, 84px);
  justify-content: stretch;
}

.field-grid-6 .stack input,
.field-grid-6 .stack select {
  min-width: 0;
  width: 100%;
}

.field-grid-6 > :nth-child(1) {
  grid-column: 1;
}

.field-grid-6 > :nth-child(2) {
  grid-column: 3;
}

.field-grid-6 > :nth-child(3) {
  grid-column: 5;
}

.field-grid-6 > :nth-child(4) {
  grid-column: 7;
}

.field-grid-6 > :nth-child(5) {
  grid-column: 9;
}

.field-grid-6 > :nth-child(6) {
  grid-column: 11;
}

.field-grid-6 > :nth-child(7) {
  grid-column: 13;
}

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

.checkbox-field {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.checkbox-field input[type="checkbox"] {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.checkbox-field[data-active="true"] {
  background: #e6f4ea;
  border-color: #7bbf90;
  color: #1f6a38;
}

.checkbox-field[data-active="false"] {
  background: #f7f3ee;
  border-color: var(--border);
  color: var(--muted);
}

.toggle-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
}

.toggle-stack {
  justify-self: stretch;
  min-width: 0;
  overflow: hidden;
}

.toggle-stack .checkbox-field {
  width: 100%;
}

.field-grid.field-grid-tour-options > * {
  min-width: 0;
}

#withoutBusValueWrap {
  min-width: 132px;
  white-space: nowrap;
}

.field-grid.field-grid-tour-options .stack input,
.field-grid.field-grid-tour-options .stack select,
.field-grid.field-grid-tour-options .checkbox-field {
  width: 100%;
  box-sizing: border-box;
}

.inline-fields {
  margin-top: 10px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.info-strip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #fbf6ef, #f3ece0);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  font-size: 13px;
}

.picker-list {
  margin-top: 10px;
  max-height: none;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

#tourTab h3 + .tour-group-bar {
  position: sticky;
  background: #fff;
  z-index: 2;
}

#tourTab h3 + .tour-group-bar {
  top: 16px;
  padding-top: 4px;
}

.pick-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #efe7db;
}

.pick-row.inactive-selected-row {
  border-color: rgba(182, 64, 64, 0.35);
  background: rgba(182, 64, 64, 0.08);
}

.pick-row.inactive-selected-row strong,
.pick-row.inactive-selected-row .pick-meta {
  color: #8f2f2f;
}

.pick-meta {
  font-size: 11px;
  color: var(--muted);
}

.toolbar {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-inline {
  margin-top: 0;
}

.ferry-head {
  margin-top: 14px;
  margin-bottom: 8px;
}

.save-master-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.save-master-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 2.5h8l2.5 2.5v8A1.5 1.5 0 0 1 12 14.5H4A1.5 1.5 0 0 1 2.5 13V4A1.5 1.5 0 0 1 4 2.5Z' stroke='white' stroke-width='1.4'/%3E%3Cpath d='M5 2.5h5V6H5V2.5Z' stroke='white' stroke-width='1.4'/%3E%3Cpath d='M5 11h6' stroke='white' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.calc-toolbar {
  margin-left: auto;
}

.inline-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.list-filters {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.cruise-filter-stack {
  position: relative;
}

.filter-dropdown-btn {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  min-height: 42px;
}

.filter-dropdown-btn::after {
  content: "▾";
  color: var(--muted);
  margin-left: 8px;
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.filter-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.filter-dropdown-option input {
  margin: 0;
}

.top-pad {
  margin-top: 10px;
}

.kpi-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kpi-row {
  display: grid;
  gap: 10px;
}

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

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

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

.kpi-row[data-kpi-row="3"] {
  grid-template-columns: 0.95fr 0.9fr 0.8fr 0.8fr 0.9fr 1fr;
}

.kpi-section {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fdfbf8;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
}

.kpi-value {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 400;
  color: #243240;
}

.kpi-value-highlight {
  font-weight: 700;
  color: #163b69;
}

.profit-tooltip-anchor {
  position: relative;
  display: inline-block;
  cursor: help;
}

.profit-tooltip-anchor[data-profit-tooltip]::after {
  content: attr(data-profit-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: #223344;
  color: #fff;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 20;
  box-shadow: 0 8px 20px rgba(26, 38, 51, 0.18);
}

.profit-tooltip-anchor[data-profit-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 720px;
}

#tourListTable {
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px;
  vertical-align: top;
}

.data-table thead th {
  background: var(--bg-deep);
  font-weight: 700;
}

.sortable-head {
  cursor: pointer;
  user-select: none;
}

.sortable-head::after {
  content: attr(data-dir);
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
}

.sortable-head:hover {
  color: #1d2b3a;
}

.sort-head-btn {
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
}

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

.copied-tour-row td {
  color: #842020;
  font-weight: 700;
}

.inactive-tour-row td {
  color: #b42318;
}

.tour-list-return-highlight td {
  background: #fff4bf !important;
  transition: background 0.35s ease;
}

.print-action-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.print-hover-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(25, 47, 61, 0.14);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(22, 39, 51, 0.16);
  z-index: 40;
}

.print-action-wrap:hover .print-hover-menu,
.print-action-wrap:focus-within .print-hover-menu {
  display: flex;
}

.print-hover-option {
  border: 1px solid rgba(25, 47, 61, 0.12);
  border-radius: 10px;
  background: #f7fbfc;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.print-hover-option:hover,
.print-hover-option:focus-visible {
  background: #e7f0f4;
  outline: none;
}

.print-inactive-tag {
  font-weight: 700;
  color: #b42318;
}

.print-list-view {
  display: none;
}

.print-master-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.print-master-section {
  margin-top: 16px;
}

.print-master-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.print-master-meta {
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--muted);
}

#tourListTable .print-exclude-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

#tourListTable .print-exclude-btn.on {
  background: rgba(182, 64, 64, 0.1);
  color: #9d3535;
  border-color: rgba(182, 64, 64, 0.3);
}

#tourListTable .print-exclude-btn.off {
  background: #fff;
  color: transparent;
}

#tourListTable .tour-lock-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

#tourListTable .tour-lock-btn.on {
  background: rgba(31, 123, 109, 0.13);
  color: #1f7b6d;
  border-color: rgba(31, 123, 109, 0.3);
}

#tourListTable .tour-lock-btn.off {
  background: #fff;
  color: transparent;
}

.print-list-view {
  display: none;
}

.breakdown-total-row td {
  background: rgba(223, 211, 190, 0.28);
  border-top: 2px solid var(--line);
  font-weight: 400;
}

#adultBreakdownTable th:nth-child(3),
#adultBreakdownTable td:nth-child(3),
#childBreakdownTable th:nth-child(3),
#childBreakdownTable td:nth-child(3) {
  font-weight: 700;
  color: #163b69;
}

.data-table input,
.data-table select {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
}

#masterTab .data-table {
  table-layout: fixed;
}

#masterTab .data-table input[readonly],
#masterTab .data-table select[disabled] {
  background: #f4efe6;
  color: #5d6671;
  border-style: dashed;
}

#catalogTable .name-cell {
  vertical-align: middle;
}

#catalogTable .name-cell-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}

#catalogTable .name-cell-inner .locked-name {
  flex: 1;
  min-width: 0;
}

#catalogTable .state-toggle {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  min-width: 62px;
}

#catalogTable .state-toggle.on {
  background: rgba(31, 123, 109, 0.13);
  color: #1f7b6d;
  border-color: rgba(31, 123, 109, 0.3);
}

#catalogTable .state-toggle.off {
  background: rgba(182, 64, 64, 0.1);
  color: #9d3535;
  border-color: rgba(182, 64, 64, 0.3);
}

#catalogTable .status-check-btn,
#harborTable .status-check-btn,
#ferryTable .status-check-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #fff;
}

#catalogTable .status-check-btn.on,
#harborTable .status-check-btn.on,
#ferryTable .status-check-btn.on {
  background: rgba(31, 123, 109, 0.13);
  color: #1f7b6d;
  border-color: rgba(31, 123, 109, 0.3);
  min-width: 36px;
}

#catalogTable .status-check-btn.off,
#harborTable .status-check-btn.off,
#ferryTable .status-check-btn.off {
  background: rgba(182, 64, 64, 0.1);
  color: #9d3535;
  border-color: rgba(182, 64, 64, 0.3);
}

#catalogTable .status-check-btn svg,
#harborTable .status-check-btn svg,
#ferryTable .status-check-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#catalogTable tr.inactive-row input[readonly],
#harborTable tr.inactive-row input[readonly],
#ferryTable tr.inactive-row input[readonly] {
  opacity: 0.75;
}

.category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.catalog-group-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 6px 0 12px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.catalog-group-bar .category-tabs {
  flex: 1;
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.tour-group-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 6px 0 12px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.tour-group-bar .category-tabs {
  flex: 1;
  margin: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.tour-group-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

.tour-override-stack {
  min-width: 88px;
  margin-bottom: 2px;
  align-items: flex-end;
}

.tour-override-stack > span:first-child {
  text-align: right;
}

.master-uplift-stack {
  min-width: 96px;
  margin-bottom: 2px;
}

.master-uplift-stack input {
  width: 100%;
  min-width: 0;
}

.category-tab {
  border: 1px solid var(--border);
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
  background: #f7f2eb;
  color: var(--muted);
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.category-tab.active {
  background: #fff;
  color: var(--ink);
  border-color: var(--border);
  box-shadow: 0 -2px 0 var(--accent) inset;
}

.category-tab span {
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted);
}

#masterTab .actions-cell {
  white-space: nowrap;
  text-align: right;
}

#masterTab .row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
  min-width: 132px;
}

#masterTab .row-actions .icon-btn {
  width: 40px;
  min-width: 40px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#catalogTable col.col-name {
  width: 35%;
}

#catalogTable col.col-vat {
  width: 6%;
}

#catalogTable col.col-mode {
  width: 8%;
}

#catalogTable col.col-increase {
  width: 7%;
}

#catalogTable col.col-price {
  width: 7%;
}

#catalogTable col.col-price-last {
  width: 8%;
}

#catalogTable col.col-actions {
  width: 15%;
}

#harborTable col.col-harbor-name {
  width: 28%;
}

#harborTable col.col-harbor-km {
  width: 15%;
}

#harborTable col.col-harbor-hours {
  width: 17%;
}

#harborTable col.col-harbor-actions {
  width: 40%;
}

.header-inline-field {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.header-inline-field span {
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.header-inline-field input {
  width: 78px;
  min-width: 78px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  background: #fff;
}

#harborTable .harbor-rate-head {
  vertical-align: top;
}

#ferryTable col.col-ferry-route {
  width: 30%;
}

#ferryTable col.col-ferry-cost {
  width: 10%;
}

#ferryTable col.col-ferry-vat {
  width: 10%;
}

#ferryTable col.col-ferry-needed {
  width: 30%;
}

#ferryTable col.col-ferry-actions {
  width: 20%;
}

#harborTable,
#ferryTable {
  min-width: 0;
  width: 100%;
}

#harborTable .row-actions,
#ferryTable .row-actions {
  min-width: 124px;
}

#ferryTable .actions-cell {
  text-align: right;
}

#ferryTable .row-actions {
  justify-content: flex-end;
  min-width: 84px;
  gap: 4px;
}

#ferryTable .row-actions .icon-btn {
  width: 34px;
  min-width: 34px;
}

#harborTable .actions-cell {
  text-align: right;
}

#harborTable .row-actions {
  justify-content: flex-end;
}

.data-table input.locked-name {
  background: #f4efe6;
  color: #5d6671;
  cursor: not-allowed;
  border-style: dashed;
}

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

#tourListTable td.num,
#tourListTable th.num {
  text-align: center !important;
}

#tourListTable th:nth-child(7),
#tourListTable td:nth-child(7) {
  text-align: center !important;
}

#tourListTable th:nth-child(3),
#tourListTable td:nth-child(3) {
  white-space: normal;
}

#tourListTable td.tour-code-cell,
#printTourListTable td.tour-code-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dash-break-wrap {
  white-space: normal;
  line-height: 1.15;
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.primary-btn,
.ghost-btn,
.danger-btn {
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.2s ease, background 0.2s ease;
}

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

.primary-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

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

.ghost-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn.inactive-hidden {
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.28);
  color: #9d3535;
}

.add-plus-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
}

.danger-btn {
  background: rgba(182, 64, 64, 0.08);
  border-color: rgba(182, 64, 64, 0.35);
  color: var(--danger);
}

.calc-action-btn {
  width: 44px;
  height: 50px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.icon-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.edit-icon-btn::before,
.delete-icon-btn::before,
.duplicate-icon-btn::before,
.transfer-icon-btn::before,
.move-left-icon-btn::before,
.move-right-icon-btn::before {
  content: "";
  width: 16px;
  height: 16px;
  display: block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.move-left-icon-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m8.5 3.25-4.25 4.75 4.25 4.75' stroke='%23223344' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 8h6.75' stroke='%23223344' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.move-right-icon-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m7.5 3.25 4.25 4.75-4.25 4.75' stroke='%23223344' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M11 8H4.25' stroke='%23223344' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.transfer-icon-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M2.75 4.5h6.5c.41 0 .75.34.75.75v1.5' stroke='%23223344' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m8.5 8.75 1.75-1.75L8.5 5.25' stroke='%23223344' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M13.25 11.5h-6.5a.75.75 0 0 1-.75-.75v-1.5' stroke='%23223344' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m7.5 7.25-1.75 1.75 1.75 1.75' stroke='%23223344' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.duplicate-icon-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Crect x='5.25' y='3.25' width='7.5' height='7.5' rx='1.2' stroke='%23223344' stroke-width='1.4'/%3E%3Cpath d='M3.25 12V5.5c0-.69.56-1.25 1.25-1.25H11' stroke='%23223344' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.edit-icon-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 11.75 11.9 2.85a1.06 1.06 0 0 1 1.5 0l.75.75a1.06 1.06 0 0 1 0 1.5L5.25 14H3v-2.25Z' stroke='%23223344' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='m10.85 3.9 1.25 1.25' stroke='%23223344' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.delete-icon-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 4.5h9' stroke='%23b64040' stroke-width='1.4' stroke-linecap='round'/%3E%3Cpath d='M6 2.75h4' stroke='%23b64040' stroke-width='1.4' stroke-linecap='round'/%3E%3Cpath d='M5 4.5v7.25c0 .41.34.75.75.75h4.5c.41 0 .75-.34.75-.75V4.5' stroke='%23b64040' stroke-width='1.4' stroke-linejoin='round'/%3E%3Cpath d='M6.75 6.5v4' stroke='%23b64040' stroke-width='1.4' stroke-linecap='round'/%3E%3Cpath d='M9.25 6.5v4' stroke='%23b64040' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 24px;
  background: rgba(26, 38, 51, 0.48);
  display: grid;
  place-items: center;
}

.modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
}

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

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

.modal-subtitle {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-card-compact {
  width: min(420px, 100%);
}

.save-confirm-card {
  text-align: center;
  padding: 24px 22px 20px;
}

.save-confirm-head {
  justify-content: center;
  margin-bottom: 10px;
}

.save-confirm-text {
  font-size: 14px;
  color: var(--muted);
}

.save-confirm-actions {
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.save-confirm-btn {
  min-width: 64px;
  min-height: 44px;
  padding: 0 18px;
  font-size: 24px;
  line-height: 1;
}

.hidden {
  display: none;
}

@keyframes toast-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media (max-width: 1200px) {
  .layout-two {
    grid-template-columns: 1fr;
  }

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

  .field-grid.field-grid-tour-options {
    grid-template-columns: 170px 124px 100px 100px 100px;
  }

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

  .block-head-actions {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 18px 4vw 30px;
  }

  .panel {
    padding: 16px;
  }

  .field-grid,
  .list-filters,
  .info-strip,
  .modal-grid,
  .modal-grid.two {
    grid-template-columns: 1fr;
  }

  .kpi-row,
  .kpi-row-4,
  .kpi-row-5,
  .kpi-row-6 {
    grid-template-columns: 1fr;
  }

  .field-grid-6 > * {
    grid-column: auto;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .block-head-actions {
    width: 100%;
    align-items: stretch;
  }
}

@page {
  size: A4 landscape;
  margin: 5mm;
}

@media print {
  html,
  body {
    width: 100%;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    margin: 0 !important;
    background: #fff;
  }

  .bg-sheen,
  .bg-grid,
  .topbar,
  .tabbar,
  #tourTab,
  #listInactiveToggleBtn,
  #breakdownInactiveToggleBtn,
  .print-action-wrap,
  #printPriceListBtn,
  #printPriceListMenu,
  #printMasterDataBtn,
  .list-filters {
    display: none !important;
  }

  .shell,
  .panel,
  .block {
    width: 100% !important;
    max-width: none !important;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border: none;
    background: #fff;
  }

  #appView > .tab-panel,
  #printListView,
  #masterTab,
  #printMasterDataView {
    display: none !important;
  }

  body.print-list-mode #listTab,
  body.print-master-mode #masterTab {
    display: block !important;
  }

  body.print-list-mode #listTab {
    position: static;
  }

  body.print-master-mode #masterTab {
    position: static;
  }

  body.print-list-mode #listTab .table-wrap {
    display: none !important;
    width: 100% !important;
    overflow: visible;
    border: none;
  }

  body.print-list-mode #printListView {
    display: block !important;
    width: 100% !important;
  }

  body.print-list-mode #masterTab,
  body.print-list-mode #printMasterDataView,
  body.print-list-mode #breakdownTab,
  body.print-list-mode #tourTab,
  body.print-master-mode #listTab,
  body.print-master-mode #printListView,
  body.print-master-mode #priceListTitle,
  body.print-master-mode .list-filters,
  body.print-master-mode #printPriceListBtn,
  body.print-master-mode #breakdownTab,
  body.print-master-mode #tourTab {
    display: none !important;
  }

  body.print-master-mode #masterTab .layout-two {
    display: block !important;
  }

  body.print-master-mode #masterTab .layout-two > .block {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.print-master-mode #masterTab .layout-two > .block:first-child .block-head,
  body.print-master-mode #masterTab .layout-two > .block:first-child .catalog-group-bar,
  body.print-master-mode #masterTab .layout-two > .block:first-child .table-wrap,
  body.print-master-mode #masterTab .layout-two > .block:last-child .block-head,
  body.print-master-mode #masterTab .layout-two > .block:last-child .ferry-head,
  body.print-master-mode #masterTab .layout-two > .block:last-child .table-wrap {
    display: none !important;
  }

  body.print-master-mode #printMasterDataView {
    display: block !important;
    width: 100% !important;
  }

  #printTourListTable {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    font-size: 8.5px;
  }

  #printTourListTable,
  #printTourListTable * {
    color: #000 !important;
  }

  #printTourListTable thead th {
    background: #a9c7d4 !important;
    color: #173041 !important;
    border-bottom: 1px solid #8fb2c1;
  }

  #printTourListTable th,
  #printTourListTable td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
    padding: 6px 4px;
  }

  #printTourListTable tbody tr.price-list-section-row td {
    background: #d6e5db !important;
    color: #234251 !important;
    font-weight: 700;
    border-top: 1px solid #b9d0c3;
    border-bottom: 1px solid #b9d0c3;
  }

  #printTourListTable tbody tr:not(.price-list-section-row):nth-child(even) td {
    background: #f4f8fa !important;
  }

  .print-tour-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow: hidden;
    line-height: 1.1;
  }

  body.print-master-mode .print-master-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 9px;
    margin-bottom: 12px;
  }

  body.print-master-mode .print-master-table,
  body.print-master-mode .print-master-table * {
    color: #000 !important;
  }

  body.print-master-mode .print-master-table thead th {
    background: #a9c7d4 !important;
    color: #173041 !important;
    border-bottom: 1px solid #8fb2c1;
  }

  body.print-master-mode .print-master-table th,
  body.print-master-mode .print-master-table td {
    vertical-align: top;
    padding: 5px 4px;
  }

  body.print-master-mode .print-master-table tbody tr:nth-child(even) td {
    background: #f4f8fa !important;
  }

  body.print-master-mode .print-master-section h3 {
    background: #d6e5db !important;
    color: #234251 !important;
    padding: 6px 8px;
    border-radius: 6px;
  }
}
