:root {
  color-scheme: dark;
  --canvas: #10172b;
  --surface: #1b2540;
  --surface-alt: #212e4d;
  --surface-raised: #28385b;
  --surface-hover: #304267;
  --surface-stripe: #1e2a47;
  --line: #3c4a6b;
  --accent-line: #7797d5;
  --accent-glow: #739bff;
  --pine: #d0dfff;
  --pine-deep: #111a34;
  --green: #a9c8ff;
  --lime: #b4d9ff;
  --ink: #f5f7ff;
  --muted: #bac8e4;
  --focus: #b1d3ff;
  --danger-text: #ffbaba;
  --danger-bg: #522d3b;
  --warning-text: #ffe29a;
  --warning-bg: #45391f;
  --success-text: #b1f0c8;
  --success-bg: #1d4134;
  --info-text: #b5deff;
  --info-bg: #25435f;
  --backdrop: #050819b8;
  font: 16px 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 84% -12%, #2b5189c9, transparent 53%),
    radial-gradient(ellipse at 13% 60%, #20367591, transparent 55%),
    linear-gradient(140deg,#14192e,#10172b);
  background-attachment: fixed;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 1.2rem; height: 1.2rem; display: block; flex: none; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
h1, h2, h3, .brand, .metric-value { font-family: Manrope, system-ui, sans-serif; }
h1, h2, h3, p { margin: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 234px; padding: 29px 17px 20px; background: var(--pine-deep); color: var(--ink); z-index: 2; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; white-space: nowrap; color: white; }
.brand-icon { background: var(--lime); color: var(--pine-deep); border-radius: 11px; width: 40px; height: 40px; }
.brand-icon svg { width: 25px; height: 25px; }
.brand strong { font-size: 18px; font-weight: 800; letter-spacing: -.55px; }
.brand strong span { color: var(--lime); }
.brand small { display: block; margin-top: 2px; font: 700 10px 'DM Sans', sans-serif; letter-spacing: 1.35px; color: var(--muted); }
.sidebar nav { margin-top: 51px; }
.nav-label { margin: 0 12px 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.4px; }
.sidebar nav a, .nav-action { display: flex; align-items: center; gap: 11px; width: 100%; color: var(--muted); padding: 11px 12px; min-height: 44px; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.sidebar nav a + a { margin-top: 4px; }
.sidebar nav a:hover, .nav-action:hover { background: #2a4372; }
.sidebar nav a[aria-current="page"] { color: var(--lime); background: #2a4372; }
.sidebar-bottom { margin-top: auto; }
.nav-action { background: transparent; border: 0; text-align: left; }
.profile { margin-top: 15px; border-top: 1px solid var(--line); padding: 17px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: #2a4372; color: var(--lime); font-size: 12px; font-weight: 800; }
.profile strong, .profile small { display: block; }
.profile strong { color: white; font-size: 13px; }
.profile small { font-size: 12px; color: var(--muted); margin-top: 3px; }
.shell { margin-left: 234px; }
.sidebar-collapsed .sidebar { display: none; }
.sidebar-collapsed .shell { margin-left: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-leading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.breadcrumb, .header-right, .header-date { display: flex; align-items: center; gap: 10px; }
.breadcrumb { color: var(--muted); font-size: .9rem; }
.breadcrumb strong { color: var(--ink); }
.breadcrumb svg, .header-date svg { width: 16px; height: 16px; }
.header-right { gap: 18px; }
.header-date { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.btn, .period, input, select { min-height: 41px; border-radius: 10px; border: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: linear-gradient(180deg, #2b3a5c, var(--surface)); color: var(--ink); padding: 0 13px; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.btn:hover { background: var(--surface-hover); }
.btn svg { width: 16px; height: 16px; }
.primary { background: var(--green); border-color: var(--green); color: white; }
.primary:hover { background: #243e80; }
.danger { color: var(--danger-text); }
main { max-width: 1550px; margin: auto; padding: 26px 32px 42px; }

.hero { min-height: 228px; padding: 30px 31px; border-radius: 15px; color: white; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; overflow: hidden; isolation: isolate; background: var(--pine-deep) url('rafting.jpg') 63% 53% / cover; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,var(--pine-deep) 2%,#080d29ef 26%,#080d2988 51%,#080d2906 100%); }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .73rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.hero-kicker svg { width: 17px; height: 17px; }
.hero h1 { margin-top: 9px; font-size: clamp(2rem, 3.35vw, 3.05rem); line-height: 1.13; letter-spacing: -.05em; font-weight: 800; }
.hero p:not(.hero-kicker) { margin-top: 8px; color: var(--ink); }
.hero .btn { margin-top: 19px; color: var(--canvas); background: var(--lime); border-color: var(--lime); }
.hero .btn:hover { background: var(--surface-hover); }
.section-bar, .page-heading, .panel-heading, .filters { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-bar { margin: 24px 0 12px; }
h2 { font-size: 1.16rem; font-weight: 800; letter-spacing: -.035em; }
.section-bar p, .panel-heading p, .page-heading p { color: var(--muted); font-size: .875rem; margin-top: 4px; line-height: 1.5; }
.period { display: flex; align-items: center; gap: 7px; padding: 0 10px; background: var(--surface); color: var(--muted); }
.period svg { width: 16px; height: 16px; }
.period input { border: 0; min-height: 38px; width: 9.5rem; padding: 0; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.metric { padding: 15px 16px; min-width: 0; }
.metric-head { display: flex; align-items: center; gap: 8px; color: var(--pine); font-size: .875rem; font-weight: 700; }
.metric-icon { width: 34px; height: 34px; border-radius: 8px; color: var(--pine); background: var(--surface-alt); }
.metric-icon svg { width: 17px; height: 17px; }
.metric-icon.amber { background: var(--warning-bg); color: var(--warning-text); }
.metric-icon.blue { background: var(--info-bg); color: var(--info-text); }
.metric-value { display: block; margin-top: 10px; font-size: clamp(1.12rem, 2vw, 1.72rem); line-height: 1.15; letter-spacing: -.048em; font-weight: 800; overflow-wrap: anywhere; }
.metric small { display: block; margin-top: 7px; font-size: .78rem; color: var(--muted); }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 15px; margin-top: 17px; }
.panel { min-width: 0; }
.panel-heading { padding: 17px 17px 13px; align-items: flex-start; }
.text-link { color: var(--green); font-weight: 800; font-size: .85rem; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.chart-area { padding: 1px 17px 16px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--muted); }
.chart-legend span, .legend-item { display: inline-flex; align-items: center; gap: 5px; }
.swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--accent-glow); display: inline-block; flex: none; }
.swatch.out { background: var(--lime); }
.chart { height: 170px; position: relative; margin-top: 15px; padding: 0 0 22px 55px; }
.chart-grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; }
.grid-line { display: grid; grid-template-columns: 51px 1fr; align-items: center; height: 0; color: var(--muted); font-size: .72rem; }
.grid-line::after { content: ''; border-top: 1px dashed var(--line); }
.bar-groups { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); height: 100%; }
.bar-group { height: 100%; min-width: 0; display: flex; align-items: end; justify-content: center; gap: 4px; position: relative; }
.bar { display: block; width: min(23px,30%); border-radius: 4px 4px 0 0; background: var(--accent-glow); }
.bar.out { background: var(--lime); }
.bar-group small { position: absolute; top: calc(100% + 5px); white-space: nowrap; color: var(--muted); font-size: .72rem; }
.agenda { display: grid; padding: 0 17px 13px; }
.agenda-row { padding: 11px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: var(--ink); }
.agenda-row:hover { color: var(--green); }
.date-tile { display: grid; place-content: center; text-align: center; background: var(--surface-alt); color: var(--pine); min-width: 43px; min-height: 44px; border-radius: 8px; line-height: 1.05; }
.date-tile strong { font-size: 1rem; }
.date-tile small { font-size: .69rem; margin-top: 3px; text-transform: uppercase; }
.agenda-name { display: block; font-size: .875rem; font-weight: 800; overflow-wrap: anywhere; }
.agenda-meta { font-size: .76rem; color: var(--muted); display: block; margin-top: 4px; }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 20px; color: var(--pine); background: var(--surface-alt); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.badge.wait { background: var(--warning-bg); color: var(--warning-text); }
.badge.done { background: var(--info-bg); color: var(--info-text); }
.badge.stop { background: var(--danger-bg); color: var(--danger-text); }
.table-panel { margin-top: 17px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
th { background: var(--surface-raised); text-align: left; color: var(--pine); font-weight: 700; }
td, th { padding: 11px 15px; border-top: 1px solid var(--line); white-space: nowrap; }
td:first-child, th:first-child { padding-left: 17px; }
td strong { display: block; }
td small { display: block; color: var(--muted); margin-top: 3px; font-size: .77rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 25px 17px; color: var(--muted); font-size: .92rem; text-align: center; }
.page-heading { margin: 5px 0 21px; }
.page-heading h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.05em; }
.filters { justify-content: flex-start; flex-wrap: wrap; padding: 13px 17px; }
.filters input { flex: 1; min-width: 175px; }
input, select { color: var(--ink); background: var(--canvas); padding: 8px 10px; font-size: .9rem; }
select { appearance: none; padding-right: 32px; background: var(--canvas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23c1cfee' stroke-width='1.5'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E") right 7px center / 17px no-repeat; }
.icon-btn { display: inline-grid; place-items: center; min-width: 36px; min-height: 35px; padding: 4px; background: var(--surface); color: var(--green); border: 1px solid var(--line); border-radius: 7px; }
.icon-btn:hover { background: var(--surface-hover); }
.month-nav { display: flex; align-items: center; gap: 7px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.weekday { padding: 10px 2px; text-align: center; background: var(--surface-raised); color: var(--muted); font-size: .8rem; font-weight: 700; }
.calendar-day { display: flex; flex-direction: column; gap: 5px; text-align: left; padding: 8px; min-height: 90px; min-width: 0; color: var(--ink); background: var(--surface); border: 0; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.calendar-day:nth-child(7n) { border-right: 0; }
button.calendar-day:hover { background: var(--surface-hover); }
.calendar-day.blank { background: var(--surface-alt); }
.calendar-day.selected { background: var(--surface-raised); }
.calendar-day small { color: var(--green); font-size: .72rem; font-weight: 700; overflow-wrap: anywhere; }
dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: min(560px, calc(100% - 28px)); max-height: calc(100% - 30px); color: var(--ink); padding: 0; box-shadow: 0 20px 60px #02061770; }
dialog::backdrop { background: var(--backdrop); }
.dialog-header, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px 19px; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-actions { flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--line); }
#dialog-fields { padding: 17px 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.form-grid label { font-size: .875rem; font-weight: 700; display: grid; gap: 5px; min-width: 0; }
.form-grid :is(input,select) { width: 100%; }
.form-grid .wide { grid-column: 1 / -1; }
.dialog-note { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.dialog-note + .dialog-note { margin-top: 10px; }
.payment-summary { margin-top: 14px; padding: 10px; background: var(--surface-alt); border-radius: 8px; font-size: .875rem; }
.form-error { color: var(--danger-text); margin: 0 19px 12px; font-size: .875rem; }
#toast { position: fixed; bottom: 22px; right: 22px; z-index: 5; max-width: calc(100vw - 44px); border-radius: 9px; padding: 12px 16px; color: white; background: var(--pine-deep); font-size: .9rem; box-shadow: 0 7px 22px #02061740; }
@media (max-width: 1140px) {
  .sidebar { width: 201px; }
  .shell { margin-left: 201px; }
  main,.topbar { padding-left: 22px; padding-right: 22px; }
  .agenda-row .badge { display: none; }
  .agenda-row { grid-template-columns: auto minmax(0,1fr); }
}
@media (max-width: 900px) {
  .sidebar { width: 173px; padding-inline: 10px; }
  .brand { gap: 6px; padding-inline: 3px; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 8px; }
  .brand-icon { width: 34px; height: 34px; }
  .shell { margin-left: 173px; }
  .header-date { display: none; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-grid { grid-template-columns: minmax(0,1fr); }
  .agenda-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .agenda-row .badge { display: inline-flex; }
}
@media (max-width: 650px) {
  .sidebar { position: sticky; top: 0; padding: 8px 10px 6px; width: auto; }
  .brand { width: fit-content; margin: 0 0 6px; }
  .brand small, .nav-label, .profile, .header-date, .breadcrumb > span { display: none; }
  .sidebar nav { margin: 0; display: flex; }
  .sidebar nav a { width: auto; padding: 6px 10px; min-height: 35px; gap: 4px; font-size: .75rem; }
  .sidebar nav a svg { width: 14px; height: 14px; }
  .sidebar-bottom { position: absolute; right: 12px; top: 8px; }
  .nav-action { font-size: 0; padding: 5px; min-height: 32px; }
  .shell { margin-left: 0; }
  .topbar { min-height: 53px; padding: 7px 13px; }
  main { padding: 13px 12px 24px; }
  .hero { padding: 21px 15px; min-height: 210px; background-position: 60% center; }
  .hero::before { background: linear-gradient(90deg,#080d29f5,#080d29bb 51%,#080d293d); }
  .section-bar { align-items: flex-start; }
  .section-bar p { font-size: .78rem; }
  .period { padding-inline: 5px; gap: 3px; }
  .period > [data-icon] { display: none; }
  .period input { width: 7.7rem; font-size: .77rem; }
  .metrics { gap: 8px; }
  .metric { padding: 11px 9px; }
  .metric-head { font-size: .78rem; gap: 5px; }
  .metric-icon { width: 25px; height: 25px; }
  .metric-icon svg { width: 14px; height: 14px; }
  .calendar-day { min-height: 65px; padding: 4px; }
  .topbar .btn { min-height: 35px; }
}
.payment-fields { margin-top: 14px; }
.payment-list { list-style: none; padding: 0; margin: 8px 0 0; }
.payment-list li { display: flex; justify-content: space-between; gap: 7px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); }
.payment-list .btn { min-height: 30px; }
.demo-label { color: var(--warning-text); background: var(--warning-bg); border-radius: 20px; font-size: .75rem; font-weight: 700; padding: 4px 8px; white-space: nowrap; }
.page-heading { flex-wrap: wrap; }
main:focus { outline: none; }

.finance-tabs { display: flex; gap: 21px; border-bottom: 1px solid var(--line); margin: 0 0 18px; }
.finance-tabs a { padding: 9px 1px 11px; color: var(--muted); font-size: .9rem; font-weight: 700; border-bottom: 2px solid transparent; }
.finance-tabs a:hover, .finance-tabs a[aria-current] { color: var(--green); }
.finance-tabs a[aria-current] { border-color: var(--green); }
.report-views { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.report-views [aria-pressed="true"] { background: var(--surface-alt); border-color: var(--accent-line); color: var(--green); }
.report-table input { width: 100%; min-width: 100px; min-height: 34px; }
.report-table input[data-field="qty"] { width: 76px; min-width: 0; }
.report-table input[data-field="rate"] { width: 115px; }
.report-table td, .report-table th { padding: 7px 12px; vertical-align: middle; }
.report-table tbody th { background: var(--surface); color: var(--ink); }
.report-table tfoot td, .report-table tfoot th { background: var(--surface-alt); color: var(--ink); font-weight: 800; }
.report-table .num { min-width: 94px; }
.report-save { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 13px; }
.report-save p { font-size: .875rem; color: var(--muted); }
.negative { color: var(--danger-text); }
.panel:has(.recap-table) .table-scroll { max-height: 420px; }
.recap-table th { white-space: nowrap; }
.recap-table thead th { position: sticky; top: 0; z-index: 1; }
.recap-table tr > :first-child { position: sticky; left: 0; }
.recap-table thead th:first-child { z-index: 2; }
.recap-table tfoot :is(th,td) { position: sticky; bottom: 0; }
.report-date-link { padding: 2px 0; color: var(--green); font-weight: 700; background: transparent; border: 0; }
.report-date-link:hover { text-decoration: underline; }
@media (max-width: 650px) {
  .report-table td, .report-table th { padding-inline: 8px; }
  .report-table input[data-field="qty"] { width: 60px; }
  .report-table input[data-field="rate"] { width: 97px; }
  .report-metrics small { line-height: 1.35; }
}

.report-trips .panel-heading { align-items: center; flex-wrap: wrap; }
.trip-list-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.report-summary-heading { flex-wrap: wrap; }
.report-date-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .875rem; }
.report-trip-list { table-layout: fixed; }
.trip-amount-column { width: 154px; }
.trip-action-column { width: 258px; }
.report-trip-list :is(th,td) { padding: 11px 17px; white-space: normal; overflow-wrap: anywhere; }
.report-trip-list tbody th p { margin-top: 4px; color: var(--muted); font-size: .82rem; font-weight: 400; }
.report-trip-list .trip-actions-cell { text-align: center; }
.trip-row-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.trip-row-actions .btn { min-height: 36px; padding-inline: 5px; gap: 4px; }
.report-trip-list tfoot small { margin: 0 0 3px; font-weight: 600; }
.report-trip-list tfoot th:first-child { border-radius: 0 0 0 11px; }
.report-trip-list tfoot td:last-child { border-radius: 0 0 11px 0; }
.trip-detail-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px; margin: 14px 0 0; }
.trip-detail-fields dt { color: var(--muted); font-size: .82rem; }
.trip-detail-fields dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.report-trip-fields { margin-top: 12px; }
.trip-editor-date { max-width: 16rem; }
.report-popup-total { display: flex; justify-content: space-between; gap: 12px; padding: 12px; background: var(--surface-alt); border-radius: 8px; margin-top: 16px; color: var(--pine); font-weight: 800; }
@media (max-width: 760px) {
  .trip-amount-column { width: 110px; }
  .trip-action-column { width: 130px; }
  .report-trip-list :is(th,td) { padding-inline: 8px; }
  .trip-row-actions { gap: 4px; }
  .trip-row-actions .btn { min-height: 42px; padding: 4px 1px; flex-direction: column; gap: 2px; font-size: .75rem; }
}
dialog:has(:is(.report-trip-editor,.report-trip-preview)) { width: min(690px, calc(100% - 24px)); overflow: hidden; }
dialog:has(:is(.report-trip-editor,.report-trip-preview)) > form { display: flex; flex-direction: column; max-height: calc(100dvh - 36px); }
dialog:has(:is(.report-trip-editor,.report-trip-preview)) #dialog-fields { overflow-y: auto; min-height: 0; }
dialog:has(:is(.report-trip-editor,.report-trip-preview)) :is(.dialog-header,.dialog-actions) { flex-shrink: 0; }
.trip-form-section { margin-top: 19px; }
.trip-cash-note { margin-top: 8px; }
.trip-form-section h3 { font-size: 1rem; margin-bottom: 6px; }
.trip-form-section .table-scroll { border: 1px solid var(--line); border-radius: 8px; margin-top: 7px; }
.trip-cost-table { min-width: 356px; }
.trip-cost-table input { width: 67px; min-width: 0; }
.trip-cost-table tbody th { white-space: normal; }
.trip-villa { display: block; width: min(100%, 10rem); min-height: 34px; font-size: .85rem; }
.trip-villa-name { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }
.trip-cost-table input[data-include-rate] { width: 108px; text-align: right; }
.include-cost-editor { min-width: 425px; }
.trip-rates { display: grid; gap: 13px; }
.rate-options { padding: 0 16px 15px; }
.rate-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; align-items: start; }
.package-rate-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 9px; align-items: end; margin-top: 8px; }
.package-rate-row label { display: grid; gap: 5px; font-size: .875rem; font-weight: 700; min-width: 0; }
.package-rate-row input { min-width: 0; width: 100%; }
.package-rate-row .icon-btn { min-height: 41px; }
@media (max-width: 760px) {
  .rate-groups { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 520px) {
  .report-popup-total { flex-wrap: wrap; font-size: .875rem; }
}

.fixed-package-name { display: flex; align-items: center; min-height: 41px; font-size: .9rem; }

.trip-groups { display: grid; gap: 9px; }
.trip-group { min-width: 0; margin: 0; padding: 9px 11px 10px; border: 1px solid var(--line); border-radius: 8px; }
.trip-group legend { padding: 0 5px; color: var(--pine); font-size: .85rem; font-weight: 800; }
.trip-group-fields { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,.8fr) minmax(0,1fr) minmax(0,1.1fr); align-items: end; gap: 9px; }
.trip-group-fields label { display: grid; gap: 4px; min-width: 0; font-size: .85rem; font-weight: 700; }
.trip-group-fields :is(input,select) { width: 100%; min-width: 0; }
.trip-group-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 7px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.trip-group-footer strong { color: var(--ink); }
.trip-group-footer .btn { min-height: 30px; padding-inline: 9px; }
.trip-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.trip-group-heading h3 { margin-bottom: 0; }
.trip-group-heading .btn { min-height: 34px; }
@media (max-width: 520px) {
  .trip-group-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* Responsive layout and navigation refinement */
.sidebar { transition: transform .24s ease, opacity .24s ease, visibility .24s; }
.shell { min-width: 0; transition: margin-left .24s ease; }
.sidebar-collapsed .sidebar { display: flex; transform: translateX(-100%); opacity: 0; visibility: hidden; pointer-events: none; }
.btn, .nav-action, .sidebar nav a { transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
main.page-enter { animation: page-enter .22s ease-out both; }
@keyframes page-enter { from { opacity: .45; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
main, .panel, .table-scroll, #dialog-fields, .trip-form-section { min-width: 0; max-width: 100%; }
.table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
input, select { min-width: 0; max-width: 100%; }
.section-bar, .panel-heading, .topbar, .trip-group-heading { flex-wrap: wrap; }
dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
dialog > form { min-width: 0; max-width: 100%; }
@media (max-width: 650px) {
  .sidebar { position: fixed; inset: 0 0 auto; width: 100%; }
  .sidebar-collapsed .sidebar { transform: translateY(-100%); }
  .shell { padding-top: 85px; transition: padding-top .24s ease; }
  .sidebar-collapsed .shell { padding-top: 0; }
  .finance-tabs { flex-wrap: wrap; gap: 8px 15px; }
  .topbar { gap: 8px; }
  .header-right { gap: 6px; }
  .report-date-control { max-width: 100%; }
  .dialog-header, .dialog-actions, #dialog-fields { padding-inline: 12px; }
  .trip-group-heading { align-items: flex-start; }
}
@media (max-width: 380px) {
  .form-grid, .trip-detail-fields, .trip-group-fields { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .shell, .btn, .nav-action, .sidebar nav a { transition: none; }
  main.page-enter { animation: none; }
}
/* V3 adaptive layout */
:root { --rail: clamp(200px,15vw,260px); --gutter: clamp(12px,2vw,44px); }
body { min-width:0; }
.sidebar { width:var(--rail); overflow-y:auto; }
.shell { margin-left:var(--rail); }
main { width:100%; max-width:2200px; padding:clamp(12px,2vw,36px) var(--gutter) 42px; }
.topbar { padding-inline:var(--gutter); }
.metrics { grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr)); }
.metric-value { font-size:clamp(1.15rem,1.5vw,1.85rem); }
.topbar-leading,.header-right,.breadcrumb,.page-heading,.panel-heading,.filters,.dialog-actions { flex-wrap:wrap; min-width:0; }
:is(.panel,.metric,.overview-grid,.section-bar,.report-views,.trip-list-controls,.rate-groups,.trip-group-fields) > * { min-width:0; }
:is(h1,h2,h3,p,label,dd,.btn) { overflow-wrap:anywhere; }
.btn { white-space:normal; min-height:42px; }
img,canvas { max-width:100%; height:auto; }
.table-scroll { max-width:100%; min-width:0; overflow:auto; }
dialog { overflow:hidden; max-height:calc(100dvh - 24px); }
dialog > form { display:flex; flex-direction:column; max-height:calc(100dvh - 28px); }
#dialog-fields { overflow:auto; min-height:0; }
.dialog-header,.dialog-actions { flex-shrink:0; }
.dialog-actions { gap:8px; }
@media (max-width:900px) {
 .shell,.sidebar-collapsed .shell { margin-left:0; padding-top:0; }
 .sidebar { position:fixed; inset:0 auto 0 0; width:min(280px,85vw); padding:20px 14px; z-index:10; box-shadow:10px 0 30px #02061770; }
 .sidebar-collapsed .sidebar { transform:translateX(-105%); }
 .sidebar nav { display:block; margin-top:28px; }
 .sidebar nav a,.nav-action { width:100%; font-size:.9rem; min-height:44px; padding:10px; }
 .sidebar-bottom { position:static; margin-top:auto; }
 .sidebar .profile,.sidebar .brand small,.sidebar .nav-label { display:block; }
 .sidebar .profile { display:flex; }
 body:not(.sidebar-collapsed) .sidebar-toggle { position:fixed; top:12px; right:12px; z-index:11; }
 .overview-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:560px) {
 .metrics { grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr)); }
 .form-grid,.trip-detail-fields,.trip-group-fields,.rate-groups { grid-template-columns:minmax(0,1fr); }
 .report-views .btn { flex:1 1 120px; }
 .filters input { min-width:0; width:100%; }
 .dialog-actions .btn { flex:1 1 110px; }
}
@media (pointer:coarse) { .btn,.icon-btn,.nav-action { min-height:44px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:0s !important; transition-duration:0s !important; scroll-behavior:auto !important; } }

/* Glossy surfaces and intrinsic action sizing */
.sidebar { background: linear-gradient(155deg,#243451,#131d38 49%,#0d142c); }
.primary { background:linear-gradient(180deg,#4f74c4,#365cac); border-color:var(--accent-line); box-shadow:inset 0 1px 0 #ffffff55,0 2px 5px #02061740; }
.primary:hover { background:linear-gradient(180deg,#365cac,#243e80); }
.panel, .metric { border-radius: 16px; box-shadow: inset 0 1px #ffffff0d, 0 14px 28px #03071b3d; }
.panel { background: linear-gradient(155deg, #233150, var(--surface) 62%); }
.metric { background: linear-gradient(145deg, #2f4670, #1b2948 60%, #172038); }
.topbar { background: linear-gradient(180deg,#202d4bd9,#151e36e8); backdrop-filter: blur(18px); }
.page-heading {
  min-height: 112px;
  padding: clamp(15px,2.3vw,30px);
  border: 1px solid var(--line);
  border-radius: 19px;
  background:
    linear-gradient(90deg,#202b4d 0%,#202c50 43%,#1d315cb8 72%,#314d8282),
    url('rafting.jpg') right 53% / min(62%, 870px) auto no-repeat,
    #202b4d;
  box-shadow: inset 0 1px #ffffff1a, 0 12px 24px #05071c4d;
}
.page-heading p { color: #d6dfef; }
@media (max-width: 560px) {
  .page-heading { min-height: 0; background: linear-gradient(125deg,#25375b,#27396e 60%,#233967); }
}
.report-views [aria-pressed=true] { background: linear-gradient(180deg,#39598f,#293f6f); border-color: var(--accent-line); color: var(--ink); }
.trip-action-column { width:285px; }
.trip-row-actions { display:flex; justify-content:center; gap:6px; }
.trip-row-actions .btn { flex:1 0 auto; min-width:max-content; white-space:nowrap; overflow-wrap:normal; word-break:normal; padding:5px 9px; }
.rate-master { overflow:hidden; }
.rate-table { table-layout:fixed; width:100%; }
.rate-value-col { width:clamp(130px,35%,340px); }
.rate-action-col { width:64px; }
.rate-table :is(th,td) { white-space:normal; overflow-wrap:anywhere; padding:9px 14px; vertical-align:middle; }
.rate-table tbody th:not([colspan]) { background:var(--surface); color:var(--ink); font-weight:600; }
.rate-table .rate-section th { background:linear-gradient(180deg,#304c76,#20365c); color:var(--pine); }
.rate-section th>div { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.rate-table .package-rate-row { display:table-row; }
.rate-table .package-rate-row label { font-size:0; }
.rate-table .package-rate-row label input { font-size:.9rem; }
.rate-price { display:flex; align-items:center; border:1px solid var(--line); border-radius:8px; background:var(--canvas); overflow:hidden; }
.rate-price span { padding:0 8px; color:var(--muted); font-size:.8rem; flex:none; }
.rate-price input { border:0; border-left:1px solid var(--line); border-radius:0; min-width:0; width:100%; font-variant-numeric:tabular-nums; }
.rate-note { color:var(--muted); font-size:.8rem; }
.rate-master .report-save { padding:12px 16px; }
@media(max-width:760px) { .trip-action-column { width:180px; } .trip-row-actions .btn { padding:5px 4px; } }
@media(max-width:480px) { .rate-table :is(th,td) { padding:7px 5px; } .rate-action-col { width:44px; } .rate-value-col { width:43%; } .rate-price span { padding:0 4px; } .rate-price input { padding:6px 4px; } }

/* V4.1: consistent full-width layout for all report tabs. */
main#content { width: 100%; max-width: none; margin-inline: 0; padding-inline: clamp(12px, 2vw, 32px); }

/* V4.2 monthly profit */
.monthly-panel { margin-bottom:16px; }
.monthly-picker { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.monthly-picker input { width:auto; max-width:100%; }
.monthly-expenses { min-width:680px; }
.monthly-expenses input { width:100%; min-width:80px; }
.guide-body{padding:clamp(12px,2vw,24px);display:grid;gap:18px;min-width:0}.guide-panel{margin-bottom:20px}.guide-body textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:10px;font:inherit}.guide-table input{width:100%;min-width:85px}.guide-table{min-width:580px}.guide-body h3{margin:8px 0 0}.guide-body #guide-balance{font-weight:700;color:var(--pine)}.guide-body>.btn{justify-self:end}
.paper-form{max-width:100%;}.paper-form h2{text-align:center;margin:0}.paper-meta{display:grid;gap:10px;max-width:400px}.paper-meta label,.paper-names label,.paper-saldo{display:flex;gap:12px;align-items:center}.paper-meta input,.paper-names input,.paper-saldo input{flex:1;min-width:0}.paper-table{min-width:570px;table-layout:fixed}.paper-table th:first-child{width:26%}.paper-table th:nth-child(2){width:12%}.paper-table th,.paper-table td{border:1px solid var(--line)}.paper-table input{width:100%;min-width:0}.paper-names{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.paper-names section{display:grid;gap:8px;align-content:start}.paper-saldo{justify-self:center;max-width:100%}@media(max-width:600px){.paper-names{grid-template-columns:1fr}}
.simple-guide .report-table{width:100%;table-layout:auto;min-width:0}.simple-guide .report-table th,.simple-guide .report-table td{border:1px solid var(--line);padding:10px}.simple-guide .report-table thead th,.simple-detail>h3{background:linear-gradient(#304c76,#20365c);color:var(--pine)}.simple-guide .report-table tbody th{text-align:left;background:var(--surface-alt)}.simple-guide .report-table input{width:100%;min-width:0}.simple-costs td:nth-child(n+3){text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.simple-costs td:nth-child(2){width:24%}.simple-detail{border:1px solid var(--line);border-radius:10px;padding:12px;display:grid;gap:12px}.simple-detail>h3{margin:0;padding:10px;border-radius:6px;text-align:center}.simple-name-row{display:flex;gap:8px;margin-bottom:8px}.simple-name-row input{flex:1;min-width:0}@media(max-width:480px){.simple-guide .report-table th,.simple-guide .report-table td{padding:5px;font-size:.8rem}.simple-guide .report-table input{padding:5px}}

/* V4.9: aligned guide cost columns */
.simple-guide .simple-costs {table-layout:fixed; min-width:0;}
.simple-guide .simple-costs caption {caption-side:top; text-align:left; padding:12px; font-weight:700; color:var(--pine); background:linear-gradient(#304c76,#20365c); border:1px solid var(--line);}
.simple-guide .simple-costs thead th {font-weight:800; color:var(--pine); background:linear-gradient(#304c76,#20365c); text-align:center;}
.simple-guide .simple-costs thead th:first-child {text-align:left;width:32%;}
.simple-guide .simple-costs thead th:nth-child(2) {width:22%;}
.simple-guide .simple-costs thead th:nth-child(3),.simple-guide .simple-costs thead th:nth-child(4) {width:23%;}
.simple-guide .simple-costs td:nth-child(3),.simple-guide .simple-costs td:nth-child(4) {text-align:center; padding-inline:clamp(8px,1.5vw,24px);}
.simple-guide .simple-costs output {display:inline-block; min-width:0; font-weight:600; font-variant-numeric:tabular-nums;}
@media(max-width:480px){.simple-guide .simple-costs td:nth-child(n+3){padding-inline:5px;}}

/* Consistent typography, alignment and responsive reflow for report tables. */
.report-view-content, .monthly-panel { container-type: inline-size; }
.report-table, .rate-table { font-size: .875rem; line-height: 1.45; }
.report-table :is(th,td), .rate-table :is(th,td) { white-space: normal; overflow-wrap: anywhere; }
.report-table thead th, .rate-table thead th { background: var(--surface-raised); color: var(--pine); font-weight: 800; }
.report-table tbody tr:nth-child(even) > :is(th,td) { background-color: var(--surface-stripe); }
.report-table .num { min-width: 0; font-variant-numeric: tabular-nums; }
.report-table :is(input,select), .rate-table input { font-size: .875rem; }
.report-table input[type="number"], .rate-table input[type="number"] { font-variant-numeric: tabular-nums; }
.report-summary-heading time { color: var(--muted); font-size: .875rem; }
.report-matrix { overflow: auto; }
.report-matrix:focus-visible { outline-offset: -3px; }
.report-scroll-hint { display: none; margin: 0 12px 8px; color: var(--muted); font-size: .8125rem; }
.report-matrix .report-table { table-layout: fixed; font-size: clamp(.6875rem, .95cqi, .875rem); }
.report-matrix :is(th,td) { padding: 8px clamp(4px, .37cqi, 10px); }
.report-matrix .report-date-link { font: inherit; color: var(--green); font-weight: 800; text-align: left; }
.report-matrix tr > :first-child { position: sticky; inset-inline-start: 0; padding-inline-start: 10px; }
.report-matrix :is(tbody,tfoot) th { z-index: 1; }
.report-matrix thead th:first-child { z-index: 3; }
.daily-totals-scroll .daily-total-table { min-width: 69rem; }
.daily-total-table thead th { background: var(--surface-hover); }
.daily-total-table small { display: block; margin-top: 2px; color: var(--muted); font-size: inherit; font-weight: 500; }
.daily-total-table :is(th,td):is(:nth-child(3),:nth-last-child(2)) { border-inline-start: 1px solid var(--line); }
.daily-total-table :is(th,td):last-child { font-weight: 800; }
.daily-total-table tfoot :is(th,td) { background: var(--surface-raised); color: var(--pine); }
.monthly-panel .monthly-profit-scroll { max-height: min(65dvh, 850px); }
.monthly-profit-scroll .monthly-profit-table { min-width: 78rem; }
.monthly-profit-table th:first-child { width: 8%; }
.monthly-profit-table thead th { background: var(--surface-raised); z-index: 2; }
.monthly-profit-table tbody tr > .monthly-result { background: var(--surface-alt); font-weight: 700; }
.monthly-profit-table tfoot :is(th,td) { background: var(--surface-raised); color: var(--pine); z-index: 2; }
.monthly-profit-table tfoot th { z-index: 3; }
@container (width < 69rem) {
  #daily-totals-heading-hint { display: block; }
}
@container (width < 78rem) {
  #monthly-profit-heading-hint { display: block; }
}
.monthly-expenses { table-layout: fixed; min-width: 0; }
.monthly-expenses input { min-width: 0; }
.monthly-expenses thead th:first-child { width: 18%; }
.monthly-expenses thead th:nth-child(2) { width: 31%; }
.monthly-expenses thead th:last-child { width: 58px; }
.simple-guide :is(.simple-guests,.simple-costs), .guide-history-table, .guide-detail-table { width: 100%; min-width: 0; table-layout: fixed; }
.simple-guide :is(.simple-guests,.simple-costs) :is(th,td) { padding: clamp(5px,1.1vw,13px); }
.simple-guide .simple-costs :is(th,td):nth-child(n+3) { text-align: right; white-space: normal; }
.simple-guide .simple-guests th:first-child { width: 33%; }
.simple-guide .simple-guests th:nth-child(2) { width: 19%; }
.guide-history-table th:last-child { width: 32%; }
.guide-history-table .badge { white-space: normal; }
.guide-row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.guide-row-actions .btn { min-height: 36px; padding-inline: 9px; }
.guide-detail-table { margin-block: 9px; }
@container (max-width: 680px) {
  .report-trip-list .trip-amount-column { width: 25%; }
  .report-trip-list .trip-action-column { width: 36%; }
  .report-trip-list :is(th,td) { padding-inline: 7px; }
  .trip-row-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; }
  .trip-row-actions .btn { min-width: 0; padding: 4px 1px; flex-direction: column; gap: 2px; font-size: .75rem; white-space: normal; }
}
@container (max-width: 560px) {
  .monthly-expenses, .monthly-expenses :is(tbody,tfoot) { display: block; }
  .monthly-expenses thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .monthly-expenses tbody tr:has(td[data-label]) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
  .monthly-expenses tbody tr:has(td[data-label]) td { padding: 0; border: 0; background: none; text-align: left; }
  .monthly-expenses td[data-label]::before, .guide-history-table td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
  .monthly-expenses tfoot tr { display: flex; justify-content: space-between; background: var(--surface-alt); }
  .monthly-expenses tfoot td:last-child { display: none; }
}
@media (max-width: 560px) {
  .trip-cost-table, .trip-summary-table { min-width: 0; table-layout: fixed; font-size: .8125rem; }
  .trip-cost-breakdown th:first-child { width: 30%; }
  .trip-cost-breakdown th:nth-child(2) { width: 18%; }
  .trip-cost-breakdown th:nth-child(3) { width: 26%; }
  .trip-cost-table :is(th,td), .trip-summary-table :is(th,td) { padding-inline: 4px; }
  .trip-summary-table th:first-child { width: 58%; }
  .trip-cost-table :is(input,input[data-include-rate],select) { width: 100%; padding-inline: 4px; min-height: 36px; font-size: .8125rem; }
  .trip-cost-table .trip-villa { padding-right: 18px; background-position: right 3px center; background-size: 12px; }
  .trip-cost-table input[type="number"], .simple-guide input[type="number"] { appearance: textfield; }
  .trip-cost-table input::-webkit-inner-spin-button, .simple-guide input::-webkit-inner-spin-button { appearance: none; }
  .guide-history-table, .guide-history-table tbody { display: block; }
  .guide-history-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .guide-history-table tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 10px 12px; border-top: 1px solid var(--line); gap: 8px; }
  .guide-history-table tbody td { padding: 0; border: 0; background: none; }
  .guide-history-table tbody td:last-child { grid-column: 1/-1; }
  .paper-meta label { display: grid; grid-template-columns: minmax(0,auto) minmax(0,1fr); gap: 8px; }
  .simple-guide .simple-costs :is(th,td) { padding-inline: 4px; }
}

.simple-guide { font-size: .875rem; line-height: 1.45; gap: 14px; }
.simple-guide h2 { font-size: 1.16rem; text-transform: none; }
.simple-guide h3 { font-size: .875rem; font-weight: 800; }
.simple-guide :is(label,input,.btn) { font-size: .875rem; }
.simple-guide .simple-detail { gap: 10px; }
.simple-detail > label { display: grid; gap: 4px; width: min(100%, 250px); font-weight: 700; }
.simple-guide .paper-names { gap: 12px; }
.simple-guide .paper-names .btn { justify-self: start; text-align: left; }
.simple-guide .paper-names h3 { margin-top: 4px; }
.simple-guide .paper-meta {
  width: 100%;
  max-width: 32rem;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 12px;
}
.simple-guide .paper-meta label { display: grid; grid-template-columns: minmax(0,1fr); gap: 5px; font-weight: 700; }
.simple-guide .paper-meta input { width: 100%; }

.guide-status-pending, .guide-status-reviewed { --status-text: var(--warning-text); --status-bg: var(--warning-bg); --status-line: #9f8a4e; --status-hover: #514426; }
.guide-status-approved { --status-text: var(--success-text); --status-bg: var(--success-bg); --status-line: #4d896a; --status-hover: #27543d; }
.guide-status-rejected { --status-text: var(--danger-text); --status-bg: var(--danger-bg); --status-line: #9a5962; --status-hover: #63343f; }
.guide-status { color: var(--status-text); background: var(--status-bg); border: 1px solid var(--status-line); }
.btn.guide-status:hover:not(:disabled) { background: var(--status-hover); }
.btn.guide-status:disabled { opacity: .53; cursor: not-allowed; }

dialog[data-variant="guide-review"] { width: min(640px, calc(100% - 24px)); }
.guide-review { display: grid; gap: 14px; font-size: .875rem; min-width: 0; }
.guide-review > .badge { justify-self: start; }
.guide-review-details {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,120px),1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.guide-review-details dt { color: var(--muted); font-size: .8125rem; }
.guide-review-details dd { margin: 2px 0 0; font-weight: 700; }
.guide-review .guide-detail-table { margin: 0; }
.guide-review .guide-detail-table :is(th,td) { padding: 6px clamp(4px,1.1vw,10px); }
.guide-review .guide-detail-table :is(th,td):is(:nth-child(2),:nth-child(3),:nth-child(4)) { text-align: right; font-variant-numeric: tabular-nums; }
.guide-review-target { display: grid; gap: 5px; font-weight: 700; }
.guide-review-note { color: var(--muted); }
.guide-form-only .shell { margin: 0; padding: 0; }
.guide-form-only main#content { max-width: 860px; margin-inline: auto; }
.guide-form-status { margin-block: 0 14px; padding: 10px 13px; border-radius: 8px; color: var(--success-text); background: var(--success-bg); }
.guide-form-status.submission-failed { color: var(--danger-text); background: var(--danger-bg); }
.guide-correction { padding: 0; }
.guide-correction .paper-meta { max-width: none; }
.guide-original summary { color: var(--green); font-weight: 700; cursor: pointer; }
.guide-original[open] summary { margin-bottom: 10px; }
.guide-original > :not(summary) + * { margin-top: 9px; }

@media (prefers-reduced-motion: no-preference) {
  dialog[data-variant="guide-review"] {
    opacity: 0;
    transform: translateY(8px) scale(.985);
    transition: opacity .18s ease, transform .18s ease, display .18s allow-discrete, overlay .18s allow-discrete;
  }
  dialog[data-variant="guide-review"][open] { opacity: 1; transform: none; }
  dialog[data-variant="guide-review"]::backdrop {
    background-color: transparent;
    transition: background-color .18s ease, display .18s allow-discrete, overlay .18s allow-discrete;
  }
  dialog[data-variant="guide-review"][open]::backdrop { background-color: var(--backdrop); }
  @starting-style {
    dialog[data-variant="guide-review"][open] { opacity: 0; transform: translateY(8px) scale(.985); }
    dialog[data-variant="guide-review"][open]::backdrop { background-color: transparent; }
  }
}

.invoice-list { table-layout: fixed; }
.invoice-list :is(th,td) { padding: 9px clamp(4px,1vw,14px); }
.invoice-list th:last-child { width: 29%; }
dialog[data-variant="invoice"] { width: min(740px,calc(100% - 24px)); }
.invoice-document { padding: clamp(12px,2vw,26px); color: #152039; background: #fff; border-radius: 10px; color-scheme: light; }
.invoice-document header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 12px; border-bottom: 2px solid #365cac; }
.invoice-document header strong { font-size: 1.12rem; }
.invoice-document header p { font-size: .8125rem; color: #4a5772; }
.invoice-document .trip-detail-fields dt { color: #4a5772; }
.invoice-document :is(.trip-detail-fields dd, .invoice-lines) { overflow-wrap: anywhere; }
.invoice-lines { margin-top: 16px; table-layout: fixed; }
.invoice-lines :is(th,td) { padding: 7px 5px; border-color: #ccd6e8; color: inherit; }
.invoice-lines thead th:first-child { width: 37%; }
.invoice-lines :is(thead,tfoot) :is(th,td) { background: #e8effc; color: #20345b; }
.invoice-lines tbody tr > :is(th,td), .invoice-lines tbody tr:nth-child(even) > :is(th,td) { background: #fff; color: #152039; }
@media (max-width: 440px) {
  .invoice-list, .invoice-lines { font-size: .75rem; }
  .invoice-list .btn { padding-inline: 5px; font-size: .75rem; }
}
@media print {
  :root:has(dialog[data-variant="invoice"][open]), body:has(dialog[data-variant="invoice"][open]) { background: #fff; }
  body:has(dialog[data-variant="invoice"][open]) > :not(#dialog) { display: none !important; }
  dialog[data-variant="invoice"][open] { position: absolute; inset: 0; width: 100%; max-width: none; max-height: none; margin: 0; border: none; box-shadow: none; background: #fff; }
  dialog[data-variant="invoice"][open]::backdrop { display: none; }
  dialog[data-variant="invoice"] :is(.dialog-header,.dialog-actions,#form-error) { display: none !important; }
  dialog[data-variant="invoice"] :is(form,#dialog-fields) { display: block; overflow: visible; max-height: none; padding: 0; }
  .invoice-document { padding: 0; }
  .invoice-lines tr { break-inside: avoid; }
}
.admin-login-panel { padding: clamp(16px,3vw,28px); max-width: 460px; margin-inline: auto; }
.admin-login-panel .form-error { margin: 0; }
