:root {
  --brand: #174b6c;
  --brand-dark: #10364f;
  --surface: #f3f6f8;
  --line: #dbe3e9;
}

body { background: var(--surface); color: #172033; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: var(--brand-dark); color: white; padding: 24px 18px; display: flex; flex-direction: column; min-height: 100vh; }
.brand { font-size: 1.45rem; font-weight: 700; }
.brand-subtitle { color: #d1e1e9; font-size: .88rem; font-weight: 550; letter-spacing: .02em; }
.sidebar .nav-link { color: #dce8ee; border-radius: .5rem; margin-bottom: .35rem; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.1); color: white; }
.nav-section-label { margin: .85rem .75rem .35rem; color: #91acbb; font-size: .68rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.sidebar-nav-group > summary { cursor: pointer; list-style: none; }
.sidebar-nav-group > summary::-webkit-details-marker { display: none; }
.sidebar-nav-group > summary::after { content: "\25be"; float: right; transition: transform .15s ease; }
.sidebar-nav-group:not([open]) > summary::after { transform: rotate(-90deg); }
.sidebar-nav-items { min-width: 0; }
.sidebar-user { color: #e5eef3; }
.sidebar-user small { color: #aec0cc; }
.evidence-viewer-card { overflow: hidden; }
.evidence-stage { min-height: 420px; max-height: 72vh; display: grid; place-items: center; overflow: auto; background: #172033; }
.evidence-stage:fullscreen { width: 100vw; height: 100vh; max-height: none; }
.evidence-image { display: block; max-width: 100%; max-height: 70vh; transform-origin: center; transition: transform .15s ease; }
.evidence-pdf { width: 100%; min-height: 70vh; border: 0; background: #fff; }
.evidence-controls { border-top: 1px solid var(--line); }
.evidence-metadata .detail-grid { grid-template-columns: 1fr; }
.evidence-file-item,
.evidence-file-row,
.evidence-file-row > *,
.evidence-metadata dd { min-width: 0; }
.evidence-filename,
.evidence-type-label,
.evidence-note,
.evidence-metadata dd { overflow-wrap: anywhere; word-break: break-word; }
.main-panel { min-width: 0; }
.topbar { min-height: 64px; background: white; border-bottom: 1px solid var(--line); padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.content-area { padding: 24px; }
.page-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 18px; }
.page-heading h1 { margin: 0; font-size: 1.65rem; }
.page-heading p { margin: .35rem 0 0; color: #647482; }
.section-title { font-size: 1.05rem; color: var(--brand); margin-bottom: 1rem; }
.card { border-color: var(--line); box-shadow: 0 1px 2px rgba(16,54,79,.04); }
.table-responsive { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table thead th { background: #edf3f6; color: #3d5261; font-size: .78rem; white-space: nowrap; }
.service-card { border: 1px solid var(--line); border-radius: .65rem; padding: 16px; background: #fbfdfe; }
.sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 12px; padding: 14px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: .65rem; }
.status-badge { display: inline-block; border-radius: 999px; padding: .25rem .55rem; font-size: .76rem; background: #e7eef2; color: #375266; }
.status-submitted { background: #fff1cf; color: #795900; }
.status-approved, .status-confirmed, .status-completed { background: #dff4e8; color: #17643a; }
.status-cancelled { background: #fee7e5; color: #922b23; }
.detail-grid, .amount-list { display: grid; grid-template-columns: minmax(150px, .8fr) 1.2fr; gap: .7rem 1rem; margin: 0; }
.detail-grid dt, .amount-list dt { color: #5c6d79; font-weight: 500; }
.detail-grid dd, .amount-list dd { margin: 0; }
.metric-card { background: white; border: 1px solid var(--line); border-radius: .75rem; padding: 18px; }
.metric-card span { display: block; color: #60717e; }
.metric-card strong { display: block; font-size: 2rem; color: var(--brand); margin-top: .5rem; }
.metric-card.compact { padding: 13px 15px; }
.metric-card.compact strong { font-size: 1.55rem; }
.metric-card.metric-warning { border-left: 4px solid #d89b15; }
.metric-card.metric-danger { border-left: 4px solid #c4473d; }
.money-card .money-row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: .45rem; margin-top: .45rem; }
.money-card .money-row strong { font-size: 1.05rem; margin: 0; font-variant-numeric: tabular-nums; }
.report-filters .form-check-input { margin-top: .7rem; }
.report-table-wrap { max-width: 100%; }
.report-table { min-width: 1200px; }
.boat-note-form { min-width: 180px; }
.master-card { min-height: 110px; color: var(--brand-dark); justify-content: center; gap: .35rem; }
.master-card span { color: #647482; font-size: .9rem; }
.master-form { max-width: 760px; }
.audit-details { display: block; max-width: 520px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state, .error-page { text-align: center; padding: 48px 24px !important; color: #60717e; }
.error-page h1 { color: var(--brand); font-size: 4rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #10364f, #2f7899); }
.login-card { width: min(430px, 100%); background: white; padding: 34px; border-radius: 1rem; box-shadow: 0 22px 60px rgba(0,0,0,.25); }
.login-brand { color: var(--brand); font-size: 1.8rem; font-weight: 750; }
.login-brand-zh { color: #405968; font-size: 1.05rem; font-weight: 600; letter-spacing: .08em; }
.login-title { word-break: keep-all; overflow-wrap: normal; }
.boat-control-heading, .month-view-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.boat-control-heading h1, .month-view-heading h1 { margin: 0; color: var(--brand-dark); font-size: 1.55rem; }
.boat-help, .month-view-heading span { display: inline-block; margin-top: 3px; color: #71808a; font-size: .78rem; }
.boat-toolbar, .month-toolbar { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px; padding: 9px 12px; margin-bottom: 12px; box-shadow: none; }
.boat-nav-arrow { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: .55rem; background: #fff; color: var(--brand); font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.boat-nav-arrow:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.boat-date-form { display: flex; align-items: center; gap: 8px; }
.boat-date-form .form-control { width: 150px; min-height: 38px; font-weight: 650; color: var(--brand-dark); }
.boat-date-form span { color: #60717e; font-size: .8rem; white-space: nowrap; }
.fleet-control-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: .65rem; background: #fff; }
.fleet-count-label { display: flex; align-items: center; gap: 8px; color: #60717e; font-size: .78rem; }
.fleet-count-label strong { min-width: 28px; padding: 3px 8px; border-radius: 999px; color: #fff; background: var(--brand); text-align: center; font-size: .85rem; }
.fleet-manager { position: relative; }
.fleet-manager > summary { list-style: none; cursor: pointer; }
.fleet-manager > summary::-webkit-details-marker { display: none; }
.fleet-manager-panel { position: absolute; z-index: 1040; top: calc(100% + 8px); right: 0; width: min(680px, calc(100vw - 48px)); max-height: min(620px, 75vh); overflow: auto; padding: 14px; box-shadow: 0 16px 42px rgba(16,54,79,.2); }
.fleet-manager-panel > header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fleet-manager-panel > header span { color: #647482; font-size: .78rem; }
.fleet-manager-filters { display: grid; grid-template-columns: 1fr 220px; gap: 8px; margin-bottom: 10px; }
.fleet-add-form { display: grid; gap: 10px; }
.fleet-boat-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fleet-boat-options section { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: .55rem; }
.fleet-boat-options section > strong { display: block; margin-bottom: 5px; color: var(--brand-dark); font-size: .78rem; }
.fleet-boat-options label { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 6px; min-height: 38px; padding: 4px; border-radius: .4rem; cursor: pointer; }
.fleet-boat-options label:hover { background: #f0f6f8; }
.fleet-boat-options label span { min-width: 0; font-size: .8rem; font-weight: 650; }
.fleet-boat-options label small { color: #647482; font-size: .68rem; }
.fleet-manager-empty { padding: 12px; color: #60717e; font-size: .8rem; }
.boat-summary-chips { display: grid; grid-template-columns: repeat(9, minmax(82px, 1fr)); gap: 8px; margin-bottom: 14px; }
.summary-chip { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.summary-chip span { min-width: 0; color: #60717e; font-size: .72rem; line-height: 1.15; }
.summary-chip strong { color: var(--brand-dark); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.summary-assigned { border-color: #a9d8bc; background: #f3fbf6; }
.summary-customer { border-color: #a9cfe8; background: #f3f9fd; }
.summary-candidate { border-color: #eed185; background: #fffaf0; }
.summary-charter { border-color: #c5b5de; background: #faf7fd; }
.summary-chip.has-alert { border-color: #e2ad35; background: #fff4d7; }
.summary-chip.has-danger { border-color: #d5665d; background: #fff1ef; }
.unassigned-warning-card { margin: 0 0 16px; padding: 14px; border: 2px solid #e0a52d; border-radius: .8rem; background: #fff8e7; box-shadow: 0 5px 18px rgba(159,106,0,.08); }
.unassigned-warning-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.unassigned-warning-card > header div { display: flex; align-items: baseline; gap: 9px; }
.unassigned-warning-card > header strong { color: #825b00; }
.unassigned-warning-card > header span { color: #806d43; font-size: .78rem; }
.unassigned-total { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; background: #d98b00; color: #fff !important; font-weight: 750; font-size: .86rem !important; }
.all-assigned-note { margin-bottom: 14px; padding: 8px 12px; border: 1px solid #b9ddc8; border-radius: .6rem; background: #f3fbf6; color: #286342; font-size: .82rem; }
.fleet-empty-state { display: grid; justify-items: start; gap: 7px; margin-bottom: 14px; padding: 20px; border: 2px dashed #b7c5ce; border-radius: .8rem; background: #f8fafb; color: #536773; }
.fleet-empty-state > strong { color: var(--brand-dark); }
.fleet-empty-state > span { color: #8a6100; font-size: .82rem; }
.unassigned-chip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 9px; }
.boat-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); gap: 16px; }
.boat-control-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-top: 6px solid #2f8f58; border-radius: .85rem; background: #fff; box-shadow: 0 5px 18px rgba(16,54,79,.07); }
.boat-control-card.boat-normal { border-top-color: #2f8f58; }
.boat-control-card.boat-full, .boat-control-card.boat-overbooked { border-top-color: #c4473d; box-shadow: 0 5px 18px rgba(196,71,61,.11); }
.boat-control-card.boat-charter { border-top-color: #7455a6; }
.boat-control-card.boat-unset { border-top-color: #7c8790; }
.boat-card-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: flex-start; gap: 10px; }
.boat-identity-row { min-width: 0; display: flex; align-items: flex-start; gap: 7px; }
.fleet-drag-handle { flex: 0 0 auto; width: 30px; min-height: 34px; border: 0; border-radius: .4rem; color: #73838d; background: #edf2f4; cursor: grab; font-size: 1rem; letter-spacing: -.25rem; padding-right: .45rem; }
.fleet-drag-handle:active { cursor: grabbing; }
.boat-control-card.fleet-card-dragging { opacity: .5; }
.boat-control-card.fleet-card-drag-over { outline: 3px solid rgba(23,75,108,.3); }
.fleet-card-menu { position: relative; }
.fleet-card-menu > summary { width: 32px; height: 32px; display: grid; place-items: center; border-radius: .45rem; color: var(--brand); background: #edf3f6; cursor: pointer; list-style: none; font-size: 1.15rem; }
.fleet-card-menu > summary::-webkit-details-marker { display: none; }
.fleet-card-menu > div { position: absolute; z-index: 20; top: 36px; right: 0; width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: .55rem; background: #fff; box-shadow: 0 8px 22px rgba(16,54,79,.18); }
.fleet-card-menu form { margin: 0; }
.fleet-card-menu button { width: 100%; min-height: 38px; border: 0; border-radius: .4rem; background: #fff; text-align: left; font-size: .76rem; }
.fleet-card-menu button:hover { background: #eef4f7; }
.boat-identity h2 { margin: 0; color: var(--brand-dark); font-size: 1.35rem; letter-spacing: .02em; }
.boat-identity span { color: #647482; font-size: .82rem; }
.boat-capacity { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.boat-capacity > strong { color: var(--brand-dark); font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1; }
.boat-state { display: inline-block; border-radius: 999px; padding: .2rem .5rem; font-size: .7rem; font-weight: 750; }
.state-normal { color: #17643a; background: #dff4e8; }
.state-danger { color: #fff; background: #c4473d; }
.state-charter { color: #fff; background: #7455a6; }
.state-muted { color: #49565f; background: #e7ebee; }
.occupancy-progress { height: 9px; margin: 12px 0 10px; border-radius: 999px; overflow: hidden; background: #e6eee9; }
.occupancy-progress span { display: block; height: 100%; border-radius: inherit; background: #2f8f58; transition: width .2s ease; }
.occupancy-progress.progress-danger { background: #fae7e5; }
.occupancy-progress.progress-danger span { background: #c4473d; }
.occupancy-progress.capacity-unset { background: repeating-linear-gradient(135deg,#e5e9ec,#e5e9ec 8px,#f3f5f6 8px,#f3f5f6 16px); }
.boat-metric-chips, .project-breakdown, .chip-status-row, .chip-candidates { display: flex; flex-wrap: wrap; gap: 6px; }
.boat-metric-chips > span, .project-breakdown > span, .chip-candidates > span { border-radius: 999px; padding: .22rem .52rem; font-size: .72rem; }
.boat-metric-chips .metric-assigned { color: #17643a; background: #dff4e8; }
.boat-metric-chips .metric-customer { color: #15527c; background: #dfeefa; }
.boat-metric-chips .metric-candidate { color: #795900; background: #fff1cf; }
.boat-metric-chips .metric-empty { color: #687680; background: #eef1f3; }
.project-breakdown { margin-top: 8px; }
.project-breakdown > span { color: #405663; background: #edf3f6; }
.assignment-zone-grid, .candidate-zone-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.boat-drop-zone { min-width: 0; border: 2px dashed #b7c5ce; border-radius: .65rem; padding: 9px; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.assignment-zone { min-height: 76px; }
.assignment-zone > header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; color: #4f606c; font-size: .74rem; }
.assigned-zone { border-color: #9fceb2; background: #f6fbf8; }
.customer-zone { border-color: #a8cee6; background: #f5faff; }
.candidate-zone { min-height: 48px; border-color: #e4c36f; background: #fffaf0; }
.candidate-zone > header { color: #795900; font-size: .73rem; font-weight: 700; }
.drop-placeholder, .candidate-placeholder { display: grid; place-items: center; min-height: 30px; color: #7b8890; font-size: .72rem; text-align: center; }
.candidate-placeholder { min-height: 22px; color: #9a7113; }
.boat-drop-zone.drag-over { border-color: #174b6c; background: #e8f4fa; box-shadow: 0 0 0 3px rgba(23,75,108,.2); }
#boat-board.is-dragging .boat-drop-zone { border-style: solid; }
.boat-service-chip { min-width: 0; padding: 8px; margin-top: 6px; border: 1px solid #ccd8df; border-radius: .58rem; background: #fff; cursor: grab; overflow-wrap: anywhere; box-shadow: 0 1px 3px rgba(16,54,79,.05); }
.boat-service-chip.dragging { opacity: .42; transform: scale(.98); }
.boat-service-chip.chip-conflict { border: 2px solid #c4473d; background: #fff7f6; }
.chip-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; color: var(--brand-dark); text-decoration: none; }
.chip-main strong { font-size: .84rem; line-height: 1.25; }
.chip-main > span { flex: 0 0 auto; color: var(--brand); font-size: .68rem; }
.chip-meta { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 4px; color: #647482; font-size: .72rem; }
.chip-status-row { margin-top: 5px; }
.assignment-label, .service-status-label { border-radius: 999px; padding: .16rem .45rem; font-size: .66rem; }
.assignment-label { color: #795900; background: #fff1cf; }
.service-status-label { color: #375266; background: #e7eef2; }
.chip-candidates { margin-top: 5px; }
.chip-candidates > span { color: #795900; background: #fff7df; }
.chip-conflict-label { display: block; margin-top: 6px; color: #a62f27; font-size: .69rem; font-weight: 800; }
.mobile-service-actions { display: block; margin-top: 6px; }
.mobile-service-actions > summary { min-height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: .5rem; color: var(--brand); cursor: pointer; font-size: .72rem; font-weight: 700; list-style: none; }
.mobile-service-actions > summary::-webkit-details-marker { display: none; }
.mobile-action-sheet { display: grid; gap: 8px; margin-top: 8px; }
.mobile-action-form { display: grid; gap: 7px; }
.mobile-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.mobile-danger-zone { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid #e7a8a3; border-radius: .6rem; background: #fff7f6; }
.mobile-danger-zone > header { display: flex; flex-direction: column; gap: 2px; color: #8f2721; }
.mobile-danger-zone > header span { font-size: .7rem; }
.image-proof-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.image-proof-action { min-width: 0; white-space: normal; }
.image-proof-status { overflow-wrap: anywhere; }
.boat-cost-details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
.boat-cost-details > summary { cursor: pointer; color: #4f606c; font-size: .78rem; font-weight: 650; }
.cost-pool-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; padding: 10px; border: 1px solid var(--line); border-radius: .55rem; background: #fafcfd; font-size: .78rem; }
.cost-pool-row > div { display: flex; flex-direction: column; gap: 2px; }
.cost-pool-row > div span { color: #6b7880; font-size: .68rem; }
.cost-override-panel, .cost-review-form { grid-column: 1 / -1; }
.cost-review-form { display: flex; gap: 6px; }
.cost-empty { padding: 8px 0; color: #71808a; font-size: .75rem; }
.month-view-heading { align-items: flex-start; }
.month-toolbar strong { min-width: 130px; text-align: center; color: var(--brand-dark); }
.calendar-weekdays, .boat-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.calendar-weekdays { margin-bottom: 7px; }
.calendar-weekdays span { padding: 5px; color: #687680; font-size: .68rem; font-weight: 700; text-align: center; line-height: 1.2; }
.month-day-spacer { min-height: 132px; border-radius: .65rem; background: rgba(225,231,235,.35); }
.month-day-card { min-width: 0; min-height: 132px; display: flex; flex-direction: column; gap: 5px; padding: 9px; border: 1px solid var(--line); border-radius: .65rem; background: #fff; color: inherit; text-decoration: none; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.month-day-card:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(16,54,79,.08); transform: translateY(-1px); }
.month-day-card > header { display: flex; justify-content: space-between; gap: 4px; }
.month-day-card > header strong { color: var(--brand-dark); font-size: 1rem; }
.month-day-card > header span { color: #17643a; font-size: .58rem; font-weight: 750; }
.month-day-card.is-today { border: 2px solid #2f8f58; background: #f7fcf9; }
.month-day-card.empty { min-height: 132px; background: #fbfcfd; }
.calendar-day-metrics { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.calendar-day-metrics strong { color: var(--brand); font-size: .83rem; }
.calendar-day-metrics span { color: #687680; font-size: .64rem; }
.calendar-status-badges { display: flex; flex-wrap: wrap; gap: 3px; }
.calendar-status-badges span { border-radius: 999px; padding: .12rem .32rem; font-size: .55rem; font-weight: 800; }
.calendar-danger { color: #fff; background: #c4473d; }
.calendar-charter { color: #fff; background: #7455a6; }
.calendar-warning { color: #684900; background: #ffd879; }
.calendar-candidate { color: #795900; background: #fff1cf; }
.calendar-boats { display: flex; flex-direction: column; gap: 2px; color: #5f6e77; font-size: .62rem; }
.month-business-list { display: none; }
.month-list-card { display: grid; grid-template-columns: 70px 90px 1fr; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: .65rem; background: #fff; color: inherit; text-decoration: none; }
.month-list-card > div:first-child, .month-list-metrics { display: flex; flex-direction: column; }
.month-list-card > div span { color: #687680; font-size: .7rem; }
.month-list-card.is-today { border: 2px solid #2f8f58; }

@media (max-width: 991px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; display: none; }
  .sidebar.open { display: flex; }
  .content-area { padding: 16px; }
  .page-heading { flex-direction: column; }
  .topbar { padding: 0 14px; font-size: .9rem; }
  .topbar > strong { line-height: 1.15; }
  .topbar > span { display: none; }
  .dashboard-grid .metric-card { height: 100%; padding: 14px; }
  .metric-card strong { font-size: 1.55rem; }
  .report-filters .col-6 { min-width: 0; }
  .login-title { font-size: 1.15rem; }
  .boat-summary-chips { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .boat-card-grid { grid-template-columns: 1fr; }
  .boat-service-chip { cursor: default; }
}

@media (min-width: 992px) {
  .sidebar-nav-group > summary { cursor: default; }
  .sidebar-nav-group > summary::after { display: none; }
  .sidebar-nav-group:not([open]) > .sidebar-nav-items { display: block; }
}

@media (max-width: 768px) {
  .boat-control-heading, .month-view-heading { align-items: flex-start; }
  .boat-control-heading h1, .month-view-heading h1 { font-size: 1.3rem; }
  .boat-toolbar { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 40px; gap: 7px; }
  .boat-date-form { min-width: 0; }
  .boat-date-form .form-control { min-width: 0; width: 100%; padding-inline: 7px; }
  .boat-date-form span { display: none; }
  .boat-month-link { grid-column: 1 / -1; min-height: 38px; display: grid; place-items: center; }
  .boat-today { min-height: 38px; display: grid; place-items: center; }
  .boat-summary-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .fleet-manager-panel { position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: 100%; max-height: 82vh; border-radius: 1rem 1rem 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .fleet-manager-filters, .fleet-boat-options { grid-template-columns: 1fr; }
  .fleet-boat-options label { min-height: 44px; }
  .summary-chip { border-radius: .6rem; padding: 8px 9px; }
  .unassigned-warning-card > header div { flex-direction: column; gap: 1px; }
  .unassigned-chip-grid { grid-template-columns: 1fr; }
  .boat-control-card { padding: 13px; }
  .boat-card-header { gap: 8px; }
  .boat-card-header { grid-template-columns: minmax(0, 1fr) auto auto; }
  .fleet-drag-handle { display: none; }
  .fleet-card-menu > summary { width: 44px; height: 44px; }
  .fleet-card-menu button { min-height: 44px; }
  .boat-capacity > strong { font-size: 1.25rem; }
  .assignment-zone-grid { grid-template-columns: 1fr; }
  .candidate-zone-grid { gap: 7px; }
  .drop-placeholder { display: none; }
  .boat-service-chip { cursor: default; }
  .mobile-service-actions { display: block; margin-top: 6px; }
  .mobile-service-actions > summary { min-height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: .5rem; color: var(--brand); cursor: pointer; font-size: .76rem; font-weight: 700; list-style: none; }
  .mobile-service-actions > summary::-webkit-details-marker { display: none; }
  .mobile-service-actions[open] { position: fixed; z-index: 1060; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; margin: 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 1rem 1rem 0 0; background: #fff; box-shadow: 0 -12px 40px rgba(0,0,0,.25); }
  .mobile-service-actions[open] > summary { margin-bottom: 10px; background: #edf4f7; }
  .mobile-action-sheet { display: grid; gap: 10px; }
  .mobile-action-form { display: grid; gap: 8px; }
  .mobile-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mobile-action-sheet .btn, .mobile-action-form .form-select, .mobile-action-form .form-control { min-height: 44px; }
  .mobile-danger-zone { margin-top: 12px; padding: 12px; }
  .cost-pool-row { grid-template-columns: 1fr; }
  .cost-override-panel, .cost-review-form { grid-column: 1; }
  .cost-review-form { flex-direction: column; }
  .month-calendar-desktop { display: none; }
  .month-business-list { display: grid; gap: 8px; }
  .month-toolbar { justify-content: space-between; }
  .evidence-stage { min-height: 52vh; max-height: 62vh; }
  .evidence-pdf { min-height: 60vh; }
  .evidence-controls .btn { flex: 1 1 46%; }
}

@media (max-width: 420px) {
  .login-card { padding: 26px 20px; }
  .login-title { font-size: 1.05rem; }
  .detail-grid, .amount-list { grid-template-columns: 1fr; gap: .25rem; }
  .detail-grid dd, .amount-list dd { margin-bottom: .65rem; }
  .boat-help { max-width: 290px; }
  .candidate-zone-grid { grid-template-columns: 1fr; }
  .image-proof-actions { grid-template-columns: 1fr; }
  .month-view-heading { flex-direction: column; }
  .month-list-card { grid-template-columns: 58px 74px 1fr; gap: 7px; }
}

.operations-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
.operations-kpi-grid > div { background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: .8rem; }
.operations-kpi-grid span { display: block; color: #667085; font-size: .78rem; }
.operations-kpi-grid strong { display: block; font-size: 1.35rem; }
.operations-calendar { min-width: 680px; padding: .75rem; }
.calendar-weekdays, .calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays span { padding: .5rem; text-align: center; color: #667085; font-size: .8rem; }
.operations-day-cell { color: inherit; min-height: 112px; padding: .55rem; border: 1px solid #e5e7eb; text-decoration: none; display: flex; flex-direction: column; gap: .18rem; }
.operations-day-cell:hover { background: #f8fafc; }
.operations-day-cell.is-today { box-shadow: inset 0 0 0 2px #0d6efd; }
.operations-day-cell.is-outside { background: #f8f9fa; }
.operations-day-cell > span { font-weight: 600; font-size: .82rem; }
.operations-day-cell small { color: #667085; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.operations-day-cell em { color: #b54708; font-size: .72rem; font-style: normal; }

@media (max-width: 767.98px) {
  .btn, .nav-link, .list-group-item-action, .boat-nav-arrow,
  .form-control, .form-select { min-height: 44px !important; }
  .operations-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-calendar { min-width: 0; padding: .35rem; }
  .operations-day-cell { min-height: 76px; padding: .3rem; }
  .operations-day-cell > span { font-size: .68rem; }
  .operations-day-cell small { display: none; }
  .calendar-weekdays span { padding: .3rem 0; font-size: .68rem; }
  .mobile-sticky-action { position: sticky; bottom: 0; z-index: 20; }
}

/* Product & Pricing Center */
.pricing-mobile-list { display: none; }
.pricing-rule-table { min-width: 1180px; }
.pricing-rule-card, .pricing-tier-row { min-width: 0; overflow-wrap: anywhere; }
.pricing-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pricing-tier-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.pricing-tier-fields > div { min-width: 0; }
.pricing-tier-row.is-inactive { border-color: #c9d0d5 !important; background: #f5f6f7; opacity: .78; }
.pricing-tier-summary { display: grid; gap: .35rem; padding: .75rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.pricing-tier-summary:last-child { border-bottom: 0; }
.pricing-tier-summary.is-inactive { color: #667085; }
.pricing-save-actions { display: flex; justify-content: flex-end; background: #fff; }

@media (max-width: 767.98px) {
  .pricing-desktop-table { display: none !important; }
  .pricing-mobile-list { display: grid; gap: .75rem; }
  .pricing-tier-fields { grid-template-columns: 1fr; }
  .pricing-tier-row { padding: .85rem !important; }
  .pricing-tier-order-actions span { display: none; }
  .pricing-tier-order-actions .btn { min-width: 44px; }
  .pricing-card-actions { display: grid; grid-template-columns: 1fr; }
  .pricing-detail-actions { width: 100%; display: grid !important; grid-template-columns: 1fr; }
  .pricing-save-actions { bottom: 0; margin-inline: -.75rem; padding: .75rem; border-top: 1px solid var(--line); }
  .pricing-save-actions .btn { width: 100%; }
}

/* RC3 order cancellation workflow */
.cancellation-list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}
.cancellation-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
}
.cancellation-case-card,
.cancellation-action-card { min-width: 0; overflow-wrap: anywhere; }
.cancellation-control,
.cancellation-touch-target,
.cancellation-submit { min-height: 44px; }
.cancellation-check {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  min-height: 44px;
  padding-block: .55rem;
}
.cancellation-check .form-check-input {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0;
}
.cancellation-definition-list dd { overflow-wrap: anywhere; }

@media (max-width: 991.98px) {
  .cancellation-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .cancellation-list-grid,
  .cancellation-summary-grid { grid-template-columns: 1fr; }
  .cancellation-form .card-body,
  .cancellation-case-card .card-body,
  .cancellation-action-card .card-body { padding: .9rem; }
  .cancellation-definition-list dt { margin-top: .5rem; }
  .cancellation-definition-list dd { margin-bottom: .5rem; }
  .cancellation-action-card .card-footer { padding: .75rem; }
}
