:root {
  --bg: #f4f6f3;
  --ink: #1d2a24;
  --muted: #65736d;
  --line: #dbe3de;
  --green: #1f6f55;
  --teal: #0f7d82;
  --danger: #a63f2f;
  --surface: #ffffff;
  --soft: #edf3ef;
  --shadow: 0 18px 42px rgba(31, 48, 41, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

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

.login-shell {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(23, 56, 47, 0.72), rgba(23, 56, 47, 0.28)),
    url("../../Mia Travel/Coach/图片_20250615130246.jpg") center / cover;
}

.sidebar {
  min-height: 100vh;
  padding: 18px 10px;
  color: #fff;
  background: #17382f;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: #17382f;
  font-size: 24px;
  font-weight: 800;
}

.brand span,
.side-note {
  color: rgba(255, 255, 255, 0.66);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand span {
  font-size: 13px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar a {
  border-radius: 8px;
  padding: 12px 8px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.sidebar a:hover {
  color: #17382f;
  background: #fff;
}

.side-note {
  margin-top: 32px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.main {
  width: 100%;
  padding: 28px;
}

.topbar,
.panel-header,
.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 20px;
}

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

.inline-form {
  display: inline-flex;
  gap: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.task-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-left: 10px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e1f2ea;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  vertical-align: middle;
}

.login-card,
.panel,
.metric-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.login-card p {
  color: var(--muted);
}

form,
.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

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

textarea {
  resize: vertical;
  line-height: 1.5;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 800;
}

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

.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--danger);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.link-button {
  white-space: nowrap;
}

.month-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.month-link {
  min-width: 58px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.month-link:hover,
.month-link.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.panel {
  padding: 18px;
}

.recent-panel {
  margin-top: 18px;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header.compact {
  align-items: flex-start;
}

.filters {
  justify-content: flex-end;
}

.filters input {
  width: min(360px, 42vw);
}

.inline-message {
  max-width: 360px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

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

.excel-wrap {
  overflow: auto;
  max-height: calc(100vh - 310px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

td:nth-child(6) {
  min-width: 280px;
  white-space: pre-wrap;
}

.excel-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
}

.excel-table th,
.excel-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
}

.excel-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #d9ead3;
  color: #17382f;
  font-weight: 800;
  text-align: center;
}

.excel-table .date-cell,
.excel-table .week-cell {
  position: sticky;
  z-index: 2;
  background: #f8fbf8;
  text-align: center;
  white-space: nowrap;
}

.excel-table thead .date-cell,
.excel-table thead .week-cell {
  z-index: 4;
  background: #b6d7a8;
}

.excel-table .date-cell {
  left: 0;
  width: 104px;
  min-width: 104px;
}

.excel-table .week-cell {
  left: 104px;
  width: 58px;
  min-width: 58px;
}

.excel-table .job-cell {
  height: 72px;
  white-space: pre-wrap;
  line-height: 1.42;
  vertical-align: top;
  background: #fff;
  cursor: pointer;
}

.excel-table th:not(.date-cell):not(.week-cell),
.excel-table .job-cell {
  width: calc((100% - 162px) / 7);
}

.excel-table tr:hover .job-cell,
.excel-table tr:hover .date-cell,
.excel-table tr:hover .week-cell {
  background: #f0f7f3;
}

.excel-table .reserved-cell,
.excel-table tr:hover .reserved-cell {
  background: #d93025;
  color: transparent;
}

.excel-table .last-edited-cell {
  position: relative;
  outline: 3px solid #f4b400;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 999px rgba(244, 180, 0, 0.1);
}

.client-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
}

.legend-box {
  width: 28px;
  height: 18px;
  border-radius: 4px;
  background: #d93025;
}

.excel-table tr.hidden-row,
.status-table tr.hidden-row {
  display: none;
}

.excel-table .muted-cell {
  color: transparent;
  font-size: 0;
  line-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  background: #fff;
  cursor: default;
}

.excel-table .muted-cell * {
  visibility: hidden;
}

.status-wrap {
  max-height: calc(100vh - 250px);
}

.status-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: fixed;
}

.status-table th,
.status-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  white-space: nowrap;
  vertical-align: top;
}

.status-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #d9ead3;
  color: #17382f;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.status-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #eef6f1;
  color: #17382f;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

.status-table .status-total-label {
  text-align: right;
}

#statusAmountTotal {
  color: var(--green);
}

#statusAmountCount {
  color: var(--muted);
  font-weight: 700;
}

.sort-header {
  width: 100%;
  min-height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sort-header::after {
  content: " ⇅";
  color: var(--green);
}

.sort-header.sorted-asc::after {
  content: " ↑";
}

.sort-header.sorted-desc::after {
  content: " ↓";
}

.status-table tbody tr:hover td {
  background: #f0f7f3;
  cursor: pointer;
}

.status-table tbody tr.overdue-unpaid td,
.status-table tbody tr.overdue-unpaid a {
  color: #c62828;
  font-weight: 800;
}

.status-table tbody tr.overdue-unpaid td {
  background: #fff6f6;
}

.status-table tbody tr.overdue-unpaid:hover td {
  background: #ffe9e9;
}

.status-table .select-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.status-table .select-col input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.status-table .paid-merge-disabled {
  background: #eeeeee;
}

.status-table td:nth-child(1),
.status-table th:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f8fbf8;
}

.status-table td:nth-child(2),
.status-table th:nth-child(2) {
  position: sticky;
  left: 42px;
  z-index: 2;
  min-width: 128px;
  width: 128px;
  background: #f8fbf8;
}

.status-table thead th:nth-child(1) {
  z-index: 4;
  background: #b6d7a8;
}

.status-table th:nth-child(3),
.status-table td:nth-child(3),
.status-table th:nth-child(4),
.status-table td:nth-child(4) {
  width: 92px;
}

.status-table thead th:nth-child(2) {
  z-index: 4;
  background: #b6d7a8;
}

.status-table th:nth-child(5),
.status-table td:nth-child(5) {
  width: 130px;
}

.status-table th:nth-child(6),
.status-table td:nth-child(6) {
  width: 58px;
  text-align: center;
}

.status-table th:nth-child(7),
.status-table td:nth-child(7),
.status-table th:nth-child(8),
.status-table td:nth-child(8),
.status-table th:nth-child(11),
.status-table td:nth-child(11) {
  width: 86px;
}

.status-table th:nth-child(9),
.status-table td:nth-child(9) {
  width: 170px;
}

.status-table th:nth-child(12),
.status-table td:nth-child(12),
.status-table th:nth-child(13),
.status-table td:nth-child(13),
.status-table th:nth-child(14),
.status-table td:nth-child(14) {
  width: 92px;
}

.status-table th:nth-child(10),
.status-table td:nth-child(10) {
  width: 126px;
}

.status-table th:nth-child(15),
.status-table td:nth-child(15) {
  width: 150px;
}

.status-table td:nth-child(9),
.status-table td:nth-child(15) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.project-link {
  display: inline-block;
  border-radius: 5px;
  padding: 1px 4px;
  background: #e1f2ea;
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.project-link:hover {
  background: var(--green);
  color: #fff;
}

.project-link-pending {
  background: #ffe58f;
  color: #5f4300;
}

.project-link-pending:hover {
  background: #d99a00;
  color: #fff;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
  gap: 16px;
}

.report-panel {
  max-width: 980px;
}

.report-form {
  display: grid;
  grid-template-columns: 150px 150px minmax(260px, 1fr) 120px;
  gap: 14px;
  align-items: end;
}

.form-help {
  margin: 14px 0 0;
  color: var(--muted);
}

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

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 18px;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.batch-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 360px);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.batch-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.batch-table th,
.batch-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
}

.batch-table th {
  background: #d9ead3;
  color: #17382f;
  text-align: center;
}

.batch-table input,
.batch-table textarea {
  border: 0;
  padding: 6px;
  background: transparent;
}

.batch-table td:nth-child(1) {
  width: 150px;
}

.batch-table td:nth-child(2) {
  width: 160px;
}

.batch-table td:nth-child(3) {
  width: 160px;
}

.batch-table tr.needs-attention td {
  background: #fff6e6;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vehicle-wrap {
  max-height: calc(100vh - 230px);
}

.vehicle-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
}

.vehicle-table th,
.vehicle-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: center;
  vertical-align: middle;
}

.vehicle-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #d9ead3;
  color: #17382f;
  font-weight: 800;
}

.vehicle-table tbody tr:hover td {
  background: #f0f7f3;
  cursor: pointer;
}

.vehicle-table th:nth-child(1),
.vehicle-table td:nth-child(1) {
  width: 130px;
  font-weight: 800;
}

.vehicle-table th:nth-child(6),
.vehicle-table td:nth-child(6) {
  width: 190px;
}

.vehicle-table td.urgent-expiry,
.vehicle-table td.urgent-expiry small {
  color: #c62828;
  font-weight: 900;
}

.mobile-vehicle-card .urgent-expiry dt,
.mobile-vehicle-card .urgent-expiry dd {
  color: #c62828;
  font-weight: 900;
}

.vehicle-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.quote-form {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
}

.quote-form .quote-notes {
  grid-column: span 2;
}

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

.quote-builder {
  gap: 16px;
}

.quote-input-grid {
  display: grid;
  grid-template-columns: 220px 170px 190px 130px 110px 130px;
  gap: 12px;
  align-items: end;
}

.quote-input-grid .quote-description,
.quote-input-grid .quote-note {
  grid-column: 1 / span 5;
}

.quote-add-btn {
  align-self: end;
}

.quote-list-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.daily-quote-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.daily-quote-table th,
.daily-quote-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 5px 7px;
  line-height: 1.25;
  vertical-align: middle;
}

.daily-quote-table th {
  background: #d9ead3;
  color: #17382f;
  text-align: center;
}

.daily-quote-table th:nth-child(1),
.daily-quote-table td:nth-child(1) {
  width: 8%;
}

.daily-quote-table th:nth-child(2),
.daily-quote-table td:nth-child(2) {
  width: 9%;
}

.daily-quote-table th:nth-child(3),
.daily-quote-table td:nth-child(3) {
  width: 7%;
  text-align: center;
}

.daily-quote-table th:nth-child(4),
.daily-quote-table td:nth-child(4) {
  width: 28%;
}

.daily-quote-table th:nth-child(5),
.daily-quote-table td:nth-child(5) {
  width: 15%;
}

.daily-quote-table th:nth-child(6),
.daily-quote-table td:nth-child(6) {
  width: 7%;
}

.daily-quote-table th:nth-child(7),
.daily-quote-table td:nth-child(7) {
  width: 7%;
}

.daily-quote-table th:nth-child(8),
.daily-quote-table td:nth-child(8) {
  width: 8%;
}

.daily-quote-table th:nth-child(9),
.daily-quote-table td:nth-child(9) {
  width: 8%;
}

.daily-quote-table th:nth-child(10),
.daily-quote-table td:nth-child(10) {
  width: 8%;
}

.daily-quote-table th:nth-child(11),
.daily-quote-table td:nth-child(11) {
  width: 5%;
  text-align: right;
  font-weight: 800;
}

.daily-quote-table th:nth-child(12),
.daily-quote-table td:nth-child(12) {
  width: 6%;
  text-align: center;
}

.daily-quote-table .quote-desc-cell,
.daily-quote-table .quote-note-cell {
  white-space: pre-line;
  overflow-wrap: anywhere;
  text-align: left;
}

.daily-quote-table tbody tr.quote-line {
  height: auto;
}

.daily-quote-table tbody tr.quote-line td {
  height: auto;
}

.daily-quote-table .empty-row td {
  color: var(--muted);
  text-align: center;
}

.quote-line-price {
  width: 82px;
  height: 30px;
  min-height: 30px;
  padding: 4px 7px;
  text-align: right;
}

.quote-delete-line {
  min-height: 30px;
  height: 30px;
  border-radius: 7px;
  padding: 0 12px;
}

.quote-final-actions {
  justify-content: flex-end;
}

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

.quote-price-wrap {
  max-height: calc(100vh - 230px);
}

.quote-price-table {
  min-width: 1420px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.quote-price-table th,
.quote-price-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 9px;
  text-align: center;
  vertical-align: middle;
}

.quote-price-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #d9ead3;
  color: #17382f;
  font-weight: 800;
}

.quote-price-table thead tr:nth-child(2) th {
  top: 35px;
  z-index: 3;
  background: #e7f2e2;
}

.quote-price-table th:nth-child(1),
.quote-price-table td:nth-child(1) {
  width: 150px;
}

.quote-price-table th:nth-child(2),
.quote-price-table td:nth-child(2) {
  width: 90px;
}

.quote-price-table th:nth-child(3),
.quote-price-table td:nth-child(3) {
  width: 220px;
  text-align: left;
}

.quote-price-table tbody tr:hover td {
  background: #f0f6f2;
  cursor: pointer;
}

.quote-price-table tbody tr.quote-group-start td {
  border-top: 3px solid #9ccfe8;
}

.quote-price-table .current-season,
.quote-price-table td.current-season {
  background: #fff3c4;
}

#quotePriceDialog {
  width: min(840px, calc(100vw - 28px));
}

#quotePriceDialog .dialog-card {
  gap: 12px;
  padding: 18px;
}

.quote-edit-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 800;
}

.quote-season-editor {
  display: grid;
  grid-template-columns: 90px repeat(4, minmax(96px, 1fr));
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.quote-season-editor h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #17382f;
}

.quote-season-editor input {
  min-height: 36px;
  padding: 7px 9px;
}

.quote-season-editor.disabled-editor {
  opacity: 0.45;
}

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

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.project-detail-wrap {
  max-height: calc(100vh - 230px);
  overflow: auto;
}

.project-detail-table {
  min-width: 980px;
  table-layout: fixed;
  font-size: 13px;
}

.project-detail-table th,
.project-detail-table td {
  padding: 8px 10px;
  line-height: 1.35;
}

.project-detail-table th {
  font-size: 12px;
}

.project-detail-table th:nth-child(1),
.project-detail-table td:nth-child(1) {
  width: 76px;
}

.project-detail-table th:nth-child(2),
.project-detail-table td:nth-child(2) {
  width: 62px;
}

.project-detail-table th:nth-child(3),
.project-detail-table td:nth-child(3),
.project-detail-table th:nth-child(4),
.project-detail-table td:nth-child(4) {
  width: 58px;
}

.project-detail-table th:nth-child(5),
.project-detail-table td:nth-child(5) {
  width: 90px;
}

.project-detail-table td:nth-child(6) {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.alert {
  margin-bottom: 16px;
  border-left: 4px solid var(--danger);
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffeae5;
  color: var(--danger);
  font-weight: 700;
}

.alert.success {
  border-left-color: var(--green);
  background: #e4f5ec;
  color: var(--green);
}

.import-result {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid #a8d3bd;
  border-left: 6px solid var(--green);
  border-radius: 8px;
  padding: 16px 18px;
  background: #eef8f2;
  box-shadow: var(--shadow);
}

.duplicate-warning {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid #efc4b8;
  border-left: 6px solid var(--danger);
  border-radius: 8px;
  padding: 16px 18px;
  background: #fff3ef;
  box-shadow: var(--shadow);
}

.duplicate-warning h2,
.duplicate-warning p {
  margin: 0;
}

.duplicate-table-wrap {
  overflow-x: auto;
  border: 1px solid #f1cfc6;
  border-radius: 8px;
  background: #fff;
}

.duplicate-table-wrap table {
  min-width: 640px;
}

.duplicate-table-wrap th {
  background: #f8d9d1;
  color: #563126;
  text-align: center;
}

.import-result h2,
.import-result p {
  margin: 0;
}

.result-metrics {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 12px;
  align-items: stretch;
}

.result-metrics > div {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  border: 1px solid #c9dfd2;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.result-metrics strong {
  color: var(--green);
  font-size: 28px;
  line-height: 1;
}

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

.project-badge {
  border-radius: 6px;
  padding: 4px 8px;
  background: #dcefe5;
  color: var(--green);
  font-weight: 800;
}

@media (max-width: 760px) {
  .result-metrics {
    grid-template-columns: 1fr;
  }
}

dialog {
  width: min(680px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 28, 23, 0.42);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dialog-actions span {
  margin-right: auto;
  color: var(--muted);
  font-weight: 700;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}

#cellDialog {
  width: min(640px, calc(100vw - 24px));
}

#cellDialog .dialog-card {
  gap: 9px;
  padding: 14px 16px;
  font-size: 14px;
}

#cellDialog .panel-header {
  margin-bottom: 4px;
}

#cellDialog h2 {
  font-size: 20px;
  line-height: 1.15;
}

#cellDialog .eyebrow {
  font-size: 11px;
}

#cellDialog label {
  font-size: 13px;
}

#cellDialog input,
#cellDialog select,
#cellDialog textarea {
  min-height: 34px;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 14px;
}

#cellDialog textarea {
  min-height: 150px;
  line-height: 1.35;
}

#cellDialog .form-row {
  gap: 10px;
}

#cellDialog .dialog-actions {
  gap: 8px;
}

#cellDialog .primary,
#cellDialog .secondary,
#cellDialog .danger {
  min-height: 34px;
  border-radius: 7px;
  padding: 0 12px;
  font-size: 14px;
}

#cellDialog .icon-btn {
  width: 32px;
  height: 32px;
  font-size: 20px;
}

.mobile-card-list {
  display: none;
}

.mobile-booking-grid-wrap {
  display: none;
}

.mobile-card.hidden-row,
.mobile-booking-grid tr.hidden-row {
  display: none;
}

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

.mobile-card + .mobile-card {
  margin-top: 10px;
}

.mobile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mobile-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e6f4ee;
  color: var(--green);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.mobile-fields div {
  min-width: 0;
}

.mobile-fields dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mobile-fields dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 700;
  word-break: break-word;
}

.mobile-fields .wide {
  grid-column: 1 / -1;
}

.mobile-status-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  font-size: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.mobile-status-fields dt {
  font-size: 12px;
  line-height: 1.2;
}

.mobile-status-fields dd {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
}

.mobile-card-text {
  margin: 10px 0;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-line;
  word-break: break-word;
}

.mobile-card .secondary {
  min-height: 34px;
  padding: 0 12px;
}

.mobile-status-card.overdue-unpaid {
  border-color: #d93025;
  color: #d93025;
}

.mobile-status-card {
  max-width: 100%;
  overflow-x: hidden;
}

.mobile-status-card .mobile-card-head,
.mobile-status-card .mobile-fields,
.mobile-status-card .mobile-fields div,
.mobile-status-card .mobile-fields dd {
  max-width: 100%;
  min-width: 0;
}

.mobile-status-card .project-link,
.mobile-status-card .mobile-pill {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
}

.mobile-status-card.overdue-unpaid dd,
.mobile-status-card.overdue-unpaid .mobile-card-text {
  color: #d93025;
}

.mobile-price-seasons {
  display: grid;
  gap: 8px;
}

.mobile-price-season {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  border-radius: 8px;
  background: var(--soft);
  padding: 8px;
  font-size: 13px;
}

.mobile-price-season strong {
  grid-column: 1 / -1;
}

.mobile-price-season.current-season {
  background: #fff4c2;
}

.mobile-empty {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 20px 0;
}

.mobile-booking-grid {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
}

.mobile-booking-grid th,
.mobile-booking-grid td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
}

.mobile-booking-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #d9ead3;
  color: #17382f;
  font-weight: 800;
}

.mobile-booking-grid th:first-child,
.mobile-booking-grid .mobile-date-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 48px;
  min-width: 48px;
  background: #f8fbf8;
}

.mobile-booking-grid th:first-child {
  background: #d9ead3;
}

.mobile-date-cell {
  padding-left: 4px;
  padding-right: 4px;
  font-weight: 800;
  color: var(--ink);
}

.mobile-date-cell span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-booking-cell {
  height: 44px;
  min-width: 0;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
}

.mobile-booking-cell.mobile-filled-cell {
  background: #eef6f1;
}

.mobile-booking-cell.mobile-pending-cell {
  background: #fff4c2;
}

.mobile-booking-cell.mobile-reserved-cell {
  background: #d93025;
  color: transparent;
}

.mobile-booking-grid .muted-cell {
  color: transparent;
  background: #fff;
  cursor: default;
}

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

  .sidebar {
    min-height: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .side-note {
    display: none;
  }

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

  .entry-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .filters input {
    width: 100%;
  }

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

  .report-form {
    grid-template-columns: 1fr;
  }

  .quote-form,
  .quote-season-editor,
  .quote-input-grid {
    grid-template-columns: 1fr;
  }

  .quote-form .quote-notes,
  .quote-input-grid .quote-description,
  .quote-input-grid .quote-note {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
    overflow-x: hidden;
  }

  .main {
    padding: 14px 10px 24px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    padding: 10px;
  }

  .brand {
    margin-bottom: 10px;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .sidebar nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    text-align: center;
    white-space: normal;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .month-nav {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .month-link {
    flex: 0 0 auto;
    min-width: 52px;
    min-height: 36px;
  }

  .panel {
    padding: 12px;
    border-radius: 8px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .panel-header {
    gap: 10px;
  }

  .panel-header h2 {
    font-size: 20px;
  }

  .filters {
    gap: 8px;
  }

  .filters input {
    min-height: 38px;
  }

  .mobile-view-panel > .excel-wrap {
    display: none;
  }

  .mobile-card-list,
  .mobile-booking-grid-wrap {
    display: block;
    max-width: 100%;
  }

  .mobile-booking-grid-wrap {
    overflow-x: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .mobile-fields {
    grid-template-columns: 1fr;
  }

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

  .mobile-card-head {
    align-items: center;
  }

  .mobile-card .project-link {
    font-size: 15px;
  }

  .dialog-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow: auto;
    padding: 14px;
  }

  #cellDialog textarea {
    min-height: 120px;
  }
}
