/* =============================================================
 * Data Migration Accelerator - visual theme (light only)
 *
 * AYLA Solutions brand:
 *   Navy   #042C48   (text, accents, sidebar emphasis)
 *   Teal   #0A7990   (primary buttons, active states)
 *   Bright #116dff   (links/secondary)
 *
 * Light-touch overrides on top of Filament defaults. No JS, no
 * Tailwind recompile. Single file + one font import.
 * ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');

:root {
  --dma-navy:        #042C48;
  --dma-navy-soft:   #0d3a5b;
  --dma-teal:        #0A7990;
  --dma-teal-soft:   #128a9f;
  --dma-bg-canvas:   #f6f8fa;
  --dma-bg-surface:  #ffffff;
  --dma-border:      #e3e8ef;
  --dma-text:        #0f1c2d;
  --dma-text-muted:  #5a6b7c;
}

/* ---------- Typography ---------- */

html, body, .fi-body, .fi-sidebar, .fi-topbar, .fi-main {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif !important;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  color: var(--dma-text);
}

.fi-header-heading, .fi-section-header-heading, .fi-page-heading,
.fi-page-header-heading {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--dma-navy);
}

/* ---------- Page background ---------- */

.fi-body, .fi-main {
  background: var(--dma-bg-canvas) !important;
}

/* ---------- Top bar ---------- */

.fi-topbar {
  background: var(--dma-bg-surface) !important;
  border-bottom: 1px solid var(--dma-border);
  backdrop-filter: blur(6px);
}

/* Hide the top-right user / theme dropdown - profile + sign-out live in the sidebar now */
.fi-topbar .fi-user-menu,
.fi-topbar [x-data*="userMenu"],
.fi-dropdown-trigger.fi-user-menu-trigger,
button.fi-user-menu-trigger,
.fi-topbar-end .fi-user-menu {
  display: none !important;
}

/* Topbar action icons (Team / Settings) next to the search bar */
.dma-topbar-icon, .dma-settings-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 0.4rem;
  border-radius: 0.5rem;
  color: var(--dma-text-muted);
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.dma-topbar-icon:hover, .dma-settings-link:hover {
  background: rgba(10, 121, 144, 0.10);
  color: var(--dma-teal);
}

.dma-topbar-icon svg, .dma-settings-link svg {
  width: 20px;
  height: 20px;
}

/* ---------- Sidebar ---------- */

.fi-sidebar {
  background: var(--dma-bg-surface) !important;
  border-right: 1px solid var(--dma-border);
}

.fi-sidebar-header {
  border-bottom: 1px solid var(--dma-border);
}

.fi-sidebar-nav-groups {
  padding-top: 0.5rem;
}

.fi-sidebar-group-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dma-text-muted) !important;
  opacity: 0.85;
}

.fi-sidebar-item-button {
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  color: var(--dma-text);
}

.fi-sidebar-item-button:hover {
  background: rgba(10, 121, 144, 0.06) !important;
  color: var(--dma-navy) !important;
}

.fi-sidebar-item-active .fi-sidebar-item-button {
  background: rgba(10, 121, 144, 0.10) !important;
  color: var(--dma-teal) !important;
  font-weight: 500;
}

.fi-sidebar-item-active .fi-sidebar-item-button .fi-icon {
  color: var(--dma-teal) !important;
}

/* ---------- Sidebar bottom user widget ---------- */

.dma-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--dma-border);
  background: var(--dma-bg-surface);
}

.dma-sidebar-user-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--dma-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dma-sidebar-user-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.dma-sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dma-navy);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dma-sidebar-user-email {
  font-size: 0.7rem;
  color: var(--dma-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dma-sidebar-user-form {
  flex: 0 0 auto;
  margin: 0;
}

.dma-sidebar-user-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--dma-text-muted);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.dma-sidebar-user-signout:hover {
  background: rgba(223, 49, 49, 0.10);
  color: #df3131;
}

.dma-sidebar-user-signout svg {
  width: 16px;
  height: 16px;
}

/* ---------- Cards / Sections ---------- */

.fi-section, .fi-wi-stats-overview-stat, .fi-ta-content,
.fi-fo-section, .fi-in-section {
  background: var(--dma-bg-surface) !important;
  border: 1px solid var(--dma-border) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 1px 2px rgba(4, 44, 72, 0.04);
}

.fi-wi-stats-overview-stat {
  padding: 1.25rem 1.5rem;
}

.fi-wi-stats-overview-stat-value {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--dma-navy);
}

.fi-wi-stats-overview-stat-label {
  color: var(--dma-text-muted) !important;
}

/* ---------- Tables ---------- */

.fi-ta-table thead th {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dma-text-muted) !important;
  background: #fbfcfd !important;
}

.fi-ta-row {
  transition: background-color 0.12s ease;
}

.fi-ta-row:hover {
  background: rgba(10, 121, 144, 0.04) !important;
}

/* ---------- Buttons ----------
 * Filament already maps `primary` to the AYLA teal palette we registered
 * in AdminPanelProvider. Don't override background/box-shadow here - that
 * fights Filament's hover + loading states and makes the label disappear.
 * Just refine radius, weight, transitions.
 */

.fi-btn, .fi-ac-btn-action, .fi-ac-action {
  border-radius: 0.5rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.fi-btn:active { transform: translateY(1px); }

/* ---------- Form controls ---------- */

.fi-input, .fi-select-input, .fi-textarea {
  border-radius: 0.5rem;
  border-color: var(--dma-border);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.fi-input:focus, .fi-select-input:focus, .fi-textarea:focus {
  border-color: var(--dma-teal);
  box-shadow: 0 0 0 3px rgba(10, 121, 144, 0.16);
}

/* ---------- Badges ---------- */

.fi-badge {
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
}

/* ---------- Scrollbar (Webkit) ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(4, 44, 72, 0.12);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(4, 44, 72, 0.24);
}
::-webkit-scrollbar-track { background: transparent; }

/* ---------- DB connection tiles (contentGrid) ---------- */

/* Scope these to the DatabaseConnection list page so we don't restyle other
   grid views (Projects, etc.). */
.fi-resource-database-connections .fi-ta-record {
  position: relative;
  border-radius: 0.7rem !important;
  border: 1px solid var(--dma-border) !important;
  background: #ffffff;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  overflow: hidden;
}
.fi-resource-database-connections .fi-ta-record:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(4, 44, 72, 0.08);
}

/* Coloured accent strip down the left edge, keyed off the status badge inside */
.fi-resource-database-connections .fi-ta-record::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: #c0c8d1; /* default = untested */
}
.fi-resource-database-connections .fi-ta-record:has(.fi-badge-color-success)::before { background: #16a34a; }
.fi-resource-database-connections .fi-ta-record:has(.fi-badge-color-danger)::before  { background: #dc2626; }

.fi-resource-database-connections .dma-db-card-title {
  /* Force the database name to ellipsis-truncate on a single line. The Filament
     ->limit() truncation handles the value, this just keeps it from wrapping
     when the value is one long unbroken token. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Hide the row-select checkbox column on this resource. ->bulkActions([])
   leaves the column visible in some Filament builds, so belt-and-braces here. */
.fi-resource-database-connections .fi-ta-record-checkbox-cell,
.fi-resource-database-connections .fi-ta-header-checkbox-cell {
  display: none !important;
}

/* Tighten the row-actions footer of each card */
.fi-resource-database-connections .fi-ta-record .fi-ta-actions {
  border-top: 1px solid #eef2f6;
  padding-top: 0.55rem;
  margin-top: 0.55rem;
}

/* ---------- Template fields modal ---------- */

.dma-template-modal { padding: 0.25rem 0; }

.dma-template-hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; padding: 1rem 1.2rem; margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f6f9fc 100%);
  border: 1px solid var(--dma-border); border-radius: 0.6rem;
}
.dma-template-hero-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--dma-text-muted); font-weight: 500;
}
.dma-template-hero-value {
  font-size: 1.05rem; font-weight: 600; color: var(--dma-navy); margin-top: 0.2rem;
  word-break: break-all;
}
.dma-template-hero-stats { display: flex; gap: 1.8rem; }
.dma-template-stat-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--dma-text-muted); font-weight: 500; margin-bottom: 0.25rem;
}
.dma-template-stat-value {
  font-size: 1.1rem; font-weight: 700; color: var(--dma-navy); line-height: 1.1;
}

.dma-template-section-count {
  font-size: 0.78rem; color: var(--dma-text-muted);
}

.dma-template-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dma-template-table thead th {
  text-align: left; padding: 0.5rem 0.7rem;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--dma-text-muted); font-weight: 600;
  border-bottom: 2px solid var(--dma-border); background: #fbfcfd;
}
.dma-template-table tbody td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
}
.dma-template-col-idx { width: 40px; text-align: center; }
.dma-template-field-name { font-weight: 600; color: var(--dma-navy); }
.dma-template-muted { color: var(--dma-text-muted); }
.dma-template-samples {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem; color: #4a5a6e;
  max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dma-template-empty {
  padding: 1.4rem 1rem; text-align: center;
  color: var(--dma-text-muted); font-size: 0.9rem;
  background: #fbfcfd; border: 1px dashed var(--dma-border); border-radius: 0.5rem;
}

/* ---------- DB connections slide-over ---------- */

.dma-db-conn-modal { padding: 0.5rem 0; }
.dma-db-conn-header { display: flex; justify-content: flex-end; margin-bottom: 0.75rem; }
.dma-db-conn-add {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.85rem; font-weight: 600;
  padding: 0.45rem 0.85rem;
  background: var(--dma-teal, #0A7990);
  color: white;
  border: none; border-radius: 0.5rem;
  cursor: pointer;
}
.dma-db-conn-add:hover { background: #086271; }

.dma-db-conn-empty {
  padding: 1.6rem 1rem;
  text-align: center;
  color: var(--dma-text-muted);
  font-size: 0.9rem;
  background: #fbfcfd;
  border: 1px dashed var(--dma-border);
  border-radius: 0.5rem;
}

.dma-db-conn-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dma-db-conn-table thead th {
  text-align: left; padding: 0.5rem 0.6rem;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--dma-text-muted); font-weight: 600;
  border-bottom: 2px solid var(--dma-border); background: #fbfcfd;
}
.dma-db-conn-table tbody td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
}
.dma-db-conn-host { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; }
.dma-db-conn-muted { color: var(--dma-text-muted); }

.dma-db-conn-actions { display: flex; gap: 0.25rem; justify-content: flex-end; }
.dma-db-conn-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--dma-border);
  background: white;
  border-radius: 0.4rem;
  color: var(--dma-text-muted);
  cursor: pointer;
}
.dma-db-conn-btn:hover { background: #f0f4f7; color: var(--dma-navy); }
.dma-db-conn-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.dma-db-conn-btn--info:hover    { color: #2563eb; border-color: #93c5fd; }
.dma-db-conn-btn--warn:hover    { color: #b45309; border-color: #fcd34d; }
.dma-db-conn-btn--danger:hover  { color: #dc2626; border-color: #fca5a5; }

/* ---------- Conversation thread (Communication Centre) ---------- */

.dma-conv-header {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: #fbfcfd;
  border: 1px solid var(--dma-border);
  border-radius: 0.6rem;
  margin-bottom: 1rem;
}
.dma-conv-project {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dma-text-muted);
}
.dma-conv-subject {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dma-navy);
  margin: 0.15rem 0 0.35rem;
}
.dma-conv-meta {
  font-size: 0.8rem;
  color: var(--dma-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dma-conv-dot { color: #c0c8d1; }

.dma-conv-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.4rem 0.2rem;
}

.dma-conv-row {
  display: flex;
  width: 100%;
}
.dma-conv-row--out { justify-content: flex-end; }
.dma-conv-row--in  { justify-content: flex-start; }

.dma-conv-bubble {
  max-width: 72%;
  padding: 0.65rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid var(--dma-border);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(4, 44, 72, 0.04);
}
.dma-conv-row--out .dma-conv-bubble {
  background: rgba(10, 121, 144, 0.08);
  border-color: rgba(10, 121, 144, 0.25);
  border-bottom-right-radius: 0.2rem;
}
.dma-conv-row--in .dma-conv-bubble {
  background: #ffffff;
  border-bottom-left-radius: 0.2rem;
}

.dma-conv-bubble-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
}
.dma-conv-from {
  font-weight: 600;
  color: var(--dma-navy);
}
.dma-conv-arrow { color: var(--dma-text-muted); margin: 0 0.2rem; font-weight: 400; }
.dma-conv-time  { color: var(--dma-text-muted); }

.dma-conv-template {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dma-text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  margin-bottom: 0.4rem;
}

.dma-conv-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #243140;
  white-space: pre-wrap;
  word-break: break-word;
}

.dma-conv-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.dma-conv-att {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  background: #f3f7f9;
  border: 1px solid var(--dma-border);
  border-radius: 0.6rem;
  padding: 0.3rem 0.6rem;
  max-width: 100%;
}
.dma-conv-att-ic { width: 0.9rem; height: 0.9rem; flex: none; color: var(--dma-teal); }
.dma-conv-att-name {
  font-weight: 600; color: var(--dma-navy);
  max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dma-conv-att-name:hover { color: var(--dma-teal); text-decoration: underline; }
.dma-conv-att-btn {
  background: #fff; border: 1px solid rgba(10, 121, 144, 0.3); color: var(--dma-teal);
  font-size: 0.7rem; font-weight: 600; border-radius: 0.4rem; padding: 0.12rem 0.5rem; cursor: pointer;
}
.dma-conv-att-btn:hover { background: var(--dma-teal); color: #fff; }

.dma-conv-empty {
  text-align: center;
  color: var(--dma-text-muted);
  font-style: italic;
  padding: 2rem 0;
}

.dma-topbar-icon { /* shared by all topbar icons */ }

/* ---------- Profiling result detail page ---------- */

.dma-profile-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #ffffff 0%, #f6f9fc 100%);
  border: 1px solid var(--dma-border);
  border-radius: 0.85rem;
  box-shadow: 0 1px 3px rgba(4, 44, 72, 0.05);
}

.dma-profile-hero-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dma-text-muted);
}

.dma-profile-hero-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dma-navy);
  margin-top: 0.2rem;
  line-height: 1.15;
}

.dma-profile-hero-sub {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--dma-text-muted);
}

.dma-profile-hero-dot { margin: 0 0.4rem; color: #c0c8d1; }

.dma-profile-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2rem;
  align-items: flex-end;
}

.dma-profile-stat-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dma-text-muted);
  margin-bottom: 0.3rem;
}

.dma-profile-stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--dma-navy);
  line-height: 1.1;
}

.dma-profile-twocol {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
@media (min-width: 1100px) {
  .dma-profile-twocol { grid-template-columns: 1fr 1fr; }
}

.dma-profile-issue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dma-profile-issue {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  background: #fbfcfd;
  border: 1px solid var(--dma-border);
  border-radius: 0.5rem;
}
.dma-profile-issue-body { flex: 1; font-size: 0.85rem; line-height: 1.4; }
.dma-profile-issue-field {
  font-weight: 600;
  color: var(--dma-navy);
  margin-right: 0.4rem;
}
.dma-profile-issue-text { color: #3a4a5c; }

.dma-profile-recs {
  list-style: decimal;
  padding-left: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #2b3a4c;
}
.dma-profile-recs li { margin-bottom: 0.4rem; }

.dma-profile-table-wrap { overflow-x: hidden; }
.dma-profile-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
/* Fixed layout + wrapping so wide tables never need horizontal scroll. */
.dma-profile-table--fixed { table-layout: fixed; }
.dma-profile-table--fixed th,
.dma-profile-table--fixed td { word-break: break-word; overflow-wrap: anywhere; }
/* Sticky header for the scrollable panels. */
.dma-pr-panel-body .dma-profile-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.dma-profile-table thead th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--dma-teal);
  /* Teal accent under the header so the table head reads as a defined band. */
  border-bottom: 2px solid var(--dma-teal);
  padding: 0.55rem 0.8rem;
  background: #eef6f8;
  white-space: nowrap;
}
.dma-profile-table thead th:not(:last-child),
.dma-profile-table tbody td:not(:last-child) {
  /* Light vertical separators so columns are clearly delineated. */
  border-right: 1px solid #eef2f6;
}
.dma-profile-table tbody td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid #e6edf3;
  vertical-align: middle;
  line-height: 1.35;
}
/* Zebra striping defines row boundaries so data does not look like it leaks. */
.dma-profile-table tbody tr:nth-child(even) { background: #fafcfd; }
.dma-profile-table tbody tr:hover { background: rgba(10, 121, 144, 0.06); }
.dma-profile-table-field { font-weight: 600; color: var(--dma-navy); }
/* Click-to-correct column classification. */
.dma-col-edit {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--dma-navy);
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.dma-col-edit:hover { color: var(--dma-teal); text-decoration: underline; }
.dma-col-edited {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dma-teal);
  background: #e6f3f6;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
.dma-profile-table-muted { color: var(--dma-text-muted); }
/* The cell stays a real table-cell; clamping lives on the inner span so it
   never breaks table layout (a -webkit-box td drops display: table-cell). */
.dma-profile-table-sample {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: #4a5a6e;
}
.dma-pr-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.dma-profile-table-flags { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
/* Give flag badges the same comfortable padding as the PII sensitivity pills. */
.dma-profile-table-flags .fi-badge {
  padding: 0.12rem 0.55rem;
  font-weight: 600;
}
.text-right { text-align: right; }
.tabular-nums { font-variant-numeric: tabular-nums; }

.dma-profile-kv {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}
.dma-profile-kv:last-child { margin-bottom: 0; }
.dma-profile-kv-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dma-text-muted);
  margin-bottom: 0.25rem;
}
.dma-profile-kv-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed #eef2f6;
}
.dma-profile-kv-row:last-child { border-bottom: 0; }
.dma-profile-kv-row--wrap {
  flex-direction: column;
  align-items: flex-start;
}
.dma-profile-kv-key { color: var(--dma-text-muted); text-transform: capitalize; }
.dma-profile-kv-val { font-weight: 500; color: var(--dma-navy); display: flex; flex-wrap: wrap; gap: 0.3rem; }

.dma-profile-ai {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #2b3a4c;
  background: #fbfcfd;
  border: 1px solid var(--dma-border);
  border-radius: 0.5rem;
  padding: 1rem 1.1rem;
}

/* ---------- Profiling result: AI review running banner ---------- */
.dma-pr-aibanner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e4b5c;
  background: #ecf6f9;
  border: 1px solid rgba(10, 121, 144, 0.25);
  border-radius: 0.6rem;
}
.dma-pr-aibanner-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--dma-teal);
  animation: dma-pulse 1.3s ease-in-out infinite;
}

/* ---------- Profiling result: viewport-constrained dashboard ---------- */

/* Shell fills the area left under the topbar + page header. Each panel
   scrolls internally so the page itself never scrolls or grows. */
.dma-pr-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: calc(100vh - 13rem);
  min-height: 460px;
}

.dma-pr-hero {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(135deg, #ffffff 0%, #f6f9fc 100%);
  border: 1px solid var(--dma-border);
  border-radius: 0.85rem;
  box-shadow: 0 1px 3px rgba(4, 44, 72, 0.05);
}
.dma-pr-hero-left { min-width: 0; }
.dma-pr-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.8rem;
  align-items: flex-end;
}

/* Click-to-edit title */
.dma-pr-title-wrap { margin-top: 0.2rem; }
.dma-pr-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dma-navy);
  line-height: 1.15;
  cursor: text;
  display: inline-block;
  padding: 0.1rem 0.35rem;
  margin: -0.1rem -0.35rem;
  border-radius: 0.4rem;
  border: 1px solid transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.dma-pr-title:hover {
  background: rgba(10, 121, 144, 0.06);
  border-color: rgba(10, 121, 144, 0.18);
}
.dma-pr-title-input {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dma-navy);
  line-height: 1.15;
  background: #fff;
  border: 1px solid var(--dma-teal);
  border-radius: 0.4rem;
  padding: 0.1rem 0.4rem;
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 121, 144, 0.16);
  min-width: 16rem;
  max-width: 100%;
}

/* Grid: full-width column-analysis on top, issues + PII split below it. */
.dma-pr-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(180px, 1fr);
  gap: 1.25rem;
}
@media (min-width: 1100px) {
  .dma-pr-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1.25fr 1fr;
    gap: 1.25rem;
  }
  .dma-pr-panel--cols   { grid-column: 1 / span 2; grid-row: 1; }
  .dma-pr-panel--issues { grid-column: 1; grid-row: 2; }
  .dma-pr-panel--pii    { grid-column: 2; grid-row: 2; }
}

/* A panel is a fixed box: header pinned, body scrolls vertically only. */
.dma-pr-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid #d6dee6;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(4, 44, 72, 0.07);
  overflow: hidden;
}
.dma-pr-panel-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dma-navy);
  border-bottom: 1px solid var(--dma-border);
  /* Coloured top accent per panel so panels read as distinct cards. */
  border-top: 3px solid var(--dma-teal);
  background: #f7fafc;
}
.dma-pr-panel--issues .dma-pr-panel-head { border-top-color: #ea580c; }
.dma-pr-panel--pii .dma-pr-panel-head    { border-top-color: #6366f1; }

/* Outer border on the PII table (it sits in a padded body, no panel edge). */
.dma-pr-pii-table {
  border: 1px solid var(--dma-border);
  border-radius: 0.5rem;
  overflow: hidden;
}
.dma-pr-panel-icon { width: 1.05rem; height: 1.05rem; color: var(--dma-teal); }
.dma-pr-panel-count {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dma-text-muted);
  background: #eef3f7;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}
.dma-pr-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.9rem 1rem;
}
.dma-pr-panel-body--flush { padding: 0; }
.dma-pr-panel-body--flush .dma-profile-table thead th { background: #fbfcfd; }

.dma-pr-empty {
  color: var(--dma-text-muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
.dma-pr-subhead {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--dma-text-muted);
  margin: 1rem 0 0.5rem;
}

/* Grouped issues: one card per column, points beneath. */
.dma-pr-issue-list { display: flex; flex-direction: column; gap: 0.55rem; }
.dma-pr-issue {
  border: 1px solid var(--dma-border);
  border-radius: 0.55rem;
  padding: 0.55rem 0.7rem;
  background: #fbfcfd;
}
.dma-pr-issue-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.dma-pr-issue-field { font-weight: 600; color: var(--dma-navy); font-size: 0.85rem; }
.dma-pr-issue-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.dma-pr-issue-point {
  position: relative;
  padding-left: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #3a4a5c;
}
.dma-pr-issue-point::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #c0c8d1;
}
.dma-pr-impact--high::before   { background: #e0245e; }
.dma-pr-impact--medium::before { background: #d98a0b; }
.dma-pr-impact--low::before    { background: var(--dma-teal); }

/* PII detail */
.dma-pr-pii-summary {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  font-size: 0.85rem;
  color: #3a4a5c;
  margin-bottom: 0.6rem;
}
.dma-pr-pii-summary strong { color: var(--dma-navy); }
.dma-pr-pii-high { color: #e0245e; font-weight: 600; }
.dma-pr-pii-table { font-size: 0.8rem; }
.dma-pr-pii-table thead th { background: #fff; }

/* ---------- Cross-system analysis slide-over ---------- */
.dma-xa { font-size: 0.86rem; color: #2b3a4c; }
.dma-xa-note {
  padding: 0.6rem 0.8rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 0.5rem;
  margin-bottom: 0.8rem;
}
.dma-xa-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  padding: 0.7rem 0.9rem;
  background: #f7fafc;
  border: 1px solid var(--dma-border);
  border-radius: 0.6rem;
  margin-bottom: 1rem;
}
.dma-xa-summary > div { display: flex; flex-direction: column; }
.dma-xa-k { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dma-text-muted); font-weight: 600; }
.dma-xa-v { font-size: 1.05rem; font-weight: 700; color: var(--dma-navy); }
.dma-xa-sec {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dma-teal);
  margin: 1.1rem 0 0.45rem;
}
.dma-xa-table { border: 1px solid var(--dma-border); border-radius: 0.5rem; overflow: hidden; margin-bottom: 0.4rem; }
.dma-xa-current {
  margin-left: 0.4rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--dma-teal);
  background: #e6f3f6;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
.dma-xa-rec p { margin: 0.35rem 0; }
.dma-xa-rec strong { color: var(--dma-navy); }
.dma-xa-risks-h { margin: 0.6rem 0 0.2rem; }
.dma-xa-risks { margin: 0; padding-left: 1.2rem; }
.dma-xa-risks li { margin: 0.2rem 0; }
.dma-xa-foot { font-size: 0.72rem; color: var(--dma-text-muted); font-style: italic; margin-top: 0.3rem; }

/* ---------- AI consultant review slide-over (rendered markdown) ---------- */
.dma-ai-prose { font-size: 0.88rem; line-height: 1.6; color: #2b3a4c; }
.dma-ai-prose h1 { font-size: 1.1rem; font-weight: 700; color: var(--dma-navy); margin: 1.1rem 0 0.5rem; }
.dma-ai-prose h2 { font-size: 0.98rem; font-weight: 700; color: var(--dma-navy); margin: 1rem 0 0.4rem; padding-top: 0.6rem; border-top: 1px solid var(--dma-border); }
.dma-ai-prose h3 { font-size: 0.9rem; font-weight: 600; color: var(--dma-navy); margin: 0.8rem 0 0.3rem; }
.dma-ai-prose h1:first-child, .dma-ai-prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.dma-ai-prose p { margin: 0.4rem 0; }
.dma-ai-prose strong { color: var(--dma-navy); font-weight: 600; }
.dma-ai-prose ul, .dma-ai-prose ol { margin: 0.4rem 0; padding-left: 1.3rem; }
.dma-ai-prose li { margin: 0.25rem 0; }
.dma-ai-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  background: #eef3f7;
  border-radius: 0.3rem;
  padding: 0.05rem 0.3rem;
}

/* ---------- Inline-editable cell (double-click to edit) ---------- */

[x-cloak] { display: none !important; }

.dma-inline-edit {
  display: inline-block;
  width: 100%;
  min-width: 0;
}

.dma-inline-edit-display {
  display: inline-block;
  font-weight: 600;
  color: var(--dma-navy);
  cursor: text;
  padding: 0.15rem 0.35rem;
  border-radius: 0.3rem;
  border: 1px solid transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease;
  user-select: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dma-inline-edit-display:hover {
  background: rgba(10, 121, 144, 0.06);
  border-color: rgba(10, 121, 144, 0.18);
}

.dma-inline-edit-input {
  display: inline-block;
  width: 100%;
  padding: 0.15rem 0.4rem;
  font-weight: 600;
  color: var(--dma-navy);
  background: #fff;
  border: 1px solid var(--dma-teal);
  border-radius: 0.3rem;
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 121, 144, 0.16);
}

/* ---------- Links ---------- */

a, .fi-link {
  color: var(--dma-teal);
}
a:hover, .fi-link:hover {
  color: var(--dma-teal-soft);
}

/* ---------- Project pipeline wizard ---------- */

.dma-wizard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

@media (min-width: 1024px) {
  .dma-wizard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1400px) {
  .dma-wizard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dma-wizard-step {
  border: 1px solid var(--dma-border);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dma-wizard-step-audit {
  margin-top: 0.4rem;
  font-size: 0.7rem;
  color: var(--dma-text-muted);
  font-style: italic;
}

.dma-wizard-step--complete {
  border-color: rgba(16, 132, 86, 0.35);
  background: rgba(16, 132, 86, 0.04);
}

.dma-wizard-step--in_progress {
  border-color: rgba(10, 121, 144, 0.35);
  background: rgba(10, 121, 144, 0.04);
}

.dma-wizard-step--blocked {
  opacity: 0.6;
}

.dma-wizard-step-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.dma-wizard-step-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--dma-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.dma-wizard-step--complete .dma-wizard-step-num {
  background: #108456;
}

.dma-wizard-step-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.dma-wizard-step-title {
  font-weight: 600;
  color: var(--dma-navy);
  line-height: 1.2;
}

.dma-wizard-step-detail {
  font-size: 0.7rem;
  color: var(--dma-text-muted);
  margin-top: 1px;
}

.dma-wizard-step-desc {
  font-size: 0.8rem;
  color: var(--dma-text-muted);
  line-height: 1.45;
  padding-left: calc(28px + 0.75rem);
}

.dma-wizard-step-go {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  color: var(--dma-text-muted);
  background: transparent;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.dma-wizard-step-go:hover {
  background: rgba(10, 121, 144, 0.12);
  color: var(--dma-teal);
}
.dma-wizard-step-go svg {
  width: 16px;
  height: 16px;
}

.dma-wizard-step-actions {
  margin-top: 0.65rem;
  padding-left: calc(28px + 0.75rem);
}

/* Higher-specificity selectors + !important to defeat Filament/Tailwind form defaults. */
select.dma-wizard-step-select,
.dma-wizard .dma-wizard-step-select,
.dma-wizard-step .dma-wizard-step-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  display: inline-block;
  width: auto;
  min-width: 10rem;
  max-width: 100%;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6b7c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.65rem center !important;
  background-size: 14px 14px !important;
  border: 1px solid var(--dma-border) !important;
  border-radius: 0.5rem !important;
  padding: 0.45rem 2.1rem 0.45rem 0.85rem !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  color: var(--dma-text) !important;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(4, 44, 72, 0.04);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

select.dma-wizard-step-select::-ms-expand,
.dma-wizard-step-select::-ms-expand {
  display: none !important;
}

.dma-wizard-step-select:hover {
  border-color: #c5cdd6 !important;
}

.dma-wizard-step-select:focus {
  outline: none !important;
  border-color: var(--dma-teal) !important;
  box-shadow: 0 0 0 3px rgba(10, 121, 144, 0.2) !important;
}

/* Status-tinted variants - coloured background pill */
.dma-wizard-step--complete .dma-wizard-step-select {
  background-color: #ecf7f1 !important;
  border-color: rgba(16, 132, 86, 0.35) !important;
  color: #108456 !important;
}
.dma-wizard-step--in_progress .dma-wizard-step-select {
  background-color: #ecf6f8 !important;
  border-color: rgba(10, 121, 144, 0.35) !important;
  color: var(--dma-teal) !important;
}
.dma-wizard-step--blocked .dma-wizard-step-select {
  background-color: #f4f6f8 !important;
  border-color: #cdd5de !important;
  color: var(--dma-text-muted) !important;
}

/* ---------- Project header strip ---------- */

.dma-project-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.5rem;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid var(--dma-border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(4, 44, 72, 0.04);
}

@media (min-width: 768px) {
  .dma-project-header { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .dma-project-header { grid-template-columns: repeat(5, 1fr); }
}

.dma-project-header-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.dma-project-header-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dma-text-muted);
}

.dma-project-header-value {
  font-size: 0.92rem;
  color: var(--dma-navy);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dma-project-header-value--strong {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

/* ---------- Pill-style inline select dropdowns ---------- */

.dma-pill-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: #fff;
  border: 1px solid var(--dma-border);
  border-radius: 0.5rem;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dma-text);
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235a6b7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  text-overflow: ellipsis;
}

.dma-pill-select:hover {
  border-color: #c5cdd6;
}

.dma-pill-select:focus {
  outline: none;
  border-color: var(--dma-teal);
  box-shadow: 0 0 0 3px rgba(10, 121, 144, 0.16);
}

/* Status-specific styling via modifier class */
.dma-pill-select--status {
  font-weight: 600;
  letter-spacing: 0.005em;
}
.dma-pill-select--draft     { color: #5a6b7c; background-color: #f4f6f8; }
.dma-pill-select--profiling { color: #b54d00; background-color: #fff7ed; border-color: rgba(181, 77, 0, 0.25); }
.dma-pill-select--mapping   { color: #0a7990; background-color: #ecf6f8; border-color: rgba(10, 121, 144, 0.25); }
.dma-pill-select--migrating { color: #042c48; background-color: #e8eef4; border-color: rgba(4, 44, 72, 0.25); }
.dma-pill-select--complete  { color: #108456; background-color: #ecf7f1; border-color: rgba(16, 132, 86, 0.25); }
