/* reports.css — professional tables + liquidation alignment */

.page-head h1{
  margin:0 0 6px 0;
  font-family: var(--font-head);
  font-weight:800;
  letter-spacing:.2px;
}

/* Report header */
.report-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:14px 0 8px 0;
}

.report-header{
  position: sticky;
  top: calc(var(--topbar-height) + var(--sticky-gap));
  z-index: 34;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(46,47,47,.08);
}

.report-title{
  font-size:22px;
  font-family: var(--font-head);
  font-weight:900;
}

.report-sub{ font-size:12px; }
.report-meta{ font-size:12px; text-align:right; }

.report-section{
  margin:16px 0 24px 0;
  break-inside: avoid;
}

.section-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}

.section-head h2{ margin:0; font-size:16px; }

/* Tables */
.report-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background: var(--c-white);
  border:1px solid var(--c-border);
  border-radius:14px;
  overflow:hidden;
}

/* Sticky header (works best when the table is inside a scrolling container,
   but still looks good normally) */
.report-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;

  text-align:left;
  font-size:12px;
  color: var(--c-text);
  background: rgba(233,236,238,.92);
  border-bottom:1px solid var(--c-border);
  padding:10px;
}

/* rows */
.report-table tbody td{
  padding:9px 10px;
  border-bottom:1px solid rgba(46,47,47,.08);
  font-size:13px;
  vertical-align: middle;
}

/* subtle zebra for readability */
.report-table tbody tr:nth-child(even) td{
  background: rgba(233,236,238,.22);
}

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

/* Hover highlight (desktop UX) */
@media (hover:hover){
  .report-table tbody tr:hover td{
    background: rgba(31,95,84,.06);
  }
}

/* ===== Professional numeric alignment (Liquidation + all reports) =====
   First 2 columns: left (date + customer)
   Rest: centered numeric with tabular figures
*/
.report-table th:nth-child(1),
.report-table td:nth-child(1),
.report-table th:nth-child(2),
.report-table td:nth-child(2){
  text-align:left;
}

.report-table th:nth-child(n+3),
.report-table td:nth-child(n+3){
  text-align:center;
  font-variant-numeric: tabular-nums;
}

/* Give numeric columns consistent breathing room */
.report-table th:nth-child(n+3),
.report-table td:nth-child(n+3){
  min-width: 76px;
}

/* Totals row styling
   Add class="is-total" on the totals <tr> in template for best result.
   If you can’t edit templates now, this still helps for any row that uses <strong>.
*/
.report-table tbody tr.is-total td{
  font-weight: 800;
  background: rgba(31,95,84,.08) !important;
  border-top: 1px solid rgba(31,95,84,.22);
}

/* If totals are rendered with <strong> only */
.report-table tbody tr td strong{
  font-weight: 800;
}

/* Optional: “Tour totals” label looks aligned and premium */
.report-table tbody tr.is-total td:first-child,
.report-table tbody tr.is-total td:nth-child(2){
  color: var(--c-text);
}

/* Report groups UI */
.report-group{ margin-top:28px; }

.report-group h3{
  font-size:18px;
  margin-bottom:10px;
  color: var(--c-text);
  display:flex;
  align-items:center;
  gap:8px;
}

/* Excursions grouping rows */
.report-table tbody tr.is-subtotal td{
  background: rgba(233,236,238,.55);
  border-bottom: 1px solid rgba(46,47,47,.10);
  font-size: 12px;
}
.report-table tbody tr.is-subtotal td strong{ font-weight: 800; }

/* AllTours module */
.report-card-stack{ display:flex; flex-direction:column; gap:14px; }
.alltours-intro{ display:flex; justify-content:space-between; gap:20px; align-items:flex-start; }
.allTours-tiles .tile-rich{ flex-direction:column; align-items:flex-start; gap:8px; min-height:130px; }
.filters-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
  align-items:end;
}
.filters-grid-compact{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
.filter-actions{ display:flex; gap:10px; align-items:end; flex-wrap:wrap; }
.filter-actions .btn{ text-decoration:none; display:inline-flex; align-items:center; }

.filters-footer{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  padding-top:14px;
  margin-top:14px;
  border-top:1px solid rgba(46,47,47,.08);
}

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

.filter-actions-main .btn,
.filter-export-actions .btn,
.report-tools-actions .btn,
.report-jump-controls .btn,
.section-head-actions .btn{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.filter-export-panel{
  min-width: 320px;
  max-width: 100%;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(46,47,47,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(233,236,238,.36));
  display:flex;
  flex-direction:column;
  gap:10px;
}

.filter-export-head{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.filter-export-kicker,
.tools-label{
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color: var(--c-primary);
}

.filter-export-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.report-tools{
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  gap:14px;
  margin:14px 0;
  padding:14px 16px;
  border:1px solid var(--c-border);
  border-radius:16px;
  background: rgba(233,236,238,.22);
}

.report-tools-block{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.report-tools-block-jump{
  min-width: min(100%, 420px);
}

.report-jump-controls,
.report-tools-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.report-jump-controls select{
  min-width: 260px;
  max-width: 100%;
}

.btn-compact{
  padding:8px 11px;
  font-size:12px;
}

.section-head-actions{
  display:flex;
  justify-content:flex-end;
}

.section-body{
  display:block;
}

.alltours-section.is-collapsed .section-body{
  display:none;
}

.alltours-section.is-collapsed .section-head-alltours{
  margin-bottom:0;
}

.alltours-section.section-ping .section-head-alltours{
  box-shadow: 0 0 0 3px rgba(31,95,84,.12);
  border-color: rgba(31,95,84,.28);
}
.summary-grid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap:10px;
}
.summary-card{
  border:1px solid var(--c-border);
  border-radius:14px;
  padding:12px;
  background: rgba(233,236,238,.35);
  display:flex;
  flex-direction:column;
  gap:5px;
}
.summary-card strong{ font-size:18px; font-family:var(--font-head); }
.report-badges{ display:flex; gap:8px; flex-wrap:wrap; }
.badge{
  display:inline-flex;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  background: rgba(31,95,84,.10);
  color: var(--c-primary);
  font-size:12px;
  font-weight:700;
}
.badge-dark{ background: rgba(46,47,47,.10); color: var(--c-text); }
.privacy-note{
  border-radius:14px;
  border:1px solid rgba(31,95,84,.25);
  background: rgba(31,95,84,.06);
  padding:12px 14px;
  margin:14px 0;
  display:flex;
  align-items:center;
  gap:10px;
}
.section-head-rich{ align-items:flex-start; }
.section-stats{ display:flex; flex-direction:column; gap:4px; text-align:right; }
.alltours-table th:nth-child(n+1),
.alltours-table td:nth-child(n+1){ min-width:unset; }
.pickups-table td:nth-child(2),
.pickups-table th:nth-child(2){ text-align:left; }
@media (max-width: 1100px){
  .filters-grid,
  .filters-grid-compact,
  .summary-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alltours-intro{ flex-direction:column; }
  .filters-footer,
  .report-tools{
    flex-direction:column;
    align-items:flex-start;
  }

  .filter-export-panel,
  .report-tools-block,
  .report-tools-block-jump,
  .report-jump-controls select{
    width:100%;
    min-width: 0;
  }
}
@media (max-width: 700px){
  .filters-grid,
  .filters-grid-compact,
  .summary-grid{ grid-template-columns: 1fr; }

  .filter-actions-main,
  .filter-export-actions,
  .report-jump-controls,
  .report-tools-actions{
    width:100%;
  }

  .filter-actions-main .btn,
  .filter-export-actions .btn,
  .report-jump-controls .btn,
  .report-jump-controls select,
  .report-tools-actions .btn{
    width:100%;
    justify-content:center;
  }
}


/* AllTours UX: keep the global topbar sticky, but let the report header and
   filters stay in normal flow. Large sticky filter blocks cover content and
   feel broken on very long reports. */
.filters.no-print,
.report-card-stack .filters{
  position: static;
  top: auto;
  z-index: auto;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.page-header,
.report-header{
  position: static;
  top: auto;
  z-index: auto;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  border-bottom: 0;
}

.report-section,
.privacy-note,
.alert,
.empty{
  scroll-margin-top: calc(var(--topbar-height) + 18px);
}

/* ===== AllTours Phase 1 UX pack ===== */
.report-context-strip{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin:10px 0 14px;
  padding:12px 14px;
  border:1px solid var(--c-border);
  border-radius:16px;
  background: linear-gradient(180deg, rgba(233,236,238,.42), rgba(233,236,238,.2));
}

.report-context-copy{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.report-badges-tight{ gap:6px; }

.badge-warning{
  background: rgba(180, 104, 16, .10);
  color: #8f5c11;
  border: 1px solid rgba(180, 104, 16, .20);
}

.btn-soft-danger{
  background: rgba(46,47,47,.04);
}

.report-callout{
  margin-top: 4px;
  border-radius: 14px;
  border: 1px solid var(--c-border);
  padding: 12px 14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.report-callout-copy{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.report-callout-warning{
  background: rgba(180, 104, 16, .05);
  border-color: rgba(180, 104, 16, .22);
}

.section-head-alltours{
  padding: 14px 16px;
  border: 1px solid rgba(46,47,47,.10);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(233,236,238,.48), rgba(255,255,255,.92));
  margin-bottom: 10px;
  align-items: stretch;
}

.section-head-main{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.section-kicker{
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-primary);
}

.section-meta-line{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}

.section-dot{
  width:4px;
  height:4px;
  border-radius:999px;
  background: rgba(46,47,47,.28);
}

.section-head-aside{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
}

.section-stats-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap:8px;
}

.section-stats-grid > div{
  min-width: 78px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(46,47,47,.08);
  display:flex;
  flex-direction:column;
  gap:3px;
  text-align:left;
}

.section-stats-grid strong{
  font-size: 16px;
  font-family: var(--font-head);
}

.section-warning-badges{
  justify-content:flex-end;
}

.row-has-warning td{
  background-image: linear-gradient(0deg, rgba(180, 104, 16, .02), rgba(180, 104, 16, .02));
}

.cell-note{
  margin-top: 4px;
}

.inline-flag{
  display:inline-flex;
  align-items:center;
  padding:3px 7px;
  border-radius:999px;
  font-size:11px;
  line-height:1.2;
  font-weight:700;
}

.inline-flag-warning{
  background: rgba(180, 104, 16, .10);
  color: #8f5c11;
  border: 1px solid rgba(180, 104, 16, .20);
}

.empty-rich{
  display:flex;
  align-items:flex-start;
  gap:16px;
  border-style: solid;
  background: rgba(233,236,238,.18);
}

.empty-icon{
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  font-size: 22px;
  color: var(--c-primary);
  background: rgba(31,95,84,.08);
  flex: 0 0 auto;
}

.empty-copy{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.empty-copy strong{
  font-family: var(--font-head);
  font-size: 18px;
}

.empty-copy p{
  margin:0;
  max-width: 700px;
}

.empty-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width: 1100px){
  .report-context-strip,
  .report-callout,
  .section-head-alltours{
    flex-direction:column;
    align-items:flex-start;
  }

  .section-head-aside,
  .section-warning-badges{
    align-items:flex-start;
    justify-content:flex-start;
  }
}

@media (max-width: 700px){
  .section-stats-grid{
    grid-template-columns: 1fr;
    width: 100%;
  }

  .report-context-strip{
    padding: 12px;
  }

  .empty-rich{
    flex-direction:column;
  }
}


@media print{
  .alltours-section.is-collapsed .section-body{
    display:block !important;
  }
}





/* ===== AllTours phase 3 tune-up ===== */
.filters{
  padding: 14px 14px 10px;
  border: 1px solid var(--c-border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(233,236,238,.28));
}

.filters-grid label,
.filters-grid label span{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.filters-grid label{
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
}

.filters-grid input,
.filters-grid select{
  background: rgba(255,255,255,.98);
}

.filters-footer{
  align-items: stretch;
}

.filter-actions-main{
  flex: 1 1 auto;
}

.filter-export-panel{
  min-width: 280px;
  background: rgba(255,255,255,.82);
}

.report-tools{
  align-items: stretch;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(233,236,238,.34), rgba(255,255,255,.9));
}

.report-tools-block{
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(46,47,47,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
}

.report-tools-block-view{
  margin-left: 0;
}

.report-jump-controls select{
  min-width: 0;
  width: 100%;
}

.report-view-controls .btn{
  min-width: 120px;
  justify-content: center;
}

.alltours-report-page[data-view-mode="compact"] .summary-grid{
  gap: 8px;
}

.alltours-report-page[data-view-mode="compact"] .summary-card{
  padding: 10px;
}

.alltours-report-page[data-view-mode="compact"] .section-head-alltours{
  padding: 12px 14px;
}

.alltours-report-page[data-view-mode="compact"] .section-stats-grid{
  gap: 6px;
}

.alltours-report-page[data-view-mode="compact"] .report-table tbody td .cell-note{
  margin-top: 2px;
}

.alltours-report-page[data-view-mode="operational"] .col-file,
.alltours-report-page[data-view-mode="operational"] .col-route,
.alltours-report-page[data-view-mode="operational"] .col-client,
.alltours-report-page[data-view-mode="operational"] .col-status{
  display:none;
}

.alltours-report-page[data-view-mode="operational"] .report-table thead th,
.alltours-report-page[data-view-mode="operational"] .report-table tbody td{
  font-size: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.alltours-report-page[data-view-mode="operational"] .section-head-aside{
  gap: 8px;
}

@media (max-width: 1180px){
  .report-tools{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px){
  .report-tools-block{
    width: 100%;
  }
}

@media (max-width: 700px){
  .report-view-controls,
  .report-view-controls .btn,
  .report-tools-block,
  .filter-export-panel{
    width: 100%;
  }

  .report-view-controls .btn{
    min-width: 0;
  }
}
