/* Digitav Portal - full UI redesign, September 2026.
   Loaded after the legacy stylesheets so it can modernise old markup without renaming pages. */
:root {
  --portal-navy: #0b1f33;
  --portal-navy-2: #102a43;
  --portal-primary: #1450a2;
  --portal-primary-strong: #0d3f84;
  --portal-primary-soft: #edf4ff;
  --portal-cyan: #1d73b5;
  --portal-bg: #f5f7fb;
  --portal-surface: #ffffff;
  --portal-surface-soft: #f8fafc;
  --portal-text: #172033;
  --portal-muted: #667085;
  --portal-muted-2: #98a2b3;
  --portal-border: #e4e9f1;
  --portal-border-strong: #d5dce7;
  --portal-success: #067647;
  --portal-success-bg: #ecfdf3;
  --portal-warning: #b54708;
  --portal-warning-bg: #fffaeb;
  --portal-danger: #b42318;
  --portal-danger-bg: #fef3f2;
  --portal-info: #175cd3;
  --portal-info-bg: #eff8ff;
  --portal-radius-sm: 8px;
  --portal-radius: 12px;
  --portal-radius-lg: 18px;
  --portal-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --portal-shadow: 0 10px 30px rgba(16, 24, 40, .08);
  --portal-sidebar-width: 264px;
}

* { box-sizing: border-box; }
html { background: var(--portal-bg); }
body, html {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  color: var(--portal-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body { background: var(--portal-bg); }
img { max-width: 100%; }
a { color: var(--portal-primary); text-decoration: none; }
a:hover { color: var(--portal-primary-strong); text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--portal-border); margin: 18px 0; }
.clear { clear: both; }
.muted { color: var(--portal-muted) !important; }

h1, h2, h3, h4 { color: var(--portal-text); letter-spacing: -.02em; line-height: 1.25; }
h1 { margin: 0 0 8px; font-size: 30px; font-weight: 760; }
h2 { margin: 24px 0 12px; font-size: 22px; font-weight: 740; }
h3 { margin: 20px 0 10px; font-size: 17px; font-weight: 720; }
p { margin: 0 0 14px; }

/* Public / non-admin header */
.head_container {
  background: var(--portal-surface) !important;
  border-bottom: 1px solid var(--portal-border);
}
.head_content {
  width: 100%;
  max-width: 1240px !important;
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent !important;
}
.portal-logo-link { display: inline-flex; align-items: center; }
.portal-logo-link img { max-height: 48px !important; width: auto; }
.portal-user-area { display: flex; align-items: center; gap: 12px; }
.portal-user-copy { text-align: right; line-height: 1.3; }
.portal-user-name { color: var(--portal-text); font-weight: 750; }
.portal-user-role { color: var(--portal-muted); font-size: 12px; }

/* Admin application shell */
.portal-admin { overflow-x: hidden; }
.portal-admin > .head_container { display: none; }
.portal-app-shell { min-height: 100vh; background: var(--portal-bg); }
.portal-sidebar {
  position: fixed;
  z-index: 1100;
  inset: 0 auto 0 0;
  width: var(--portal-sidebar-width);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0b1f33 0%, #0e2943 100%);
  color: #fff;
  box-shadow: 12px 0 34px rgba(11, 31, 51, .08);
}
.portal-sidebar-brand {
  padding: 22px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.portal-sidebar-brand a { display: block; width: 174px; }
.portal-sidebar-brand img { display: block; max-height: 48px; object-fit: contain; object-position: left center; }
.portal-brand-caption {
  margin-top: 8px;
  color: rgba(255,255,255,.58);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.portal-sidebar-user {
  margin: 14px 14px 6px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.055);
}
.portal-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #2f80ed, #1450a2);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.portal-sidebar-user-copy { min-width: 0; line-height: 1.25; }
.portal-sidebar-user-copy strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-sidebar-user-copy span { display: block; margin-top: 3px; color: rgba(255,255,255,.58); font-size: 11px; }
.portal-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 10px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.portal-nav-group { margin-top: 13px; }
.portal-nav-group-title {
  padding: 7px 11px 6px;
  color: rgba(255,255,255,.42);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.portal-nav-item,
.portal-logout {
  min-height: 42px;
  margin: 2px 0;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  color: rgba(255,255,255,.76) !important;
  font-size: 13px;
  font-weight: 630;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.portal-nav-item:hover,
.portal-logout:hover { background: rgba(255,255,255,.08); color: #fff !important; }
.portal-nav-item.is-active {
  color: #fff !important;
  background: linear-gradient(90deg, rgba(45, 127, 232, .34), rgba(45, 127, 232, .16));
  box-shadow: inset 3px 0 0 #5aa7ff;
}
.portal-nav-icon {
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.075);
  color: rgba(255,255,255,.82);
  font-size: 11px;
  font-weight: 820;
}
.portal-nav-item.is-active .portal-nav-icon { background: #2f80ed; color: #fff; }
.portal-nav-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-sidebar-footer { padding: 12px 10px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.portal-sidebar-footer .portal-logout { margin: 0; }

.portal-sidebar-scrim { display: none; }
.portal-workspace { min-height: 100vh; margin-left: var(--portal-sidebar-width); }
.portal-mobile-header { display: none; }
.global_container { width: 100%; background: transparent !important; }
.global_content,
.portal-main-content {
  position: relative;
  width: 100%;
  max-width: 1540px !important;
  min-height: 100vh !important;
  margin: 0 auto;
  padding: 34px 38px 64px !important;
  background: transparent !important;
  color: var(--portal-text) !important;
  font-size: 14px !important;
}

/* Page headers */
.portal-card-header {
  margin: 0 0 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.portal-card-header h1,
.portal-card-header h2,
.portal-card-header h3 { margin-top: 0; }
.portal-card-header h1 { margin-bottom: 7px; }
.portal-card-header h2 { margin-bottom: 5px; }
.portal-card-subtitle { max-width: 760px; margin: 0; color: var(--portal-muted); font-size: 13px; }
.portal-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; align-items: center; }
.portal-legacy-page-title {
  margin: 0 0 22px !important;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--portal-border);
  font-size: 28px !important;
  font-weight: 760 !important;
}

/* Cards and layout */
.portal-card,
.inputbox,
.userhtml {
  border: 1px solid var(--portal-border) !important;
  border-radius: var(--portal-radius) !important;
  background: var(--portal-surface) !important;
  box-shadow: var(--portal-shadow-sm);
}
.portal-card { margin-bottom: 20px; padding: 20px; }
.portal-card > .portal-card-header:last-child { margin-bottom: 0; }
.portal-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.portal-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.portal-detail-list { display: grid; gap: 8px; }

/* Dashboard */
.portal-stats {
  margin: 4px 0 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.portal-stat {
  position: relative;
  min-height: 132px;
  padding: 19px 20px;
  overflow: hidden;
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow-sm);
}
.portal-stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--portal-primary), #49a1e7);
}
.portal-stat-label { color: var(--portal-muted); font-size: 11px; font-weight: 780; letter-spacing: .055em; text-transform: uppercase; }
.portal-stat-value { margin: 8px 0 2px; color: var(--portal-navy); font-size: 31px; line-height: 1.08; font-weight: 790; letter-spacing: -.04em; }
.portal-stat-note { color: var(--portal-muted); font-size: 12px; }
.portal-calendar-card { padding: 20px; }
.portal-calendar-wrap { min-width: 0; overflow-x: auto; }
.portal-calendar-loading { min-height: 0; color: var(--portal-muted); font-size: 12px; }
.fc {
  min-width: 720px;
  padding: 8px 2px 0;
  border: 0 !important;
  background: #fff;
}
.fc .fc-toolbar-title { color: var(--portal-navy); font-size: 19px !important; font-weight: 750; }
.fc .fc-button-primary {
  border-color: var(--portal-border-strong) !important;
  background: #fff !important;
  color: var(--portal-text) !important;
  box-shadow: none !important;
  text-transform: capitalize !important;
}
.fc .fc-button-primary:hover,
.fc .fc-button-primary.fc-button-active { border-color: var(--portal-primary) !important; background: var(--portal-primary) !important; color: #fff !important; }
.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid { border-color: var(--portal-border) !important; }

.portal-calendar-event {
  height: 100%;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  border-radius: 6px;
  background: #3788d8;
  color: #fff;
  cursor: pointer;
}
.portal-calendar-event-time { font-size: 10px; line-height: 1.2; font-weight: 750; opacity: .9; white-space: nowrap; }
.portal-calendar-event-title { font-size: 12px; line-height: 1.25; font-weight: 740; overflow: hidden; text-overflow: ellipsis; }
.portal-calendar-event-compact { padding: 3px 5px; }
.portal-calendar-event-compact .portal-calendar-event-time { font-size: 9px; }
.portal-modal-heading { margin: 0 0 14px; }
.portal-modal-heading h2 { margin-bottom: 3px; }
.portal-calendar-form .inputbox { margin-bottom: 14px; }
.portal-calendar-time-box input[type="time"] { max-width: 220px; }
.portal-required { color: var(--portal-danger); }
.portal-form-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 10px; }
.portal-customer-calendar-entry {
  width: 100%;
  margin-bottom: 7px;
  padding: 8px 10px;
  box-sizing: border-box;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}
.portal-customer-calendar-title { margin: 0 0 4px !important; font-size: 12px !important; font-weight: 750; }
.portal-customer-calendar-time { margin: 4px 0 0 !important; font-size: 11px !important; }

/* Numeric / finance tables */
.portal-finance-table { min-width: 0 !important; table-layout: fixed; }
.portal-finance-table th.portal-money,
.portal-finance-table td.portal-money,
.portal-finance-table th[data-money],
.portal-finance-table td[data-money] {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.portal-finance-table .portal-total-row td {
  border-top: 1px solid var(--portal-border) !important;
  background: #f8fafc !important;
  font-weight: 800;
}

/* Buttons */
.button,
.buttonblue,
.buttongrey,
input[type="submit"].button,
button.button {
  width: auto !important;
  min-height: 38px;
  padding: 8px 14px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background-image: none !important;
  box-shadow: var(--portal-shadow-sm);
  color: var(--portal-text);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 720 !important;
  text-align: center;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.button:hover,
.buttonblue:hover,
.buttongrey:hover { transform: translateY(-1px); text-decoration: none !important; box-shadow: 0 5px 13px rgba(16, 24, 40, .10); }
.button-primary,
.buttonblue,
input[type="submit"].button-primary { background: var(--portal-primary) !important; border-color: var(--portal-primary) !important; color: #fff !important; }
.button-primary:hover,
.buttonblue:hover { background: var(--portal-primary-strong) !important; border-color: var(--portal-primary-strong) !important; color: #fff !important; }
.button-secondary,
.buttongrey { background: #fff !important; border-color: var(--portal-border-strong) !important; color: #344054 !important; }
.button-secondary:hover,
.buttongrey:hover { background: var(--portal-surface-soft) !important; border-color: #c6ceda !important; }
.button-danger { background: #fff !important; border-color: #f5c4c0 !important; color: var(--portal-danger) !important; }
.button-small { min-height: 32px; padding: 6px 10px !important; font-size: 12px; }
.button-block { width: 100% !important; }
.back_button { margin: 0 0 14px; }
.back_button button,
button.back_button { width: auto !important; }

/* Toolbars and search/filter controls */
.portal-toolbar,
.searchheader,
.stickyheaderoptions {
  margin: 0 0 16px !important;
  padding: 14px !important;
  display: flex !important;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 12px;
  border: 1px solid var(--portal-border) !important;
  border-radius: var(--portal-radius) !important;
  background: var(--portal-surface) !important;
  box-shadow: var(--portal-shadow-sm);
}
.portal-toolbar > label,
.searchheader > label { display: grid; gap: 5px; color: var(--portal-muted); font-size: 11px; font-weight: 750; }
.portal-toolbar input[type="search"],
.portal-toolbar input.keyword,
.searchheader input.keyword { min-width: 240px; flex: 1 1 300px; }
.portal-check { display: inline-flex !important; grid-auto-flow: column; align-items: center; gap: 7px !important; min-height: 40px; color: var(--portal-text) !important; font-size: 13px !important; }

/* Automatically grouped legacy list filters */
.portal-legacy-toolbar {
  margin: 0 0 16px;
  padding: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 12px;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  background: #fff;
  box-shadow: var(--portal-shadow-sm);
}
.portal-filter-fragment {
  float: none !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--portal-muted);
  font-size: 12px;
}
.portal-filter-fragment .keyword { min-width: 220px; }
.portal-filter-fragment select { width: auto !important; min-width: 135px; }
.portal-filter-fragment .buttongrey { margin-left: auto; }

/* Forms */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--portal-border-strong) !important;
  border-radius: 8px !important;
  outline: none;
  background: #fff !important;
  color: var(--portal-text);
  font: inherit;
  box-shadow: 0 1px 2px rgba(16,24,40,.02);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 112px; resize: vertical; }
input:focus,
select:focus,
textarea:focus { border-color: #78a9e6 !important; box-shadow: 0 0 0 3px rgba(20, 80, 162, .10); }
input[type="checkbox"],
input[type="radio"] { accent-color: var(--portal-primary); }
::placeholder { color: var(--portal-muted-2) !important; opacity: 1; }

.inputbox {
  width: 100%;
  margin: 0 0 18px !important;
  padding: 20px !important;
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
  gap: 12px 18px;
  color: var(--portal-text) !important;
}
.inputbox > .c1,
.inputbox > .c2 {
  float: none !important;
  width: auto !important;
  min-width: 0;
  padding: 5px 0 !important;
}
.inputbox > .c1 { align-self: center; color: #344054; font-size: 12px; font-weight: 730; }
.inputbox > .c2 { align-self: center; }
.inputbox > .clear { display: none; }
.inputbox > h2,
.inputbox > h3,
.inputbox > p,
.inputbox > table,
.inputbox > .portal-table-scroll { grid-column: 1 / -1; }
.c3, .c4 { box-sizing: border-box; padding: 5px; }
.field-help { margin-top: 5px; color: var(--portal-muted); font-size: 11px; }

/* Alerts */
.alert,
.fetch_mess_box {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  background: #fff;
  color: var(--portal-text);
  font-weight: 600;
}
.alert-success { border-color: #abefc6; background: var(--portal-success-bg); color: var(--portal-success); }
.alert-warning { border-color: #fedf89; background: var(--portal-warning-bg); color: var(--portal-warning); }
.alert-error { border-color: #fecdca; background: var(--portal-danger-bg); color: var(--portal-danger); }

/* Tables / lists */
.portal-table-wrap,
.portal-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--portal-border);
  border-radius: 11px;
  background: #fff;
}
.portal-card > .portal-table-wrap,
.portal-card > .portal-table-scroll,
.userhtml > .portal-table-scroll { border-left: 0; border-right: 0; border-bottom: 0; border-radius: 0 0 11px 11px; }
.portal-table,
.portal-auto-table {
  width: 100% !important;
  min-width: 680px;
  border: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: #fff !important;
  color: var(--portal-text);
  font-size: 13px !important;
}
.portal-table th,
.portal-auto-table th,
.portal-table thead td,
.portal-auto-table .portal-table-header-row > td {
  padding: 11px 13px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--portal-border) !important;
  background: #f8fafc !important;
  color: #475467 !important;
  font-size: 10px !important;
  line-height: 1.3;
  font-weight: 800 !important;
  letter-spacing: .055em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.portal-table td,
.portal-auto-table td {
  padding: 12px 13px !important;
  border: 0 !important;
  border-bottom: 1px solid #edf0f5 !important;
  background: #fff !important;
  color: #344054;
  vertical-align: middle;
}
.portal-table tbody tr:last-child td,
.portal-auto-table tr:last-child td { border-bottom: 0 !important; }
.portal-table tbody tr:hover td,
.portal-auto-table tr:not(.portal-table-header-row):hover td { background: #fbfdff !important; }
.portal-table a,
.portal-auto-table a { font-weight: 690; }
.portal-auto-table hr { display: none; }
.portal-separator-row { display: none !important; }
.portal-table .portal-money,
.portal-auto-table .portal-money {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.portal-row-actions { text-align: right !important; white-space: nowrap; }
.portal-row-actions a {
  margin-left: 5px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--portal-border);
  border-radius: 7px;
  background: #fff;
  color: var(--portal-primary);
  font-size: 11px;
  font-weight: 740;
}
.portal-row-actions a:hover { border-color: #b7cceb; background: var(--portal-primary-soft); }
.portal-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 760;
  white-space: nowrap;
}
.portal-status-success { background: var(--portal-success-bg); color: var(--portal-success); }
.portal-status-warning { background: var(--portal-warning-bg); color: var(--portal-warning); }
.portal-status-danger { background: var(--portal-danger-bg); color: var(--portal-danger); }
.portal-status-info { background: var(--portal-info-bg); color: var(--portal-info); }
.portal-status-muted { background: #f2f4f7; color: #475467; }
.portal-empty { padding: 34px 20px; text-align: center; color: var(--portal-muted); }
.userhtml {
  min-height: 130px;
  height: auto !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.userhtml > p { padding: 22px; margin: 0; text-align: center; color: var(--portal-muted); }

/* Legacy split-column layouts */
.c50, .c49, .c25, .c30, .c70, .c80, .c20, .c10, .col50, .col4 { box-sizing: border-box; }
.c50, .c49 { padding: 8px !important; }

/* Pagination */
.navigation_ul { margin: 16px 0 !important; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 5px; }
.navigation_ul li,
.navigation_ul li.active,
.navigation_ul li.prev,
.navigation_ul li.next {
  float: none !important;
  width: auto !important;
  min-width: 34px;
  height: 34px !important;
  margin: 0 !important;
  padding: 7px 10px !important;
  display: grid;
  place-items: center;
  border: 1px solid var(--portal-border) !important;
  border-radius: 8px;
  background: #fff !important;
  background-image: none !important;
  color: #344054;
  font-size: 12px;
}
.navigation_ul li.active { border-color: var(--portal-primary) !important; background: var(--portal-primary) !important; color: #fff; }

/* Customer/internal sub navigation - make legacy tabs usable */
.head_nav_container_sub,
.customer_nav,
.account-subnav {
  margin: 0 0 18px !important;
  padding: 5px !important;
  overflow-x: auto;
  border: 1px solid var(--portal-border) !important;
  border-radius: 10px;
  background: #fff !important;
}
.head_nav_container_sub ul,
.customer_nav ul,
.account-subnav ul { margin: 0 !important; padding: 0 !important; display: flex; gap: 4px; list-style: none; white-space: nowrap; }
.head_nav_container_sub li,
.customer_nav li,
.account-subnav li { float: none !important; background: transparent !important; border: 0 !important; }
.head_nav_container_sub a,
.customer_nav a,
.account-subnav a { display: block; padding: 8px 11px; border-radius: 7px; color: #475467 !important; font-size: 12px; font-weight: 680; }
.head_nav_container_sub a:hover,
.customer_nav a:hover,
.account-subnav a:hover { background: var(--portal-primary-soft); color: var(--portal-primary) !important; }

/* Pipeline */
.pipeline_div {
  margin: 0 10px 16px 0 !important;
  padding: 12px !important;
  border: 1px solid var(--portal-border) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: var(--portal-shadow-sm);
}

/* Modal / overlays */
.blanket {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1600 !important;
  display: none;
  background: rgba(15, 23, 42, .52) !important;
  opacity: 1 !important;
  backdrop-filter: blur(3px);
}
.content_html {
  position: fixed !important;
  z-index: 1610 !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  width: min(860px, calc(100vw - 30px)) !important;
  max-height: calc(100vh - 40px);
  margin: 0 !important;
  padding: 22px !important;
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .30);
}

/* Login */
.login-page-wrap { min-height: calc(100vh - 73px) !important; padding: 28px 16px; display: grid; place-items: center; }
.home-login { width: 100%; max-width: 430px !important; margin: 0 auto !important; box-shadow: none !important; }
.login-box-modern {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  padding: 30px !important;
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(16,24,40,.10) !important;
}
.login-box-modern h1 { margin: 10px 0 5px; text-align: center; font-size: 25px; }
.login-box-modern .login-intro { margin: 0 0 22px; text-align: center; color: var(--portal-muted); }
.login-box-modern label { display: block; margin: 13px 0 6px; color: #344054; font-size: 12px; font-weight: 720; }
.login-brand-mark { width: 46px; height: 46px; margin: 0 auto; display: grid; place-items: center; border-radius: 13px; background: var(--portal-primary); color: #fff; font-size: 22px; font-weight: 850; }

/* Existing event/ticket page custom UI: blend with main system */
.etl-filter-card, .etl-report-card, .etl-modal-card { border-color: var(--portal-border) !important; border-radius: var(--portal-radius) !important; box-shadow: var(--portal-shadow-sm) !important; }

@media (max-width: 1180px) {
  .global_content, .portal-main-content { padding: 28px 24px 54px !important; }
  .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline_div { width: calc(50% - 10px) !important; }
}

@media (max-width: 900px) {
  .portal-sidebar {
    width: min(310px, 86vw);
    transform: translateX(-104%);
    visibility: hidden;
    box-shadow: none;
    transition: transform .22s ease, visibility .22s ease;
  }
  body.portal-sidebar-open .portal-sidebar { transform: translateX(0); visibility: visible; box-shadow: 18px 0 50px rgba(11,31,51,.24); }
  .portal-sidebar-scrim {
    position: fixed;
    z-index: 1090;
    inset: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    background: rgba(15,23,42,.48);
    transition: opacity .2s ease, visibility .2s ease;
  }
  body.portal-sidebar-open .portal-sidebar-scrim { visibility: visible; opacity: 1; }
  .portal-workspace { margin-left: 0; }
  .portal-mobile-header {
    position: sticky;
    z-index: 980;
    top: 0;
    min-height: 58px;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--portal-border);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(10px);
  }
  .portal-menu-button {
    min-height: 38px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--portal-border-strong);
    border-radius: 8px;
    background: #fff;
    color: var(--portal-text);
    font: inherit;
    font-weight: 720;
  }
  .portal-mobile-title { flex: 1; color: var(--portal-navy); font-weight: 780; }
  .portal-mobile-role { color: var(--portal-muted); font-size: 11px; font-weight: 700; }
  .portal-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  h1 { font-size: 25px; }
  h2 { font-size: 20px; }
  .global_content, .portal-main-content { padding: 20px 13px 40px !important; }
  .portal-card-header { flex-direction: column; align-items: stretch; }
  .portal-section-actions { justify-content: flex-start; }
  .portal-section-actions .button { flex: 1 1 auto; }
  .portal-stats, .portal-grid-2, .portal-grid-3 { grid-template-columns: 1fr; }
  .portal-stat { min-height: 112px; }
  .portal-toolbar, .searchheader, .stickyheaderoptions { align-items: stretch; }
  .portal-toolbar > *, .searchheader > * { width: 100% !important; }
  .portal-toolbar input[type="search"], .portal-toolbar input.keyword, .searchheader input.keyword { min-width: 0; }

  .inputbox { grid-template-columns: 1fr; gap: 4px; padding: 16px !important; }
  .inputbox > .c1 { padding: 8px 0 0 !important; }
  .inputbox > .c2 { padding: 0 0 6px !important; }
  .c50, .c49, .c25, .c30, .c70, .c80, .c20, .c10, .col50, .col4 { float: none !important; width: 100% !important; padding-left: 0 !important; padding-right: 0 !important; }

  /* Mobile table cards: see the refinements section at the end of this file. */
  .portal-row-actions { white-space: normal !important; }
  .portal-row-actions a { margin: 2px 5px 2px 0; }
  .pipeline_div { float: none !important; width: 100% !important; margin-right: 0 !important; }
  .fc { min-width: 650px; }
  .content_html { padding: 16px !important; }
}

@media (max-width: 460px) {
  .portal-mobile-role { display: none; }
  .portal-section-actions .button { width: 100% !important; }
}

/* Kanban pipeline */
.pipeline-board {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: start;
  gap: 14px;
  overflow: visible;
  padding: 2px 0 14px;
}
.pipeline_div {
  width: 100% !important;
  min-width: 0;
  max-width: none;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--portal-border) !important;
  border-radius: 13px !important;
  background: #f7f9fc !important;
  box-shadow: var(--portal-shadow-sm);
}
.pipeline-stage-header {
  min-height: 54px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--portal-border);
  background: #fff;
  color: var(--portal-navy);
  font-size: 13px;
  font-weight: 760;
}
.pipeline-stage-number {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--portal-primary-soft);
  color: var(--portal-primary);
  font-size: 11px;
  font-weight: 820;
}
.pipeline-stage-title { min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.pipeline-stage-count {
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
}
.pipeline-nav { overflow: visible !important; }
.pipeline-nav ul { flex-wrap: wrap !important; white-space: normal !important; }

.pipeline-stage-body.container {
  width: 100% !important;
  min-height: 220px;
  height: auto !important;
  padding: 9px !important;
  background: #f7f9fc;
}
.pipeline-card {
  margin-bottom: 8px;
  padding: 12px 12px 11px;
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.pipeline-card:hover {
  transform: translateY(-1px);
  border-color: #bfd0e8;
  box-shadow: 0 7px 18px rgba(16,24,40,.08);
}
.pipeline-card-name { color: var(--portal-navy); font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.pipeline-card-contact { margin-top: 5px; color: var(--portal-muted); font-size: 12px; overflow-wrap: anywhere; }
.pipeline-card-value { margin-top: 9px; color: var(--portal-success); font-size: 12px; font-weight: 760; }
.gu-mirror { border-radius: 10px !important; box-shadow: 0 18px 36px rgba(16,24,40,.18) !important; }

@media (max-width: 1080px) {
  .pipeline-board { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 620px) {
  .pipeline-board { grid-template-columns: 1fr; }
}

.portal-subnav {
  margin: 0 0 20px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--portal-border);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--portal-shadow-sm);
}
.portal-subnav ul { margin: 0; padding: 0; display: flex; gap: 3px; list-style: none; white-space: nowrap; }
.portal-subnav li { margin: 0; padding: 0; }
.portal-subnav a { padding: 8px 11px; display: flex; align-items: center; gap: 6px; border-radius: 8px; color: #475467; font-size: 12px; font-weight: 690; }
.portal-subnav a:hover { background: var(--portal-primary-soft); color: var(--portal-primary); }
.portal-subnav a.active, .portal-subnav a[aria-current="page"] { background: var(--portal-primary); color: #fff; }
.portal-nav-badge { min-width: 19px; height: 19px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: #f04438; color: #fff; font-size: 10px; font-weight: 800; }
.portal-subnav a.active .portal-nav-badge { background: #fff; color: var(--portal-primary); }
.clienthtml {
  min-height: 120px;
  height: auto !important;
  overflow: hidden !important;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  background: #fff;
  box-shadow: var(--portal-shadow-sm);
}

/* Detail lists and destructive actions */
.portal-detail-list { margin: 0; }
.portal-detail-list > div {
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid #edf0f5;
}
.portal-detail-list > div:last-child { border-bottom: 0; }
.portal-detail-list dt { color: var(--portal-muted); font-size: 11px; font-weight: 760; text-transform: uppercase; letter-spacing: .035em; }
.portal-detail-list dd { margin: 0; color: var(--portal-text); font-weight: 600; overflow-wrap: anywhere; }
.portal-danger-link { color: var(--portal-danger) !important; }
.portal-row-actions .portal-danger-link { border-color: #fecdca !important; background: #fff !important; color: var(--portal-danger) !important; }
.portal-row-actions .portal-danger-link:hover { background: var(--portal-danger-bg) !important; }

@media (max-width: 560px) {
  .portal-detail-list > div { grid-template-columns: 1fr; gap: 3px; }
}

/* Prospects module -------------------------------------------------------- */
.prospect-page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin:0 0 22px}.prospect-page-header h1{margin:3px 0 7px;color:var(--portal-navy);font-size:30px;line-height:1.1}.prospect-page-header p{max-width:760px;margin:0;color:var(--portal-muted);font-size:14px}.prospect-eyebrow{color:#2f80ed;font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.prospect-header-actions{display:flex;gap:9px;flex-wrap:wrap;justify-content:flex-end}.prospect-stat-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin:0 0 20px}.prospect-stat-card{display:block;padding:15px 16px;border:1px solid #e3e9f2;border-radius:12px;background:#fff;box-shadow:0 4px 16px rgba(22,43,77,.04);text-decoration:none!important}.prospect-stat-card span{display:block;color:var(--portal-muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.prospect-stat-card strong{display:block;margin-top:7px;color:var(--portal-navy);font-size:24px}.prospect-stat-card:before{content:"";display:block;width:30px;height:3px;margin-bottom:11px;border-radius:9px;background:#aab6c8}.prospect-stat-card.stage-identified:before{background:#7b8ba5}.prospect-stat-card.stage-connect:before{background:#2f80ed}.prospect-stat-card.stage-engage:before{background:#8d65d5}.prospect-stat-card.stage-qualify:before{background:#279f6a}.prospect-stat-card.stage-declined:before{background:#d65a61}.prospect-layout-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(320px,.9fr);gap:18px;margin-bottom:18px}.prospect-panel{margin-bottom:18px;padding:20px;border:1px solid #e1e8f1;border-radius:14px;background:#fff;box-shadow:0 5px 18px rgba(22,43,77,.045)}.prospect-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}.prospect-panel-head h2{margin:0 0 4px;color:var(--portal-navy);font-size:18px}.prospect-panel-head p{margin:0;color:var(--portal-muted);font-size:12px}.prospect-type-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.prospect-type-card{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px;border:1px solid #e5ebf3;border-radius:11px}.prospect-type-icon{display:flex;width:42px;height:42px;align-items:center;justify-content:center;border-radius:10px;background:#eef5ff;color:#2f80ed;font-weight:850}.prospect-type-copy h3{margin:0 0 4px;color:var(--portal-navy);font-size:14px}.prospect-muted,.prospect-type-copy .prospect-muted{color:var(--portal-muted);font-size:12px}.prospect-type-meta{display:flex;gap:10px;margin-top:6px;color:#66758a;font-size:11px}.prospect-card-actions{display:flex;flex-direction:column;gap:4px;text-align:right}.prospect-card-actions a{font-size:12px;font-weight:700}.prospect-import-list{display:flex;flex-direction:column}.prospect-import-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid #edf1f6;text-decoration:none!important}.prospect-import-row:last-child{border-bottom:0}.prospect-import-row strong,.prospect-import-row span{display:block}.prospect-import-row strong{color:var(--portal-navy);font-size:12px}.prospect-import-row span{margin-top:3px;color:var(--portal-muted);font-size:11px}.prospect-import-row time{flex:0 0 auto;color:#6e7a8c;font-size:11px}.prospect-empty{padding:22px;border:1px dashed #d9e1ec;border-radius:10px;background:#fafbfd;color:var(--portal-muted);text-align:center}.prospect-empty-large{display:flex;flex-direction:column;gap:5px;margin-top:12px}.prospect-add-type{max-width:760px}.prospect-inline-form{display:flex;gap:10px}.prospect-inline-form input{flex:1 1 auto}.prospect-form-stack{display:flex;flex-direction:column;gap:18px}.prospect-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.prospect-form-grid label{display:flex;flex-direction:column;gap:6px}.prospect-form-grid label span{color:#33455f;font-size:12px;font-weight:750}.prospect-form-grid label small{color:var(--portal-muted);font-weight:500}.prospect-file-field{grid-column:1/-1}.prospect-import-note{padding:14px 16px;border-left:3px solid #2f80ed;border-radius:8px;background:#f5f9ff}.prospect-import-note strong{display:block;color:var(--portal-navy);font-size:13px}.prospect-import-note p{margin:5px 0 0;color:#5f6e82;font-size:12px}.prospect-workflow{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.prospect-workflow>div{position:relative;min-height:84px;padding:13px;border:1px solid #e3e9f1;border-radius:10px;background:#fafbfd}.prospect-workflow>div>span{display:flex;width:24px;height:24px;align-items:center;justify-content:center;margin-bottom:8px;border-radius:50%;background:#e9eef5;color:#64738a;font-size:11px;font-weight:800}.prospect-workflow strong,.prospect-workflow small,.prospect-workflow em{display:block}.prospect-workflow strong{color:var(--portal-navy);font-size:12px}.prospect-workflow small{margin-top:4px;color:var(--portal-muted);font-size:10px;line-height:1.35}.prospect-workflow em{margin-top:5px;color:#637187;font-size:10px;font-style:normal}.prospect-workflow>div.is-complete{border-color:#b9e2cf;background:#f5fcf8}.prospect-workflow>div.is-complete>span{background:#279f6a;color:#fff}.prospect-workflow>div.is-current{box-shadow:inset 0 0 0 2px rgba(47,128,237,.18)}.prospect-workflow>div.is-declined>span{background:#f5e9eb;color:#b7474e}.prospect-workflow>div.is-declined.is-complete{border-color:#efc5c8;background:#fff7f7}.prospect-workflow>div.is-declined.is-complete>span{background:#d65a61;color:#fff}.prospect-filter-bar{display:grid;grid-template-columns:minmax(260px,1.8fr) minmax(170px,1fr) minmax(210px,1.2fr) minmax(140px,.8fr) auto;gap:9px;align-items:center;padding:13px;margin-bottom:8px;border:1px solid #e1e8f1;border-radius:12px;background:#fff}.prospect-filter-bar input,.prospect-filter-bar select{width:100%;margin:0}.prospect-ajax-status{min-height:25px;padding:2px 3px;color:var(--portal-muted);font-size:12px}.prospect-table-wrap{overflow-x:auto;border:1px solid #e1e8f1;border-radius:12px;background:#fff}.prospect-table{width:100%;border-collapse:collapse;min-width:1040px}.prospect-table th{padding:11px 13px;border-bottom:1px solid #e4eaf2;background:#f8fafc;color:#627187;font-size:10px;font-weight:800;letter-spacing:.05em;text-align:left;text-transform:uppercase}.prospect-table td{padding:13px;border-bottom:1px solid #edf1f5;color:#33455d;font-size:12px;vertical-align:middle}.prospect-table tr:last-child td{border-bottom:0}.prospect-name-link{color:var(--portal-navy)!important;font-size:13px;font-weight:800;text-decoration:none!important}.prospect-row-sub{display:block;margin-top:4px;color:var(--portal-muted);font-size:10px;font-weight:500}.prospect-stage-badge{display:inline-flex;align-items:center;min-height:24px;padding:3px 9px;border-radius:999px;background:#edf1f6;color:#526175;font-size:10px;font-weight:800}.prospect-stage-badge.stage-identified{background:#eef1f5;color:#596a82}.prospect-stage-badge.stage-connect{background:#eaf3ff;color:#236dbd}.prospect-stage-badge.stage-engage{background:#f2edfc;color:#744fb7}.prospect-stage-badge.stage-qualify{background:#e9f7f0;color:#237b56}.prospect-stage-badge.stage-declined{background:#fff0f1;color:#b3464c}.prospect-mini-progress{display:flex;gap:3px;width:84px;margin-top:7px}.prospect-mini-progress i{display:block;flex:1;height:3px;border-radius:3px;background:#e3e8ef}.prospect-mini-progress i.is-complete{background:#279f6a}.prospect-row-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.prospect-action-link,.prospect-action-button{border:0;background:none;color:#2f80ed!important;font:inherit;font-size:11px;font-weight:750;text-decoration:none!important;cursor:pointer;padding:4px}.prospect-action-button.is-danger{color:#bd4b52!important}.prospect-action-button:disabled{opacity:.45;cursor:wait}.prospect-actions-col{min-width:210px}.prospect-pagination{display:flex;justify-content:center;align-items:center;gap:5px;padding:16px}.prospect-pagination a,.prospect-pagination strong,.prospect-pagination span{display:inline-flex;min-width:31px;height:31px;align-items:center;justify-content:center;padding:0 8px;border-radius:7px;font-size:11px}.prospect-pagination a{border:1px solid #dde5ef;background:#fff;text-decoration:none!important}.prospect-pagination strong{background:#2f80ed;color:#fff}.prospect-detail-progress-panel{padding-bottom:18px}.prospect-detail-workflow>div{min-height:110px}.prospect-detail-actions{display:flex;align-items:center;gap:9px;margin-top:15px;padding-top:15px;border-top:1px solid #edf1f5}.prospect-decline-button{border-color:#e2b8bb!important;color:#b34249!important;background:#fff!important}.prospect-detail-grid{grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr)}.prospect-detail-list{margin:0}.prospect-detail-list>div{display:grid;grid-template-columns:145px 1fr;gap:12px;padding:9px 0;border-bottom:1px solid #edf1f5}.prospect-detail-list>div:last-child{border-bottom:0}.prospect-detail-list dt{color:#6b788b;font-size:11px;font-weight:700}.prospect-detail-list dd{margin:0;color:#263850;font-size:12px;overflow-wrap:anywhere}.prospect-raw-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.prospect-raw-item{min-height:74px;padding:11px;border:1px solid #e7ecf3;border-radius:9px;background:#fbfcfe;overflow-wrap:anywhere}.prospect-raw-item span,.prospect-raw-item strong{display:block}.prospect-raw-item span{margin-bottom:6px;color:#6e7b8e;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}.prospect-raw-item strong{color:#2b3d55;font-size:12px;font-weight:650;line-height:1.4}.prospect-raw-item em{color:#a0a9b6;font-style:normal;font-weight:500}.prospect-history-list{display:flex;flex-direction:column}.prospect-history-row{display:grid;grid-template-columns:12px minmax(0,1fr) 180px 130px;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid #edf1f5}.prospect-history-row:last-child{border-bottom:0}.prospect-history-dot{display:block;width:9px;height:9px;border-radius:50%;background:#8593a8}.prospect-history-dot.stage-connect{background:#2f80ed}.prospect-history-dot.stage-engage{background:#8d65d5}.prospect-history-dot.stage-qualify{background:#279f6a}.prospect-history-dot.stage-declined{background:#d65a61}.prospect-history-row strong,.prospect-history-row small{display:block}.prospect-history-row strong{color:#2b3d55;font-size:12px}.prospect-history-row small{margin-top:2px;color:var(--portal-muted);font-size:10px}.prospect-history-user,.prospect-history-row time{color:#66758a;font-size:11px}.prospect-history-row time{text-align:right}
@media(max-width:1180px){.prospect-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.prospect-raw-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.prospect-filter-bar{grid-template-columns:1fr 1fr 1fr}.prospect-search{grid-column:1/-1}}
@media(max-width:860px){.prospect-page-header{flex-direction:column}.prospect-header-actions{justify-content:flex-start}.prospect-layout-grid,.prospect-detail-grid{grid-template-columns:1fr}.prospect-type-grid{grid-template-columns:1fr}.prospect-workflow{grid-template-columns:1fr 1fr}.prospect-form-grid{grid-template-columns:1fr}.prospect-file-field{grid-column:auto}.prospect-filter-bar{grid-template-columns:1fr 1fr}.prospect-search{grid-column:1/-1}.prospect-raw-grid{grid-template-columns:1fr}.prospect-history-row{grid-template-columns:12px 1fr}.prospect-history-user,.prospect-history-row time{grid-column:2;text-align:left}.prospect-inline-form{flex-direction:column}}
@media(max-width:560px){.prospect-stat-grid{grid-template-columns:1fr 1fr}.prospect-filter-bar{grid-template-columns:1fr}.prospect-workflow{grid-template-columns:1fr}.prospect-detail-list>div{grid-template-columns:1fr;gap:3px}}

/* Prospects follow-up UI - 2026-10-01 */
.prospect-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:38px;padding:9px 15px;border:1px solid transparent;border-radius:9px;font-size:12px;font-weight:800;line-height:1.2;text-decoration:none!important;cursor:pointer;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease,transform .15s ease;white-space:nowrap}.prospect-btn:hover{transform:translateY(-1px);text-decoration:none!important}.prospect-btn:disabled{opacity:.5;cursor:wait;transform:none}.prospect-btn-primary{background:#2f80ed!important;border-color:#2f80ed!important;color:#fff!important;box-shadow:0 4px 10px rgba(47,128,237,.18)}.prospect-btn-primary:hover{background:#246fcf!important;border-color:#246fcf!important;color:#fff!important}.prospect-btn-secondary{background:#fff!important;border-color:#ccd7e5!important;color:#314761!important}.prospect-btn-secondary:hover{background:#f6f9fc!important;border-color:#aebdd0!important;color:#20364f!important}.prospect-btn-danger{background:#fff!important;border-color:#e6b5b9!important;color:#b74049!important}.prospect-btn-danger:hover{background:#fff5f5!important;border-color:#d99196!important;color:#9e333b!important}.prospect-btn-large{align-self:flex-start;min-height:44px;padding:11px 19px;font-size:13px}

.prospect-type-overview-list{display:flex;flex-direction:column;gap:18px;margin-bottom:20px}.prospect-type-overview-card{padding:22px;border:1px solid #dfe7f1;border-radius:15px;background:#fff;box-shadow:0 6px 20px rgba(22,43,77,.05)}.prospect-type-overview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.prospect-type-heading{display:flex;align-items:center;gap:14px;min-width:0}.prospect-type-heading h1,.prospect-type-heading h2{margin:2px 0 4px;color:var(--portal-navy);font-size:24px;line-height:1.15}.prospect-type-heading p{margin:0;color:var(--portal-muted);font-size:11px}.prospect-type-icon-large{flex:0 0 50px;width:50px;height:50px;border-radius:12px;font-size:18px}.prospect-type-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.prospect-type-stat-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:9px;margin-top:19px}.prospect-type-stat-grid>div{min-height:72px;padding:12px;border:1px solid #e7ecf3;border-radius:10px;background:#fafcfe}.prospect-type-stat-grid span,.prospect-type-stat-grid strong{display:block}.prospect-type-stat-grid span{color:#6b788b;font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.035em}.prospect-type-stat-grid strong{margin-top:7px;color:var(--portal-navy);font-size:20px}.prospect-type-source-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:14px;border-top:1px solid #edf1f5}.prospect-type-source-row strong,.prospect-type-source-row span{display:block}.prospect-type-source-row strong{color:#32465f;font-size:11px}.prospect-type-source-row span{margin-top:3px;color:var(--portal-muted);font-size:11px}.prospect-text-action{color:#2f80ed!important;font-size:11px;font-weight:800;text-decoration:none!important}.prospect-rename-box{margin-top:13px;padding-top:12px;border-top:1px solid #edf1f5}.prospect-rename-box summary{width:max-content;color:#53647a;font-size:11px;font-weight:750;cursor:pointer}.prospect-rename-form{display:flex;gap:8px;max-width:620px;margin-top:10px}.prospect-rename-form input{flex:1 1 auto;margin:0}

.prospect-list-header{margin-bottom:14px}.prospect-filter-bar.prospect-filter-bar-type{grid-template-columns:minmax(250px,1.55fr) minmax(145px,.72fr) minmax(150px,.75fr) minmax(220px,1fr) auto}.prospect-filter-bar.prospect-filter-bar-type .prospect-search{grid-column:auto}.prospect-stage-badge.stage-imported{background:#f3f5f8;color:#66758a}.prospect-provider-table{min-width:1260px}.prospect-provider-table .prospect-actions-col{min-width:290px}.prospect-row-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.prospect-row-btn{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:7px 11px;border:1px solid transparent;border-radius:8px;font-size:10px;font-weight:800;line-height:1;text-decoration:none!important;cursor:pointer;white-space:nowrap;transition:background .15s ease,border-color .15s ease,transform .15s ease}.prospect-row-btn:hover{transform:translateY(-1px);text-decoration:none!important}.prospect-row-btn:disabled{opacity:.45;cursor:wait;transform:none}.prospect-row-btn-view{border-color:#d4deea;background:#fff;color:#3d536d!important}.prospect-row-btn-view:hover{border-color:#b6c5d7;background:#f7f9fc;color:#263e58!important}.prospect-row-btn-primary{border-color:#2f80ed;background:#2f80ed;color:#fff!important;box-shadow:0 3px 8px rgba(47,128,237,.14)}.prospect-row-btn-primary:hover{border-color:#246fcf;background:#246fcf;color:#fff!important}.prospect-row-btn-danger{border-color:#e2b8bc;background:#fff6f6;color:#ae3f47!important}.prospect-row-btn-danger:hover{border-color:#d79297;background:#ffeded;color:#963239!important}
.prospect-priority-badge,.prospect-cqc-badge{display:inline-flex;align-items:center;min-height:25px;padding:4px 9px;border:1px solid #dce4ee;border-radius:999px;background:#f7f9fc;color:#455a73;font-size:10px;font-weight:850;line-height:1.15;white-space:nowrap}.prospect-priority-badge.priority-high{border-color:#acd8bf;background:#eefaf3;color:#20764c}.prospect-priority-badge.priority-medium{border-color:#f0d8a7;background:#fff9eb;color:#8a6420}.prospect-priority-badge.priority-low{border-color:#d8dfe9;background:#f5f7fa;color:#68778a}.prospect-cqc-badge.cqc-outstanding{border-color:#9fd1b6;background:#eaf8f0;color:#166b42}.prospect-cqc-badge.cqc-good{border-color:#b6dbc7;background:#f0faf4;color:#26704c}.prospect-cqc-badge.cqc-requires-improvement{border-color:#efd59c;background:#fff8e8;color:#8b661e}.prospect-cqc-badge.cqc-inadequate{border-color:#e8b4b8;background:#fff1f2;color:#a13b44}.prospect-cqc-badge.cqc-other{background:#f5f7fa;color:#617086}

.prospect-source-tabs{display:flex;gap:5px;overflow-x:auto;margin:0 0 12px;padding:5px;border:1px solid #dfe7f1;border-radius:11px;background:#f7f9fc}.prospect-source-tabs button{flex:0 0 auto;min-height:34px;padding:7px 13px;border:0;border-radius:7px;background:transparent;color:#5a6b80;font-size:11px;font-weight:800;cursor:pointer}.prospect-source-tabs button:hover{background:#fff;color:#2f80ed}.prospect-source-tabs button.is-active{background:#fff;color:#2f80ed;box-shadow:0 2px 7px rgba(28,48,76,.09)}.prospect-sheet-panel{padding:18px;border:1px solid #dfe7f1;border-radius:12px;background:#fff}.prospect-sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:8px}.prospect-sheet-head h2{margin:2px 0 0;color:var(--portal-navy);font-size:20px}.prospect-reference-wrap{overflow:auto;max-height:68vh;border:1px solid #e1e8f1;border-radius:10px}.prospect-reference-table{width:max-content;min-width:100%;border-collapse:collapse;background:#fff}.prospect-reference-table th{position:sticky;top:0;z-index:1;padding:10px 12px;border-right:1px solid #e4eaf2;border-bottom:1px solid #dfe6ef;background:#f7f9fc;color:#5f6e82;font-size:10px;font-weight:800;text-align:left;white-space:nowrap}.prospect-reference-table td{max-width:340px;padding:9px 12px;border-right:1px solid #edf1f5;border-bottom:1px solid #edf1f5;color:#33455d;font-size:11px;vertical-align:top;overflow-wrap:anywhere}.prospect-reference-table tr:last-child td{border-bottom:0}.prospect-reference-table th:last-child,.prospect-reference-table td:last-child{border-right:0}.prospect-inline-download{display:inline-block;margin-left:8px;color:#2f80ed!important;font-size:10px;font-weight:800;text-decoration:none!important}.prospect-attach-source-form{margin-top:14px}.prospect-attach-source-form .prospect-file-field{max-width:650px}.prospect-decline-button{border-color:#e2b8bc!important;color:#ae3f47!important;background:#fff6f6!important}

@media(max-width:1280px){.prospect-type-stat-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:900px){.prospect-type-overview-head,.prospect-type-source-row,.prospect-sheet-head{flex-direction:column;align-items:stretch}.prospect-type-actions{justify-content:flex-start}.prospect-type-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.prospect-filter-bar.prospect-filter-bar-type{grid-template-columns:1fr 1fr}.prospect-filter-bar.prospect-filter-bar-type .prospect-search{grid-column:1/-1}.prospect-rename-form{flex-direction:column}}
@media(max-width:560px){.prospect-type-stat-grid{grid-template-columns:1fr 1fr}.prospect-type-heading{align-items:flex-start}.prospect-type-actions .prospect-btn{width:100%}.prospect-filter-bar.prospect-filter-bar-type{grid-template-columns:1fr}.prospect-filter-bar.prospect-filter-bar-type .prospect-search{grid-column:auto}}

/* Prospects v4: compact provider list; avoid horizontal scrolling */
.prospect-table-wrap{overflow-x:visible}
.prospect-provider-table{min-width:0!important;width:100%;table-layout:fixed}
.prospect-provider-table th,.prospect-provider-table td{overflow-wrap:anywhere;word-break:normal}
.prospect-provider-table th:nth-child(1),.prospect-provider-table td:nth-child(1){width:9%}
.prospect-provider-table th:nth-child(2),.prospect-provider-table td:nth-child(2){width:24%}
.prospect-provider-table th:nth-child(3),.prospect-provider-table td:nth-child(3){width:12%}
.prospect-provider-table th:nth-child(4),.prospect-provider-table td:nth-child(4){width:21%}
.prospect-provider-table th:nth-child(5),.prospect-provider-table td:nth-child(5){width:16%}
.prospect-provider-table th:nth-child(6),.prospect-provider-table td:nth-child(6){width:18%}
.prospect-provider-table .prospect-actions-col{min-width:0!important}
.prospect-provider-type{margin-top:5px;font-size:10px;line-height:1.3;color:#718096}
.prospect-contact-cell{line-height:1.45}
.prospect-contact-cell a{overflow-wrap:anywhere}
.prospect-row-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;align-items:stretch}
.prospect-row-actions .prospect-row-btn{width:100%;min-width:0;min-height:34px;padding:7px 8px;white-space:normal;text-align:center;line-height:1.15}

@media(max-width:1080px){
  .prospect-provider-table thead{display:none}
  .prospect-provider-table,.prospect-provider-table tbody{display:block;width:100%}
  .prospect-provider-table tr{display:grid;grid-template-columns:100px minmax(0,1.35fr) minmax(130px,.65fr);gap:8px 14px;padding:14px 15px;border-bottom:1px solid #e7edf4}
  .prospect-provider-table tr:last-child{border-bottom:0}
  .prospect-provider-table td{display:block;width:auto!important;padding:0!important;border:0!important;min-width:0}
  .prospect-provider-table td:before{display:block;margin-bottom:4px;color:#7a8798;font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;content:attr(data-label)}
  .prospect-provider-table td:nth-child(1){grid-column:1;grid-row:1}
  .prospect-provider-table td:nth-child(2){grid-column:2;grid-row:1 / span 2}
  .prospect-provider-table td:nth-child(3){grid-column:3;grid-row:1}
  .prospect-provider-table td:nth-child(4){grid-column:2;grid-row:3}
  .prospect-provider-table td:nth-child(5){grid-column:3;grid-row:2 / span 2}
  .prospect-provider-table td:nth-child(6){grid-column:1 / -1;grid-row:4;margin-top:4px;padding-top:10px!important;border-top:1px solid #eef2f6!important}
  .prospect-row-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
}

@media(max-width:700px){
  .prospect-provider-table tr{grid-template-columns:1fr 1fr;gap:11px 14px;padding:14px}
  .prospect-provider-table td:nth-child(1){grid-column:1;grid-row:auto}
  .prospect-provider-table td:nth-child(2){grid-column:1 / -1;grid-row:auto}
  .prospect-provider-table td:nth-child(3){grid-column:2;grid-row:1}
  .prospect-provider-table td:nth-child(4){grid-column:1 / -1;grid-row:auto}
  .prospect-provider-table td:nth-child(5){grid-column:1 / -1;grid-row:auto}
  .prospect-provider-table td:nth-child(6){grid-column:1 / -1;grid-row:auto}
  .prospect-row-actions{grid-template-columns:1fr 1fr}
}

/* Prospects v5: stable responsive record grid (replaces wide/collapsing table rows) */
.prospect-record-list{
  width:100%;
  overflow:hidden;
  border:1px solid #e1e8f1;
  border-radius:12px;
  background:#fff;
}
.prospect-record-header,
.prospect-record-row{
  display:grid;
  grid-template-columns:minmax(150px,.85fr) minmax(230px,1.45fr) minmax(170px,.95fr) minmax(220px,1.15fr) minmax(165px,.85fr) minmax(220px,1fr);
  column-gap:16px;
  align-items:center;
}
.prospect-record-header{
  padding:11px 14px;
  border-bottom:1px solid #e4eaf2;
  background:#f8fafc;
  color:#627187;
  font-size:10px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.prospect-record-row{
  padding:14px;
  border-bottom:1px solid #edf1f5;
}
.prospect-record-row:last-child{border-bottom:0}
.prospect-record-cell{min-width:0;color:#33455d;font-size:12px}
.prospect-record-cell:before{display:none;content:attr(data-label)}
.prospect-record-provider .prospect-name-link{display:block;font-size:14px;line-height:1.25;overflow-wrap:anywhere}
.prospect-provider-type{display:block;margin-top:4px}
.prospect-record-contact{line-height:1.45;overflow-wrap:anywhere}
.prospect-record-contact a{overflow-wrap:anywhere;word-break:break-word}
.prospect-record-progress{align-self:center}
.prospect-record-actions{min-width:0}
.prospect-priority-badge,.prospect-cqc-badge{
  max-width:100%;
  height:auto;
  white-space:normal!important;
  overflow-wrap:anywhere;
  word-break:normal;
  line-height:1.25;
  text-align:left;
}
.prospect-record-priority .prospect-priority-badge,
.prospect-record-cqc .prospect-cqc-badge{display:inline-flex}
.prospect-row-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;align-items:stretch}
.prospect-row-actions .prospect-row-btn{width:100%;min-width:0;min-height:36px;padding:8px 9px;white-space:normal;text-align:center;line-height:1.15}
.prospect-row-actions .prospect-row-btn-danger{grid-column:1/-1}

@media(max-width:1500px){
  .prospect-record-header{display:none}
  .prospect-record-row{
    grid-template-columns:minmax(145px,.72fr) minmax(260px,1.5fr) minmax(165px,.8fr) minmax(220px,1fr);
    grid-template-areas:
      "priority provider cqc contact"
      "progress progress actions actions";
    row-gap:14px;
    align-items:start;
  }
  .prospect-record-cell:before{
    display:block;
    margin-bottom:5px;
    color:#7a8798;
    font-size:9px;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:uppercase;
  }
  .prospect-record-priority{grid-area:priority}
  .prospect-record-provider{grid-area:provider}
  .prospect-record-cqc{grid-area:cqc}
  .prospect-record-contact{grid-area:contact}
  .prospect-record-progress{grid-area:progress;padding-top:10px;border-top:1px solid #eef2f6}
  .prospect-record-actions{grid-area:actions;padding-top:10px;border-top:1px solid #eef2f6}
  .prospect-record-progress .prospect-mini-progress{width:120px}
}

@media(max-width:1050px){
  .prospect-record-row{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-areas:
      "provider provider"
      "priority cqc"
      "contact progress"
      "actions actions";
    gap:14px 18px;
  }
  .prospect-record-progress{padding-top:0;border-top:0}
  .prospect-record-actions{padding-top:12px}
}

@media(max-width:680px){
  .prospect-record-row{
    grid-template-columns:1fr;
    grid-template-areas:"provider" "priority" "cqc" "contact" "progress" "actions";
    gap:12px;
  }
  .prospect-record-progress{padding-top:0;border-top:0}
  .prospect-row-actions{grid-template-columns:1fr 1fr}
}
.prospect-record-header>div{min-width:0}
.prospect-record-list .prospect-priority-badge,
.prospect-record-list .prospect-cqc-badge{box-sizing:border-box}

/* Prospects v6: PDF selection + tracking statistics ----------------------- */
.prospect-record-header,
.prospect-record-row{
  grid-template-columns:40px minmax(125px,.7fr) minmax(220px,1.35fr) minmax(145px,.85fr) minmax(190px,1fr) minmax(150px,.8fr) minmax(190px,.95fr);
}
.prospect-record-select,.prospect-record-select-head{display:flex;align-items:center;justify-content:center}
.prospect-record-select input,.prospect-record-select-head input{width:18px;height:18px;margin:0;accent-color:#2f80ed;cursor:pointer}
.prospect-record-select input:disabled{cursor:not-allowed;opacity:.65}
.prospect-pdf-toolbar{display:grid;grid-template-columns:minmax(280px,1fr) auto auto auto;gap:12px;align-items:center;margin:12px 0 10px;padding:14px 16px;border:1px solid #d9e5f4;border-radius:12px;background:#f7faff}
.prospect-pdf-toolbar-main strong,.prospect-pdf-toolbar-main span{display:block}.prospect-pdf-toolbar-main strong{color:var(--portal-navy);font-size:13px}.prospect-pdf-toolbar-main span{margin-top:3px;color:#67768a;font-size:11px;line-height:1.4}
.prospect-select-all-filtered{display:flex;align-items:center;gap:7px;margin:0;color:#33455f;font-size:11px;font-weight:750;white-space:nowrap;cursor:pointer}.prospect-select-all-filtered input{width:18px;height:18px;margin:0;accent-color:#2f80ed}.prospect-selection-count{min-width:78px;color:#66758a;font-size:11px;font-weight:750;text-align:right}.prospect-pdf-toolbar .prospect-btn:disabled{opacity:.45;cursor:not-allowed}

.prospect-stats-filters{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:12px;margin:0 0 18px;padding:16px;border:1px solid #e1e8f1;border-radius:12px;background:#fff}.prospect-stats-filters label{display:flex;flex-direction:column;gap:5px}.prospect-stats-filters label span{color:#586a81;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.prospect-stats-filters input,.prospect-stats-filters select{width:100%;margin:0}.prospect-stats-filter-actions{display:flex;align-items:end;gap:8px}
.prospect-stats-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:18px}.prospect-stats-cards>div{padding:15px 16px;border:1px solid #e1e8f1;border-radius:12px;background:#fff;box-shadow:0 4px 15px rgba(22,43,77,.04)}.prospect-stats-cards span{display:block;color:#6a798d;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.prospect-stats-cards strong{display:block;margin-top:6px;color:var(--portal-navy);font-size:25px;line-height:1}.prospect-stats-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,.8fr);gap:18px}.prospect-table-scroll{width:100%;overflow:auto}.prospect-stats-table{width:100%;border-collapse:collapse}.prospect-stats-table th{padding:10px 11px;border-bottom:1px solid #dfe6ef;background:#f8fafc;color:#68778b;font-size:9px;font-weight:850;letter-spacing:.04em;text-align:left;text-transform:uppercase;white-space:nowrap}.prospect-stats-table td{padding:11px;border-bottom:1px solid #edf1f5;color:#33455d;font-size:11px;vertical-align:top}.prospect-stats-table tr:last-child td{border-bottom:0}.prospect-stats-table td small{display:block;margin-top:3px;color:#8793a3;font-size:9px}.prospect-stats-table code{font-size:9px;overflow-wrap:anywhere;white-space:normal}

@media(max-width:1500px){
  .prospect-record-row{
    grid-template-columns:40px minmax(135px,.65fr) minmax(240px,1.3fr) minmax(150px,.7fr) minmax(210px,1fr);
    grid-template-areas:
      "select priority provider cqc contact"
      "select progress progress actions actions";
  }
  .prospect-record-select{grid-area:select;align-self:start;padding-top:18px}
  .prospect-record-priority{grid-area:priority}.prospect-record-provider{grid-area:provider}.prospect-record-cqc{grid-area:cqc}.prospect-record-contact{grid-area:contact}.prospect-record-progress{grid-area:progress}.prospect-record-actions{grid-area:actions}
}
@media(max-width:1100px){.prospect-pdf-toolbar{grid-template-columns:1fr 1fr}.prospect-pdf-toolbar-main{grid-column:1/-1}.prospect-selection-count{text-align:left}.prospect-stats-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.prospect-stats-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.prospect-stats-grid{grid-template-columns:1fr}}
@media(max-width:1050px){
  .prospect-record-row{grid-template-columns:40px minmax(0,1fr) minmax(0,1fr);grid-template-areas:"select provider provider" ". priority cqc" ". contact progress" ". actions actions"}
  .prospect-record-select{padding-top:0;align-self:start}
}
@media(max-width:680px){
  .prospect-record-row{grid-template-columns:34px minmax(0,1fr);grid-template-areas:"select provider" ". priority" ". cqc" ". contact" ". progress" ". actions"}
  .prospect-pdf-toolbar{grid-template-columns:1fr}.prospect-pdf-toolbar-main{grid-column:auto}.prospect-selection-count{text-align:left}.prospect-select-all-filtered{white-space:normal}.prospect-stats-filters{grid-template-columns:1fr}.prospect-stats-filter-actions{align-items:center}.prospect-stats-cards{grid-template-columns:1fr 1fr}
}

/* Prospects v7: compact filters, stable record cards, PDF toolbar and stats layout */
.prospect-filter-panel{
  margin:0 0 10px;
  padding:14px;
  border:1px solid #dfe7f1;
  border-radius:14px;
  background:#fff;
  box-shadow:0 4px 16px rgba(22,43,77,.035);
}
.prospect-filter-grid{
  display:grid;
  grid-template-columns:minmax(280px,1.6fr) minmax(170px,.85fr) minmax(170px,.85fr) minmax(210px,1fr) 110px auto;
  gap:10px;
  align-items:end;
}
.prospect-filter-field{display:flex;min-width:0;flex-direction:column;gap:5px;margin:0}
.prospect-filter-field>span{color:#617188;font-size:9px;font-weight:850;letter-spacing:.055em;text-transform:uppercase}
.prospect-filter-field input,.prospect-filter-field select{width:100%;min-width:0;margin:0;height:40px}
.prospect-filter-actions{display:flex;align-items:flex-end;justify-content:flex-end;min-width:max-content}
.prospect-filter-actions .prospect-btn{min-height:40px}
.prospect-ajax-status{padding:5px 3px 10px!important;color:#6b788b!important}

.prospect-pdf-toolbar{
  display:grid!important;
  grid-template-columns:minmax(320px,1fr) auto auto auto!important;
  gap:14px!important;
  align-items:center!important;
  margin:0 0 12px!important;
  padding:16px 18px!important;
  border:1px solid #bad4f5!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,#f4f9ff 0%,#fff 70%)!important;
  box-shadow:0 5px 18px rgba(47,128,237,.07)!important;
}
.prospect-pdf-kicker{margin-bottom:3px;color:#2f80ed;font-size:9px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.prospect-pdf-toolbar-main strong{font-size:14px!important}
.prospect-pdf-toolbar-main span{max-width:760px!important;font-size:11px!important;line-height:1.45!important}
.prospect-select-all-filtered{padding:8px 10px;border:1px solid #d9e5f4;border-radius:9px;background:#fff}
.prospect-selection-count{min-width:100px!important;text-align:center!important}
.prospect-pdf-generate-button{min-width:130px}

/* Six-column desktop row: checkbox, provider+priority, CQC, contact, progress, actions. */
.prospect-record-list{
  overflow:hidden!important;
  border:1px solid #dfe7f1!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 4px 16px rgba(22,43,77,.03);
}
.prospect-record-header,
.prospect-record-row{
  display:grid!important;
  grid-template-columns:38px minmax(270px,1.55fr) minmax(155px,.72fr) minmax(210px,1fr) minmax(155px,.72fr) minmax(205px,.92fr)!important;
  column-gap:16px!important;
  align-items:center!important;
}
.prospect-record-header{
  padding:10px 14px!important;
  border-bottom:1px solid #dfe7f1!important;
  background:#f7f9fc!important;
  color:#6a788b!important;
  font-size:9px!important;
}
.prospect-record-row{
  padding:13px 14px!important;
  border-bottom:1px solid #edf1f5!important;
  background:#fff;
}
.prospect-record-row:hover{background:#fbfdff}
.prospect-record-row:last-child{border-bottom:0!important}
.prospect-record-cell{min-width:0!important;font-size:11px!important}
.prospect-record-select,.prospect-record-select-head{display:flex!important;align-items:center!important;justify-content:center!important}
.prospect-record-provider{min-width:0!important}
.prospect-record-provider .prospect-name-link{display:block!important;margin:0!important;font-size:14px!important;line-height:1.25!important;overflow-wrap:anywhere!important}
.prospect-provider-meta{display:flex;min-width:0;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px}
.prospect-provider-meta .prospect-priority-badge{max-width:145px!important;padding:4px 8px!important;font-size:9px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.prospect-provider-meta .prospect-priority-badge.is-empty{border:1px solid #e0e6ee;background:#f8fafc;color:#8793a3}
.prospect-provider-meta .prospect-provider-type{display:inline-block!important;max-width:210px;margin:0!important;color:#748195!important;font-size:10px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.prospect-record-cqc{min-width:0!important}
.prospect-record-cqc .prospect-cqc-badge{display:inline-flex!important;max-width:100%!important;padding:5px 9px!important;font-size:9px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.prospect-cqc-detail{display:block!important;max-width:100%;margin-top:5px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.prospect-record-contact{min-width:0!important;line-height:1.45!important;overflow-wrap:anywhere!important}
.prospect-record-contact a{word-break:break-word!important}
.prospect-record-progress{min-width:0!important}
.prospect-record-progress .prospect-mini-progress{width:86px!important}
.prospect-record-actions{min-width:0!important}
.prospect-row-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
.prospect-row-actions .prospect-row-btn{width:100%!important;min-width:0!important;min-height:34px!important;padding:7px 8px!important;font-size:10px!important;white-space:normal!important;line-height:1.15!important}
.prospect-row-actions .prospect-row-btn-danger{grid-column:1/-1!important}
.prospect-record-cell:before{display:none!important}

/* Tracking statistics */
.prospect-stats-filters{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:12px!important;
  margin:0 0 18px!important;
  padding:18px!important;
  border:1px solid #dfe7f1!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 5px 18px rgba(22,43,77,.04)!important;
}
.prospect-stats-filter-title{grid-column:1/-1;display:flex;align-items:baseline;gap:10px;padding-bottom:10px;border-bottom:1px solid #edf1f5}
.prospect-stats-filter-title strong{color:var(--portal-navy);font-size:13px}
.prospect-stats-filter-title span{color:#748195;font-size:10px}
.prospect-stats-filters label{display:flex!important;min-width:0;flex-direction:column!important;gap:5px!important;margin:0!important}
.prospect-stats-filters label>span{color:#617188!important;font-size:9px!important;font-weight:850!important;letter-spacing:.055em!important;text-transform:uppercase!important}
.prospect-stats-filters input,.prospect-stats-filters select{width:100%!important;min-width:0!important;height:40px!important;margin:0!important}
.prospect-stats-search{grid-column:span 2}
.prospect-stats-batch{grid-column:span 2}
.prospect-stats-filter-actions{grid-column:span 2;display:flex!important;align-items:flex-end!important;gap:8px!important;justify-content:flex-start}
.prospect-stats-filter-actions .prospect-btn{min-height:40px}
.prospect-stats-cards{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:12px!important;
  margin:0 0 18px!important;
}
.prospect-stats-cards>div{min-height:82px!important;padding:15px 16px!important;border:1px solid #dfe7f1!important;border-radius:13px!important;background:#fff!important;box-shadow:0 4px 15px rgba(22,43,77,.04)!important}
.prospect-stats-cards>div:before{content:"";display:block;width:28px;height:3px;margin-bottom:10px;border-radius:8px;background:#2f80ed}
.prospect-stats-cards span{font-size:9px!important}
.prospect-stats-cards strong{margin-top:7px!important;font-size:25px!important}
.prospect-stats-grid{display:grid!important;grid-template-columns:minmax(0,1.55fr) minmax(300px,.75fr)!important;gap:18px!important}

@media(max-width:1450px){
  .prospect-filter-grid{grid-template-columns:minmax(240px,1.4fr) minmax(150px,.8fr) minmax(150px,.8fr) minmax(190px,1fr) 100px}
  .prospect-filter-actions{grid-column:1/-1;justify-content:flex-start}
  .prospect-record-header{display:none!important}
  .prospect-record-row{
    grid-template-columns:38px minmax(280px,1.4fr) minmax(165px,.75fr) minmax(220px,1fr)!important;
    grid-template-areas:
      "select provider cqc contact"
      "select progress actions actions"!important;
    row-gap:12px!important;
    align-items:start!important;
  }
  .prospect-record-select{grid-area:select!important;align-self:start!important;padding-top:2px}
  .prospect-record-provider{grid-area:provider!important}
  .prospect-record-cqc{grid-area:cqc!important}
  .prospect-record-contact{grid-area:contact!important}
  .prospect-record-progress{grid-area:progress!important;padding-top:11px!important;border-top:1px solid #edf1f5!important}
  .prospect-record-actions{grid-area:actions!important;padding-top:11px!important;border-top:1px solid #edf1f5!important}
  .prospect-record-cell:before{display:block!important;margin-bottom:5px;color:#8793a3;font-size:8px;font-weight:850;letter-spacing:.05em;text-transform:uppercase}
  .prospect-record-select:before{display:none!important}
}
@media(max-width:1100px){
  .prospect-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .prospect-filter-search{grid-column:1/-1}
  .prospect-filter-actions{grid-column:1/-1}
  .prospect-pdf-toolbar{grid-template-columns:1fr 1fr!important}
  .prospect-pdf-toolbar-main{grid-column:1/-1}
  .prospect-selection-count{text-align:left!important}
  .prospect-record-row{
    grid-template-columns:36px minmax(0,1fr) minmax(0,1fr)!important;
    grid-template-areas:
      "select provider provider"
      ". cqc contact"
      ". progress actions"!important;
  }
  .prospect-record-progress{padding-top:0!important;border-top:0!important}
  .prospect-record-actions{padding-top:0!important;border-top:0!important}
  .prospect-stats-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .prospect-stats-search,.prospect-stats-batch,.prospect-stats-filter-actions{grid-column:1/-1}
  .prospect-stats-cards{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .prospect-stats-grid{grid-template-columns:1fr!important}
}
@media(max-width:680px){
  .prospect-filter-grid{grid-template-columns:1fr}
  .prospect-filter-search,.prospect-filter-actions{grid-column:auto}
  .prospect-filter-actions .prospect-btn{width:100%}
  .prospect-pdf-toolbar{grid-template-columns:1fr!important}
  .prospect-pdf-toolbar-main{grid-column:auto}
  .prospect-select-all-filtered{white-space:normal!important}
  .prospect-pdf-generate-button{width:100%}
  .prospect-record-row{
    grid-template-columns:32px minmax(0,1fr)!important;
    grid-template-areas:"select provider" ". cqc" ". contact" ". progress" ". actions"!important;
    gap:11px 10px!important;
  }
  .prospect-row-actions{grid-template-columns:1fr 1fr!important}
  .prospect-stats-filters{grid-template-columns:1fr!important;padding:14px!important}
  .prospect-stats-search,.prospect-stats-batch,.prospect-stats-filter-actions{grid-column:auto}
  .prospect-stats-filter-title{display:block}
  .prospect-stats-filter-title span{display:block;margin-top:3px}
  .prospect-stats-filter-actions{flex-direction:column;align-items:stretch!important}
  .prospect-stats-filter-actions .prospect-btn{width:100%}
  .prospect-stats-cards{grid-template-columns:1fr 1fr!important}
}

/* ==========================================================================
   Refinements - October 2026
   Consistent form controls, labelled filter bars, legacy column rows,
   readable text sizes and phone layouts.
   ========================================================================== */
:root {
  --portal-control-h: 42px;
  --portal-control-fs: 14px;
  --portal-label-fs: 13px;
  --portal-gutter: 16px;
  --portal-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (max-width: 900px) {
  /* 16px stops iOS Safari zooming the page when a field is tapped. */
  :root { --portal-control-h: 46px; --portal-control-fs: 16px; }
}

/* ---- Base text ---------------------------------------------------------- */
body { font-size: 14px; }
td, th { font-family: inherit !important; }
.inputbox table td, .inputbox table th { font-size: 13px; }
small, .field-help { font-size: 12px; }
.portal-legacy-page-title { overflow-wrap: anywhere; }
.portal-main-content h3 { font-size: 17px; }
.portal-main-content > h3:first-child, .portal-main-content > h2 + h3 { margin-top: 8px; }

/* ---- Form controls ------------------------------------------------------ */
input:not([type]),
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="month"], input[type="week"],
select, textarea {
  max-width: 100%;
  min-height: var(--portal-control-h);
  padding: 9px 12px;
  border: 1px solid var(--portal-border-strong) !important;
  border-radius: 9px !important;
  background-color: #fff;
  color: var(--portal-text);
  font-family: inherit;
  font-size: var(--portal-control-fs) !important;
  line-height: 1.35;
  vertical-align: middle;
}
input:not([type]) { width: 100%; outline: none; }
input[type="time"], input[type="date"], input[type="datetime-local"], input[type="month"] { width: 100%; min-width: 0; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 120px; padding: 11px 12px; line-height: 1.5; }
select[disabled], input[disabled], textarea[disabled] { background-color: var(--portal-surface-soft) !important; color: var(--portal-muted); cursor: not-allowed; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #5b95dc !important; box-shadow: 0 0 0 3px rgba(20, 80, 162, .14) !important; }

/* Single selects get one consistent chevron instead of each browser's own arrow. */
select:not([multiple]):not([size]),
select[size="1"] {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 38px !important;
  background: #fff var(--portal-select-arrow) no-repeat right 13px center / 12px 8px !important;
  text-overflow: ellipsis;
  cursor: pointer;
}
select[multiple], select[size]:not([size="1"]) { height: auto; min-height: 160px; padding: 6px !important; }
select[multiple] option, select[size]:not([size="1"]) option { padding: 6px 8px; border-radius: 6px; }

input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0 6px 0 0;
  vertical-align: -4px;
  accent-color: var(--portal-primary);
  cursor: pointer;
}
input[type="color"] { width: 52px; height: var(--portal-control-h); padding: 4px; border: 1px solid var(--portal-border-strong); border-radius: 9px; background: #fff; }
input[type="file"] {
  width: 100%;
  max-width: 100%;
  padding: 9px;
  border: 1px dashed var(--portal-border-strong);
  border-radius: 9px;
  background: var(--portal-surface-soft);
  color: var(--portal-muted);
  font: inherit;
  font-size: 14px;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--portal-border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--portal-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
/* Legacy 80px hour / minute / am-pm selects sit side by side. */
select[style*="width:80px"] { width: 96px !important; margin: 0 6px 6px 0; }
/* Legacy per-row quantity boxes that were set to 30-50px wide. */
input[style*="width:30px"], input[style*="width:50px"] { width: 72px !important; text-align: center; }

/* ---- Form rows (label / field cards) ------------------------------------ */
.inputbox { overflow-wrap: break-word; }
.inputbox > .c1 { color: #344054; font-size: var(--portal-label-fs); line-height: 1.35; font-weight: 680; }
.inputbox > .c2 { font-size: 14px; }
.inputbox > .c2 > input[type="checkbox"], .inputbox > .c2 > input[type="radio"] { margin: 7px 8px 7px 0; }
.inputbox > .c2 label { cursor: pointer; }
.inputbox > p { margin: 0 0 6px; color: var(--portal-muted); }
/* Only label/field cards use the two-column grid; other legacy boxes keep their own columns. */
.inputbox:not(:has(> .c1, > .c2)),
.inputbox:has(> .c10, > .c20, > .c25, > .c30, > .c40, > .c49, > .c50, > .c70, > .c80, > .c100) { display: flow-root; }
.inputbox:has(> .c1):not(:has(> .c10, > .c20, > .c25, > .c30, > .c40, > .c49, > .c50, > .c70, > .c80, > .c100)) > :not(.c1):not(.c2):not(.clear) { grid-column: 1 / -1; }
.inputbox > h2:first-child, .inputbox > h3:first-child { margin-top: 0; }

/* ---- Legacy column rows (c30 / c20 / c25 ... used as table rows) -------- */
.portal-row,
.portal-row-loose {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 !important;
  min-width: 0;
}
.portal-row > .clear, .portal-row-loose > .clear { display: none; }
.portal-row > div, .portal-row-loose > div {
  float: none !important;
  min-width: 0;
  padding: 6px 8px !important;
  overflow-wrap: anywhere;
}
.portal-row > div input:not([type="checkbox"]):not([type="radio"]),
.portal-row > div select,
.portal-row-loose > div input:not([type="checkbox"]):not([type="radio"]),
.portal-row-loose > div select { width: 100% !important; }
.inputbox.portal-row { margin: 0 0 8px !important; padding: 8px 10px !important; }
.inputbox.portal-row-head {
  margin-bottom: 6px !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
.portal-row-head, .portal-row-head strong, .portal-row-head b {
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.portal-row a:not(.button) { font-weight: 700; }
.portal-sep { display: none; }

/* ---- Fixed-height legacy scroll boxes ----------------------------------- */
/* One page scroll is easier than a 500-700px box scrolling inside the page. */
.portal-main-content div[style*="overflow:auto"][style*="height"],
.portal-main-content div[style*="overflow: auto"][style*="height"] {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* ---- Labelled filter bar (built from legacy float filters) -------------- */
.portal-filterbar {
  margin: 0 0 16px;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  background: #fff;
  box-shadow: var(--portal-shadow-sm);
}
.portal-filterbar-fields {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.portal-filterbar-actions { flex: 0 0 auto; margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.portal-filterbar-actions .button { min-height: var(--portal-control-h); }
.portal-field {
  flex: 1 1 170px;
  max-width: 260px;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.portal-field-search { flex: 2 1 260px; max-width: 440px; }
.portal-field-date { flex: 1 1 140px; max-width: 190px; }
.portal-field-label { color: #475467; font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-field input, .portal-field select { flex: none !important; width: 100% !important; min-width: 0 !important; height: auto; margin: 0 !important; }
.portal-field-check { align-self: flex-end; min-height: var(--portal-control-h); display: inline-flex; align-items: center; font-size: 14px; }
.portal-toolbar > label { color: #475467; font-size: 12px; }
.portal-toolbar > label > select, .portal-toolbar > label > input { min-width: 150px; }

/* ---- Desktop tables ------------------------------------------------------ */
.portal-table td, .portal-auto-table td { font-size: 13px !important; line-height: 1.45; overflow-wrap: break-word; }
.portal-table th, .portal-auto-table th,
.portal-auto-table .portal-table-header-row > td { font-size: 11px !important; }
.portal-auto-table .portal-table-header-row > td strong { font-weight: 800; }
.portal-row-actions a { min-height: 30px; font-size: 12px; }
.portal-row-actions a + a { margin-left: 6px; }

/* ---- Alerts built from legacy coloured paragraphs ----------------------- */
p.alert { font-size: 14px; }

/* ---- Public / login header ---------------------------------------------- */
/* The logo is white, so the public header uses the sidebar navy. */
.head_container { background: var(--portal-navy) !important; border-bottom: 0 !important; }
.head_content { min-height: 64px; }
.portal-logo-link img { max-height: 40px !important; }
.head_container .portal-user-name { color: #fff; }
.head_container .portal-user-role { color: rgba(255,255,255,.62); }

.login-page-wrap { min-height: 100vh !important; padding: 32px 16px !important; }
.portal-admin .login-page-wrap { max-width: none !important; }
.login-box-modern { padding: 0 !important; overflow: hidden; }
.login-box-modern .login-brand {
  padding: 26px 24px 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #0b1f33 0%, #12355a 100%);
}
.login-box-modern .login-brand img { display: block; height: 46px; width: auto; max-height: none; }
.login-box-modern .login-body { padding: 26px 28px 30px; }
.login-box-modern h1 { margin: 0 0 18px; }
.login-box-modern input[type="text"],
.login-box-modern input[type="password"] { display: block; width: 100% !important; padding: 10px 13px !important; background-color: #fff !important; }
.login-box-modern .button-block { display: flex; width: 100% !important; min-height: 46px; margin-top: 22px; font-size: 15px; }

/* ---- Modal ------------------------------------------------------------- */
.content_html .inputbox { box-shadow: none; }
.content_html h2:first-child, .content_html h3:first-child { margin-top: 0; }

/* ---- jQuery UI date picker ---------------------------------------------- */
.ui-datepicker {
  z-index: 1700 !important;
  width: 296px;
  padding: 8px;
  border: 1px solid var(--portal-border) !important;
  border-radius: 12px;
  background: #fff !important;
  box-shadow: 0 18px 40px rgba(16,24,40,.16);
  font-family: inherit !important;
  font-size: 14px !important;
}
.ui-datepicker .ui-datepicker-header { border: 0; border-radius: 8px; background: var(--portal-surface-soft); color: var(--portal-text); }
.ui-datepicker .ui-datepicker-title select { min-height: 32px; padding: 4px 26px 4px 8px !important; font-size: 14px !important; background-position: right 8px center !important; }
.ui-datepicker th { font-size: 11px; color: var(--portal-muted); }
.ui-datepicker td { padding: 1px; }
.ui-datepicker td a, .ui-datepicker td span { padding: 6px 0 !important; border-radius: 7px; text-align: center !important; }
.ui-datepicker .ui-state-default { border: 0 !important; background: transparent !important; color: var(--portal-text); font-weight: 600; }
.ui-datepicker .ui-state-hover { background: var(--portal-primary-soft) !important; }
.ui-datepicker .ui-state-active, .ui-datepicker .ui-state-highlight.ui-state-active { background: var(--portal-primary) !important; color: #fff !important; }
.ui-datepicker .ui-state-highlight { background: #eef4ff !important; color: var(--portal-primary) !important; }
.ui-timepicker-wrapper { z-index: 1700 !important; font-size: 14px; border-radius: 10px; }

/* ---- Tablet --------------------------------------------------------------- */
@media (max-width: 900px) {
  .portal-mobile-header { padding: 9px var(--portal-gutter); }
  .portal-menu-button { min-height: 42px; padding: 8px 12px; }
  .button, .buttonblue, .buttongrey, input[type="submit"].button, button.button { min-height: 44px; }
  .button-small { min-height: 38px; }
}

/* ---- Lists as cards on phones and tablets ------------------------------------ */
@media (max-width: 900px) {
  /* Lists: each row becomes a compact card with label | value lines. */
  .portal-main-content .portal-has-cards { padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
  .portal-table-scroll:has(> .portal-table-cardable),
  .portal-table-wrap:has(> .portal-table-cardable) { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .portal-auto-table.portal-table-cardable,
  .portal-table.portal-table-cardable { min-width: 0 !important; background: transparent !important; table-layout: auto; }
  .portal-auto-table.portal-table-cardable tbody,
  .portal-auto-table.portal-table-cardable tr,
  .portal-auto-table.portal-table-cardable td { display: block; width: 100% !important; }
  .portal-auto-table.portal-table-cardable .portal-table-header-row,
  .portal-auto-table.portal-table-cardable thead { display: none; }
  .portal-auto-table.portal-table-cardable tr:not(.portal-table-header-row) {
    position: relative;
    margin: 0 0 12px;
    overflow: hidden;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--portal-shadow-sm);
  }
  .portal-auto-table.portal-table-cardable td {
    position: relative;
    min-height: 40px;
    padding: 9px 14px 9px calc(38% + 8px) !important;
    border-bottom: 1px solid #eef1f5 !important;
    background: transparent !important;
    color: var(--portal-text);
    font-size: 14px !important;
    line-height: 1.4;
    text-align: left !important;
    white-space: normal !important;
  }
  .portal-auto-table.portal-table-cardable td:last-child { border-bottom: 0 !important; }
  .portal-auto-table.portal-table-cardable td::before {
    content: attr(data-label);
    position: absolute;
    top: 11px;
    left: 14px;
    width: calc(38% - 20px);
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    line-height: 1.3;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }
  .portal-auto-table.portal-table-cardable td:not([data-label])::before,
  .portal-auto-table.portal-table-cardable td[data-label=""]::before { display: none; }
  .portal-auto-table.portal-table-cardable td:not([data-label]),
  .portal-auto-table.portal-table-cardable td[data-label=""] { padding-left: 14px !important; }
  .portal-auto-table.portal-table-cardable td.portal-cell-empty { display: none; }
  .portal-auto-table.portal-table-cardable td.portal-cell-title {
    padding: 12px 14px !important;
    background: var(--portal-surface-soft) !important;
    font-size: 15px !important;
    font-weight: 700;
  }
  .portal-auto-table.portal-table-cardable td.portal-cell-title::before { position: static; display: block; width: auto; margin-bottom: 2px; font-size: 10px; }
  .portal-auto-table.portal-table-cardable tr.portal-row-selectable td.portal-cell-title { padding-right: 54px !important; }
  .portal-auto-table.portal-table-cardable td.portal-cell-select {
    position: absolute;
    z-index: 1;
    top: 6px;
    right: 6px;
    width: auto !important;
    min-height: 0;
    padding: 8px !important;
    border: 0 !important;
  }
  .portal-auto-table.portal-table-cardable td.portal-cell-select::before { display: none; }
  .portal-auto-table.portal-table-cardable td.portal-cell-select input { width: 22px; height: 22px; margin: 0; }
  .portal-auto-table.portal-table-cardable td.portal-row-actions {
    padding: 10px 14px !important;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fbfcfe !important;
  }
  .portal-auto-table.portal-table-cardable td.portal-row-actions::before { display: none; }
  .portal-auto-table.portal-table-cardable td.portal-row-actions br { display: none; }
  .portal-row-actions a, .portal-row-actions a + a { min-height: 38px; margin: 0; padding: 8px 12px; font-size: 13px; }
  .portal-auto-table.portal-table-cardable td.portal-row-actions > :not(a):not(button):not(input):not(.portal-sep):not(br) { flex-basis: 100%; color: var(--portal-muted); font-size: 12px; }
  .portal-auto-table.portal-table-cardable td .portal-status { font-size: 12px; }

}
@media (min-width: 640px) and (max-width: 900px) {
  /* Two record cards per row on tablets. */
  .portal-auto-table.portal-table-cardable tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .portal-auto-table.portal-table-cardable tr:not(.portal-table-header-row) { margin: 0; }
}

/* ---- Phones --------------------------------------------------------------- */
@media (max-width: 720px) {
  .global_content, .portal-main-content { padding: 18px var(--portal-gutter) 44px !important; }
  h1, .portal-legacy-page-title { font-size: 24px !important; }
  h2 { font-size: 20px; }
  .portal-legacy-page-title { margin-bottom: 16px !important; padding-bottom: 12px; }
  .portal-card { padding: 16px; }
  .inputbox { padding: 16px !important; margin-bottom: 14px !important; gap: 6px; }
  .inputbox > .c1 { padding: 6px 0 0 !important; }
  .inputbox > .c2 { padding: 0 0 4px !important; }
  .inputbox > .c1.portal-label-empty { display: none; }
  .portal-form-actions { flex-direction: column-reverse; }
  .portal-form-actions .button { width: 100% !important; }
  .portal-main-content form > p > input[type="submit"],
  .portal-main-content form > p > .button { width: 100% !important; }

  /* Filter bar: search full width, other filters two per row. */
  .portal-filterbar { padding: 12px; gap: 12px; }
  .portal-filterbar-fields { flex-basis: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .portal-field, .portal-field-search, .portal-field-date { max-width: none; }
  .portal-field-search { grid-column: 1 / -1; }
  .portal-filterbar-actions { width: 100%; margin-left: 0; }
  .portal-filterbar-actions .button { flex: 1 1 140px; }
  .portal-toolbar { padding: 12px !important; }

  /* Legacy column rows: two columns per line, labels shown from the header row. */
  .portal-row > .c10, .portal-row > .c20, .portal-row > .c25, .portal-row > .c30, .portal-row > .c40,
  .portal-row > .c1, .portal-row > .c2,
  .portal-row-loose > .c10, .portal-row-loose > .c20, .portal-row-loose > .c25, .portal-row-loose > .c30, .portal-row-loose > .c40,
  .portal-row-loose > .c1, .portal-row-loose > .c2 { flex: 1 1 50%; width: auto !important; }
  .portal-row > .c49, .portal-row > .c50, .portal-row > .c70, .portal-row > .c80, .portal-row > .c100,
  .portal-row-loose > .c49, .portal-row-loose > .c50, .portal-row-loose > .c70, .portal-row-loose > .c80, .portal-row-loose > .c100 { flex: 1 1 100%; width: auto !important; }
  .portal-row > .portal-col-empty, .portal-row-loose > .portal-col-empty { display: none; }
  .portal-row > .portal-col-select, .portal-row-loose > .portal-col-select { flex: 0 0 auto !important; width: auto !important; }
  .portal-row-head-labelled { display: none !important; }
  .portal-row-labelled > [data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    line-height: 1.25;
    text-transform: uppercase;
  }
  .portal-row-loose.portal-row-labelled { padding: 8px 0; border-bottom: 1px solid var(--portal-border); }
  .portal-row > div[style*="text-align:right"], .portal-row-loose > div[style*="text-align:right"] { text-align: left !important; }

  /* Customer section tabs wrap instead of hiding off screen. */
  .portal-subnav { overflow: visible; padding: 6px; }
  .portal-subnav ul { flex-wrap: wrap; white-space: normal; gap: 6px; }
  .portal-subnav li { flex: 1 1 auto; }
  .portal-subnav a { justify-content: center; min-height: 38px; padding: 8px 10px; background: var(--portal-surface-soft); font-size: 13px; }
  .portal-subnav a.active, .portal-subnav a[aria-current="page"] { background: var(--portal-primary); }

  /* Dashboard numbers two per row. */
  .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .portal-stat { min-height: 0; padding: 14px; }
  .portal-stat-value { font-size: 25px; }
  .portal-stat-label { font-size: 10px; }
  .portal-section-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .portal-section-actions .button { width: 100% !important; }
  .portal-section-actions .button-primary:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* Pop-up forms open as a bottom sheet on phones. */
  .content_html {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 20px var(--portal-gutter) 28px !important;
    transform: none;
    border-radius: 18px 18px 0 0;
  }

  .navigation_ul li, .navigation_ul li.active, .navigation_ul li.prev, .navigation_ul li.next { min-width: 40px; height: 40px !important; font-size: 13px; }
  .back_button { float: none !important; display: inline-flex; }
  .pipeline-stage-body.container { min-height: 120px; }
  .head_content { padding: 10px var(--portal-gutter); }
  .portal-user-copy { display: none; }
}

@media (max-width: 380px) {
  .portal-filterbar-fields { grid-template-columns: 1fr; }
  .portal-auto-table.portal-table-cardable td { padding-left: calc(42% + 6px) !important; }
  .portal-auto-table.portal-table-cardable td::before { width: calc(42% - 18px); }
  .portal-stats { grid-template-columns: 1fr; }
}

/* Customer calendar week grid: scroll sideways inside its box on small screens. */
.get_calandar { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.get_calandar > table { min-width: 760px; background: #fff; }
.get_calandar > table td { vertical-align: top; }
