/* Shared typography/focus contract. All colours inherit the selected application theme. */
:root { --wds-font-grid: var(--woolly-font-grid, .8125rem); --wds-font-label: var(--woolly-font-label, .8125rem); --crm-menu-font-size: var(--woolly-font-menu, .8125rem); }
.woolly-skip-link { position: fixed; inset-block-start: -200px; inset-inline-start: 12px; z-index: 2200; padding: 10px 16px; border: 2px solid var(--wds-link, #07579f); border-radius: 8px; background: var(--wds-surface, white); color: var(--wds-link, #07579f); font-weight: 600; }
.woolly-skip-link:focus { inset-block-start: 10px; }
:where(a, button, input, select, textarea, summary, [role="tab"]):focus-visible { outline: 2px solid var(--wds-link, #07579f); outline-offset: 3px; }
.crm-content-container :where(.form-text, .dashboard-section-meta, .lead-form-action-note, .crm-pagination-summary, .breadcrumb, .small) { font-size: var(--woolly-font-help, .75rem); line-height: 1.5; }
.crm-content-container :where(.form-label, .dashboard-table) { line-height: 1.45; }
.crm-content-container :where(input.form-control, select.form-select, textarea.form-control) { font-size: var(--woolly-font-control, .875rem); }
.wds-tab { min-height: 48px; }
.wds-tab-shell, .wds-tab-panels { background-color: var(--wds-tab-active-bg, var(--wds-surface)); }
.wds-tab-rail { background-color: var(--wds-tab-rail-bg, var(--wds-surface-muted)); }
.wds-tab[aria-selected="true"] { background-color: var(--wds-tab-active-bg, var(--wds-surface)); }
.crm-language-menu .small { max-width: 250px; white-space: normal; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Exact management totals are data, not decorative labels: never truncate them. */
.management-summary-grid .management-summary-card {
    align-items: flex-start;
    overflow: visible;
}
.management-summary-card > div:last-child {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}
.management-summary-card .dashboard-stat-label {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}
.management-summary-card .dashboard-stat-value {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    font-size: 1.125rem;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}
/* Fit the available content width, not the viewport. At 1440px this normally
   gives three Finance cards per row instead of six cramped/clipped totals.
   At narrow widths min(100%,...) permits one card without horizontal overflow.
   Natural wrapping also retains every separately labelled currency and N2 value. */
.finance-page .management-summary-grid,
.management-summary-grid.management-summary-grid--money {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    align-items: stretch;
}
.finance-page .management-summary-card .invoice-summary-caption {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Shared zero-result schema for lists and card views in both application layers. */
.woolly-empty-state { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:190px; padding:28px 20px; text-align:center; color:var(--crm-text); box-sizing:border-box; }
.woolly-empty-state-icon { display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:10px; color:var(--crm-primary); background:var(--crm-primary-soft,var(--crm-surface-muted)); font-size:22px; }
.woolly-empty-state .woolly-empty-state-title { margin:0; color:var(--crm-text); font-size:.875rem; font-weight:700; line-height:1.4; }
.woolly-empty-state .woolly-empty-state-description { max-width:42rem; margin:0; color:var(--crm-muted); font-size:.75rem; line-height:1.6; white-space:normal; overflow-wrap:anywhere; }
.woolly-empty-state .btn { margin-top:4px; }
.woolly-empty-state--compact { min-height:120px; padding:20px 16px; }
td.woolly-empty-table-cell { padding:0 !important; white-space:normal !important; }
@media(max-width:575px) { .woolly-empty-state { min-height:170px; padding:24px 16px; } }

/* One responsive card-view layout for every Travel CRM master. Scope this to
   catalog lists: transaction itineraries reuse package cards but are unchanged. */
[data-catalog-list] :is(.cruise-card-grid, .package-card-grid),
.itinerary-template-master .itinerary-template-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

/* Keep prices and permitted actions readable when the sidebar reduces width. */
[data-catalog-list] :is(.cruise-card-footer, .package-management-card-footer) {
    flex-wrap: wrap;
}

[data-catalog-list] .cruise-card-footer > span {
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 1199.98px) {
    [data-catalog-list] :is(.cruise-card-grid, .package-card-grid),
    .itinerary-template-master .itinerary-template-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    [data-catalog-list] :is(.cruise-card-grid, .package-card-grid),
    .itinerary-template-master .itinerary-template-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    [data-catalog-list] :is(.cruise-card-grid, .package-card-grid),
    .itinerary-template-master .itinerary-template-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
