/* Flowbite checklist phases 7–9: shared dashboard, settings, detail and map contracts. */

[data-dashboard] .portal-page-content { min-width: 0; }
[data-dashboard] .btn, [data-dashboard] a.btn { min-height: 2.75rem; }
.phase-dashboard-grid { min-width: 0; }

/* Keep dashboard information useful on a phone instead of shrinking desktop columns. */
@media (max-width: 1023px) {
  [data-dashboard] .page-header-inner { gap: .75rem; }
  [data-dashboard] .page-header .page-actions { width: 100%; }
  [data-dashboard] .page-header .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  [data-dashboard] .customer-home-layout,
  [data-dashboard] .plumber-dashboard-layout { display: block; }
  [data-dashboard] .customer-home-main,
  [data-dashboard] .customer-home-rail,
  [data-dashboard] .plumber-dashboard-main,
  [data-dashboard] .plumber-dashboard-rail { width: 100%; min-width: 0; }
  [data-dashboard] .customer-home-rail { margin-top: 1rem; }
  [data-dashboard] .customer-home-section,
  [data-dashboard] .plumber-dashboard-section { min-width: 0; }
  [data-dashboard] .customer-home-section__header,
  [data-dashboard] .plumber-dashboard-section__header { align-items: flex-start; gap: .75rem; }
  [data-dashboard] .customer-home-section__header a,
  [data-dashboard] .plumber-dashboard-section__header a { white-space: nowrap; }
  [data-dashboard] .grid[class*="xl:grid-cols"] { grid-template-columns: minmax(0, 1fr) !important; }
  [data-dashboard] .grid[class*="xl:grid-cols"] > * { min-width: 0; }
}
@media (max-width: 479px) {
  [data-dashboard] .page-header .page-actions { flex-direction: column; }
  [data-dashboard] .page-header .page-actions .btn { width: 100%; }
  [data-dashboard] .customer-home-section__header,
  [data-dashboard] .plumber-dashboard-section__header { flex-direction: column; }
  [data-dashboard] .customer-home-section__header a,
  [data-dashboard] .plumber-dashboard-section__header a { align-self: flex-start; }
  [data-dashboard] .grid.sm\:grid-cols-2 { grid-template-columns: minmax(0, 1fr); }
}

/* One settings frame for both portals. Existing plumber-only markup is mapped into it. */
[data-settings-shell="shared"] { min-width: 0; }
[data-settings-shell="shared"] .plumber-profile-nav,
[data-settings-shell="shared"] .portal-settings__navigation { background: #f8fafc; }
[data-settings-shell="shared"] .plumber-profile-section-list { min-width: 0; }
[data-settings-shell="shared"] .plumber-profile-row { min-height: 3.25rem; }
[data-settings-shell="shared"] .plumber-profile-panel,
[data-settings-shell="shared"] .plumber-profile-detail > form { min-width: 0; }
[data-settings-shell="shared"] .plumber-profile-panel__header { gap: 1rem; }
[data-settings-shell="shared"] .plumber-profile-panel__description { max-width: 62rem; }
@media (min-width: 1024px) {
  [data-settings-shell="shared"] { grid-template-columns: 15rem minmax(0, 1fr); width: min(100%, 76rem); }
  [data-settings-shell="shared"] .plumber-profile-nav { border-right: 1px solid var(--color-border); }
  [data-settings-shell="shared"] .plumber-profile-detail { min-width: 0; padding: 1.5rem; }
}
@media (min-width: 1024px) {
  #main-content [data-settings-shell="shared"] { display: grid; grid-template-columns: 15rem minmax(0, 1fr); width: min(100%, 76rem); margin-inline: auto; overflow: hidden; border: 1px solid var(--color-border); border-radius: .75rem; background: var(--color-surface); box-shadow: var(--shadow-sm); }
  #main-content [data-settings-shell="shared"] > .plumber-profile-nav { min-width: 0; padding: 1rem; border-right: 1px solid var(--color-border); }
  #main-content [data-settings-shell="shared"] > .plumber-profile-detail { min-width: 0; padding: 1.5rem; }
}
@media (max-width: 1023px) {
  [data-settings-shell="shared"] { display: block; width: 100%; border: 0; box-shadow: none; background: transparent; }
  [data-settings-shell="shared"] .plumber-profile-nav { padding: 0; border: 0; background: transparent; }
  [data-settings-shell="shared"].is-section-page .plumber-profile-nav { display: none; }
  [data-settings-shell="shared"]:not(.is-section-page) .plumber-profile-detail { display: none; }
  [data-settings-shell="shared"] .plumber-profile-section-list { display: grid; gap: .75rem; }
  [data-settings-shell="shared"] .plumber-profile-section { overflow: hidden; border: 1px solid var(--color-border); border-radius: .75rem; background: var(--color-surface); box-shadow: var(--shadow-sm); }
  [data-settings-shell="shared"] .plumber-profile-section h3 { margin: 0; padding: .65rem .9rem .35rem; }
  [data-settings-shell="shared"] .plumber-profile-row { min-height: 4.25rem; padding: .75rem .9rem; }
  [data-settings-shell="shared"] .plumber-profile-row + .plumber-profile-row { border-top: 1px solid var(--color-border); }
  [data-settings-shell="shared"] .plumber-profile-detail { padding: 0; }
  [data-settings-shell="shared"].is-section-page .plumber-profile-detail { display: block; }
  [data-settings-shell="shared"] .plumber-profile-mobile-bar { margin-bottom: .75rem; }
  [data-settings-shell="shared"] .plumber-profile-panel,
  [data-settings-shell="shared"] .plumber-profile-detail > form { border-radius: .75rem; }
  [data-settings-shell="shared"] .plumber-profile-form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .75rem; padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom)); background: var(--color-background); }
  [data-settings-shell="shared"] .plumber-profile-form-actions .btn { flex: 1 1 100%; min-height: 2.75rem; justify-content: center; }
}

/* Focused flow/detail contracts. */
[data-wizard-shell] { min-height: 100dvh; }
[data-verification-centre] .plumber-onboarding-panel,
[data-verification-centre] .plumber-onboarding-stage { min-height: 0; }
[data-verification-centre] .plumber-verification-centre__layout,
[data-verification-centre] .plumber-onboarding-panel { min-width: 0; }
[data-verification-centre] .plumber-form-section__body { min-width: 0; }
[data-detail-page], [data-job-detail-standard] { min-width: 0; }
[data-detail-page] img, [data-job-detail-standard] img { max-width: 100%; }
@media (max-width: 767px) {
  [data-detail-page] .plumber-lead-detail__hero,
  [data-job-detail-standard] .job-detail-hero { padding: 1rem; }
  [data-detail-page] .plumber-lead-detail__meta,
  [data-job-detail-standard] .job-detail-meta { flex-wrap: wrap; gap: .5rem .75rem; }
  [data-detail-page] .plumber-lead-detail__section,
  [data-job-detail-standard] .job-detail-section { padding: 1rem; }
  [data-verification-centre] .plumber-verification-centre__rail nav { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  [data-verification-centre] .plumber-verification-centre__step { min-width: 8rem; min-height: 3.5rem; }
  [data-verification-centre] .plumber-onboarding-stage { padding: 1rem; }
  [data-verification-centre] .plumber-onboarding-stage--services .plumber-form-section__body { max-height: 54vh; overflow-y: auto; overscroll-behavior: contain; }
}

/* Notification centre keeps a useful scroll surface without reserving blank gutters. */
.notification-centre__feed { min-width: 0; }
.notification-centre__feed > * { min-width: 0; overflow-wrap: anywhere; }
[data-notification-centre] .notification-centre__feed { max-height: min(66vh, 44rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.notification-feed { min-width: 0; max-height: min(66vh, 44rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.notification-empty { display: flex; min-height: 14rem; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 2rem 1rem; text-align: center; }
.notification-empty__icon { display: inline-flex; height: 3rem; width: 3rem; align-items: center; justify-content: center; border-radius: 999px; background: #eff6ff; color: #2563eb; }
.notification-empty__title { margin: 0; color: var(--color-text-primary); font-size: .95rem; font-weight: 700; }
.notification-empty__description { max-width: 28rem; margin: 0 0 .6rem; color: var(--color-text-secondary); font-size: .8125rem; }
.app-notification-popover__header { align-items: flex-start; gap: .75rem; }
.app-notification-popover__mark { flex: none; min-height: 2.25rem; padding: .35rem .5rem; border-radius: var(--ui-radius); color: #2563eb; font-size: .6875rem; font-weight: 700; }
.app-notification-popover__mark:hover { background: #eff6ff; }
html.dark .app-notification-popover__mark:hover { background: rgb(30 64 175 / .25); }
html.dark .notification-empty__icon { background: rgb(30 64 175 / .3); color: #93c5fd; }

/* Shared map surface: a predictable height and a visible state/fallback on every portal. */
[data-lead-map] { width: 100%; min-height: 17rem; overflow: hidden; border-radius: .875rem; }
[data-lead-map] .leaflet-control-zoom a { min-width: 2.25rem; min-height: 2.25rem; line-height: 2.25rem; }
.map-external-fallback { position: absolute; z-index: 500; left: .75rem; top: .75rem; }
@media (max-width: 767px) { [data-lead-map] { min-height: 14rem; } }
html.dark [data-lead-map] { background: linear-gradient(135deg, #172554, #0f172a 55%, #052e16); }
