:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #65728a;
  --line: #dfe6f2;
  --brand: #144b7d;
  --brand2: #0d6b8f;
  --good: #0d7a3d;
  --warn: #9a6700;
  --bad: #a4262c;
  --soft: #eef5fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  background: linear-gradient(120deg, var(--brand), var(--brand2));
  color: #fff;
  padding: 18px 28px;
}

.topbar-title {
  font-size: 22px;
  font-weight: 800;
}

.topbar-subtitle {
  margin-top: 4px;
  opacity: .9;
  font-size: 14px;
}

.nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 28px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a {
  font-weight: 700;
  color: var(--ink);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px;
}

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px;
  box-shadow: 0 10px 30px rgba(21, 32, 51, .06);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 36px;
  letter-spacing: -1px;
}

.hero p {
  max-width: 800px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 17px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 7px 20px rgba(21, 32, 51, .04);
}

.card h3 {
  margin: 0 0 8px;
}

.card p {
  color: var(--muted);
  line-height: 1.45;
}

.badge {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.badge.good {
  background: #e8f6ee;
  color: var(--good);
}

.badge.warn {
  background: #fff4d6;
  color: var(--warn);
}

.badge.bad {
  background: #fdecec;
  color: var(--bad);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--soft);
}

pre {
  background: #0f1724;
  color: #e6edf7;
  padding: 18px;
  border-radius: 14px;
  overflow: auto;
  line-height: 1.45;
}

.footer {
  color: var(--muted);
  text-align: center;
  padding: 30px;
  font-size: 13px;
}

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

  .hero h1 {
    font-size: 28px;
  }

  .wrap {
    padding: 18px;
  }
}

/* Phase 1A Authentication and Permissions */
.auth-strip {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  color: var(--muted);
}

.auth-strip strong {
  color: var(--ink);
}

.auth-strip span {
  color: var(--line);
  margin: 0 8px;
}

.narrow-card {
  max-width: 520px;
  margin-top: 22px;
}

.form {
  display: grid;
  gap: 10px;
}

.form label {
  font-weight: 800;
  color: var(--ink);
}

.form input,
.form select,
.form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
}

.form button,
button,
.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.form button:hover,
button:hover,
.button:hover {
  opacity: .92;
  text-decoration: none;
}

.notice {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 700;
}

.notice.warn {
  background: #fff4d6;
  color: var(--warn);
  border: 1px solid #f3d37c;
}

.notice.good {
  background: #e8f6ee;
  color: var(--good);
  border: 1px solid #a8d9bc;
}

.muted {
  color: var(--muted);
}

/* Phase 2A Companies, Contacts, Locations */
.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form input {
  flex: 1;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
}

.button.secondary {
  background: #eef5fb;
  color: var(--brand);
  border: 1px solid var(--line);
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.two-col .full {
  grid-column: 1 / -1;
}

.note-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  margin-bottom: 12px;
}

@media (max-width: 850px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* Phase 3A Core IT Asset Center */
.inline-form select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  background: #fff;
}

.asset-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
}

/* Phase 3B Flexible Asset Templates */
.template-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}

.template-card h3 {
  margin-top: 0;
}

.flex-record-value {
  border-left: 4px solid var(--brand);
  padding-left: 12px;
  margin-bottom: 12px;
}

/* Phase 4A Encrypted Password Vault */
code {
  background: #eef5fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 7px;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.vault-warning {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 14px;
  border-radius: 12px;
}

/* Phase 5A Documentation Center */
.mono {
  font-family: Consolas, Monaco, monospace;
}

.document-body {
  white-space: pre-wrap;
  line-height: 1.55;
}

/* Phase 6A Relationship Mapping */
.relationship-line {
  border-left: 5px solid var(--brand);
  padding-left: 14px;
}

.dependency-warning {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 14px;
  border-radius: 12px;
}

/* Phase 6A Relationship Mapping */
.relationship-line {
  border-left: 5px solid var(--brand);
  padding-left: 14px;
}

.dependency-warning {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 14px;
  border-radius: 12px;
}

/* Phase 6B Search Center */
.saved-searches {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-chip {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 800;
}

.search-chip:hover {
  background: #eef5fb;
  text-decoration: none;
}

/* Phase 7A Renewals, Expirations, And Alerts */
.expiration-alert {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 14px;
  border-radius: 12px;
}

.badge.overdue {
  background: #fde8e8;
  color: var(--bad);
}

/* Phase 8A Client Portal */
.portal-safe-note {
  border-left: 5px solid var(--brand);
  background: #eef5fb;
  padding: 14px;
  border-radius: 12px;
}

.client-portal-tile {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 16px;
}

/* Phase 9A Reports And Export Center */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.report-card h3 {
  margin-top: 0;
}

.report-card .button {
  margin-right: 8px;
  margin-top: 8px;
}

/* Phase 10A CSV Import And Migration Tools */
.import-warning {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 14px;
  border-radius: 12px;
}

pre {
  white-space: pre-wrap;
  max-width: 720px;
  overflow-wrap: anywhere;
}

/* Phase 11A Backup, Restore, And Release Snapshots */
.backup-proof {
  border-left: 5px solid var(--brand);
  background: #eef5fb;
  padding: 14px;
  border-radius: 12px;
}

.restore-warning {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 14px;
  border-radius: 12px;
}

/* Phase 12A Security Hardening */
.security-pass {
  border-left: 5px solid var(--good);
  background: #edfdf3;
  padding: 14px;
  border-radius: 12px;
}

.security-review {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 14px;
  border-radius: 12px;
}

.security-fail {
  border-left: 5px solid var(--bad);
  background: #fde8e8;
  padding: 14px;
  border-radius: 12px;
}

/* Phase 13A Professional UI And Navigation Cleanup */
.pfit-hero-polish {
  background: linear-gradient(135deg, #eef5fb 0%, #ffffff 55%, #f8fbff 100%);
  border: 1px solid var(--line);
}

.pfit-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.pfit-metric-tile {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.pfit-metric-tile span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: .86rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.pfit-metric-tile strong {
  display: block;
  font-size: 2rem;
  margin-top: 6px;
  color: var(--ink);
}

.pfit-nav-groups {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.pfit-nav-group-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.pfit-nav-group-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.pfit-nav-group-head p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.pfit-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pfit-link-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #f8fbff;
  text-decoration: none;
}

.pfit-link-card strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.pfit-link-card span {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.pfit-link-card em {
  display: block;
  margin-top: 9px;
  font-size: .82rem;
  font-style: normal;
  font-weight: 800;
  color: var(--brand);
}

.muted-card {
  opacity: .58;
}

@media (max-width: 760px) {
  .pfit-nav-group-head {
    display: block;
  }

  .pfit-metric-grid,
  .pfit-link-grid {
    grid-template-columns: 1fr;
  }

  .pfit-metric-tile strong {
    font-size: 1.6rem;
  }
}

/* Phase 14A Final Route Sweep And Release Readiness */
.final-release-banner {
  border-left: 5px solid var(--brand);
  background: #eef5fb;
  padding: 16px;
  border-radius: 14px;
}

.owner-review-banner {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 16px;
  border-radius: 14px;
}

/* Phase 14A Final Route Sweep And Release Readiness */
.final-release-banner {
  border-left: 5px solid var(--brand);
  background: #eef5fb;
  padding: 16px;
  border-radius: 14px;
}

.owner-review-banner {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 16px;
  border-radius: 14px;
}

/* Owner Signoff Customer Release Lock */
.owner-review-banner {
  border-left: 5px solid var(--warn);
  background: #fff8e6;
  padding: 16px;
  border-radius: 14px;
}

/* PayFast IT Group — Logo + Professional Navigation Cleanup */
.pfit-clean-body {
  margin: 0;
  background: #f4f7fb;
  color: #102033;
}

.clean-app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.clean-sidebar {
  background: #0f2238;
  color: #ffffff;
  padding: 18px;
  position: sticky;
  top: 0;
  min-height: 100vh;
  box-shadow: 10px 0 30px rgba(15, 34, 56, .18);
}

.clean-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
  padding: 8px 6px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.clean-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}

.clean-brand span {
  display: grid;
  line-height: 1.05;
}

.clean-brand strong {
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

.clean-brand em {
  font-size: 1rem;
  font-style: normal;
  font-weight: 800;
  color: #78dce1;
}

.clean-user {
  margin: 16px 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
}

.clean-user strong,
.clean-user span {
  display: block;
}

.clean-user span {
  margin-top: 3px;
  font-size: .82rem;
  color: rgba(255,255,255,.72);
  overflow-wrap: anywhere;
}

.clean-nav {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.clean-nav-title {
  color: #78dce1;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin: 0 0 7px 4px;
}

.clean-nav-link {
  display: block;
  color: rgba(255,255,255,.84);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  margin: 3px 0;
}

.clean-nav-link:hover,
.clean-nav-link.active {
  background: rgba(255,255,255,.14);
  color: #ffffff;
}

.clean-main {
  min-width: 0;
}

.clean-topbar {
  background: #ffffff;
  border-bottom: 1px solid #dbe5ef;
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.clean-topbar h1 {
  margin: 0;
  font-size: 1.35rem;
}

.clean-topbar p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: .92rem;
}

.clean-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.clean-content {
  padding: 28px;
}

.brand-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #eef8fb 100%);
  border: 1px solid #dbe5ef;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 14px 34px rgba(15, 34, 56, .08);
}

.brand-hero img {
  max-width: 100%;
  height: auto;
}

.brand-hero h1 {
  margin-bottom: 8px;
}

.brand-hero p {
  color: #64748b;
  font-size: 1.05rem;
}

.brand-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.brand-metric-tile {
  background: #ffffff;
  border: 1px solid #dbe5ef;
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 34, 56, .06);
}

.brand-metric-tile span {
  display: block;
  color: #64748b;
  font-weight: 900;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.brand-metric-tile strong {
  display: block;
  color: #102033;
  font-size: 2rem;
  margin-top: 5px;
}

.brand-nav-sections {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.brand-nav-section {
  background: #ffffff;
  border: 1px solid #dbe5ef;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 34, 56, .06);
}

.brand-nav-section-head h2 {
  margin: 0 0 12px;
}

.brand-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.brand-tool-card {
  display: block;
  background: #f8fbff;
  border: 1px solid #dbe5ef;
  border-radius: 16px;
  padding: 15px;
  text-decoration: none;
}

.brand-tool-card strong {
  display: block;
  color: #102033;
  margin-bottom: 6px;
}

.brand-tool-card span {
  display: block;
  color: #64748b;
  line-height: 1.35;
}

.brand-tool-card em {
  display: block;
  margin-top: 10px;
  color: #0f4c81;
  font-style: normal;
  font-weight: 900;
  font-size: .82rem;
}

.muted-card {
  opacity: .55;
}

@media (max-width: 900px) {
  .clean-app-shell {
    grid-template-columns: 1fr;
  }

  .clean-sidebar {
    position: static;
    min-height: auto;
  }

  .clean-nav {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .clean-topbar {
    display: block;
  }

  .clean-top-actions {
    margin-top: 12px;
  }

  .brand-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .clean-content,
  .clean-topbar,
  .clean-sidebar {
    padding: 16px;
  }

  .brand-metric-grid,
  .brand-tool-grid {
    grid-template-columns: 1fr;
  }
}

/* PayFast IT Group — Navigation Simplify + Customer Lookup + Change Control */
.clean-nav .clean-nav-group:nth-last-child(1) .clean-nav-title {
  color: #fbbf24;
}

.pfit-original-select-hidden {
  position: absolute !important;
  left: -99999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.pfit-customer-lookup-wrap {
  position: relative;
  display: grid;
  gap: 8px;
}

.pfit-customer-lookup-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 1rem;
  background: #fff;
}

.pfit-customer-lookup-results {
  position: absolute;
  z-index: 40;
  top: 46px;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 18px 38px rgba(15, 34, 56, .16);
  overflow: hidden;
  max-height: 290px;
  overflow-y: auto;
}

.pfit-customer-result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 11px 13px;
  font-weight: 800;
  cursor: pointer;
  color: #102033;
}

.pfit-customer-result:hover {
  background: #eef8fb;
}

.pfit-customer-no-results {
  padding: 12px 13px;
  color: #64748b;
  font-weight: 800;
}

.pfit-customer-add-new {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: #0f4c81;
  font-weight: 900;
  text-decoration: none;
  font-size: .9rem;
}

.pfit-customer-add-new:hover {
  text-decoration: underline;
}

/* QuickBooks-style Customer / Company Dropdown */
.pfit-original-select-hidden {
  position: absolute !important;
  left: -99999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.pfit-qb-combo {
  position: relative;
  display: grid;
  gap: 0;
}

.pfit-qb-combo-input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 1rem;
  background: #fff;
  color: #102033;
}

.pfit-qb-combo-input:focus {
  outline: 3px solid rgba(18, 163, 168, .18);
  border-color: #12a3a8;
}

.pfit-qb-combo-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15, 34, 56, .20);
  overflow: hidden;
  max-height: 330px;
  overflow-y: auto;
}

.pfit-qb-combo-row {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  padding: 11px 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  color: #102033;
  border-bottom: 1px solid #eef2f7;
}

.pfit-qb-combo-row:hover,
.pfit-qb-combo-row.is-active {
  background: #eef8fb;
}

.pfit-qb-row-main {
  display: block;
  font-weight: 900;
  color: #102033;
}

.pfit-qb-row-sub {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
}

.pfit-qb-add-row {
  background: #f8fbff;
  color: #0f4c81;
}

.pfit-qb-add-row .pfit-qb-row-main {
  color: #0f4c81;
}

.pfit-qb-combo-empty {
  padding: 12px 13px;
  color: #64748b;
  font-weight: 800;
  border-bottom: 1px solid #eef2f7;
}

.pfit-qb-prefill-notice {
  margin-bottom: 18px;
}

/* PayFast IT Group — Staff / System User Center */
.staff-user-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* PayFast IT Group — Asset Save/Form UX Repair */
.pfit-qb-combo-input,
.pfit-customer-lookup-input,
.pfit-qb-row-main,
.pfit-qb-row-sub,
.pfit-qb-combo-row,
.pfit-customer-result,
.pfit-customer-no-results,
.pfit-qb-combo-empty,
.pfit-location-combo input {
  color: #102033 !important;
}

.pfit-qb-combo-input::placeholder,
.pfit-customer-lookup-input::placeholder,
.pfit-location-combo input::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

.pfit-qb-combo-menu,
.pfit-customer-lookup-results {
  background: #ffffff !important;
  color: #102033 !important;
}

.pfit-qb-add-row .pfit-qb-row-main,
.pfit-customer-add-new {
  color: #0f4c81 !important;
}

.pfit-location-combo .pfit-qb-combo-menu {
  z-index: 120;
}

/* PayFast IT Group — HARD FIX: customer/company search dropdown contrast */
.pfit-qb-combo,
.pfit-customer-lookup-wrap,
.pfit-location-combo {
  color: #0f172a !important;
}

.pfit-qb-combo-input,
.pfit-customer-lookup-input,
.pfit-location-combo input,
input.pfit-qb-combo-input,
input.pfit-customer-lookup-input {
  background: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
}

.pfit-qb-combo-input::placeholder,
.pfit-customer-lookup-input::placeholder,
.pfit-location-combo input::placeholder {
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  opacity: 1 !important;
}

.pfit-qb-combo-menu,
.pfit-customer-lookup-results,
.pfit-location-combo .pfit-qb-combo-menu {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .24) !important;
}

.pfit-qb-combo-menu *,
.pfit-customer-lookup-results *,
.pfit-location-combo .pfit-qb-combo-menu * {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

.pfit-qb-combo-row,
.pfit-customer-result,
button.pfit-qb-combo-row,
button.pfit-customer-result,
a.pfit-qb-combo-row,
a.pfit-customer-result {
  background: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

.pfit-qb-combo-row:hover,
.pfit-qb-combo-row.is-active,
.pfit-customer-result:hover,
.pfit-customer-result:focus,
.pfit-qb-combo-row:focus {
  background: #dff7fb !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

.pfit-qb-row-main,
.pfit-qb-row-sub,
.pfit-customer-no-results,
.pfit-qb-combo-empty {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

.pfit-qb-row-sub {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
}

.pfit-qb-add-row,
.pfit-customer-add-new {
  background: #eef8ff !important;
}

.pfit-qb-add-row .pfit-qb-row-main,
.pfit-customer-add-new,
.pfit-qb-add-row * {
  color: #075985 !important;
  -webkit-text-fill-color: #075985 !important;
}

/* Covers browser autofill and cached form rendering */
.pfit-qb-combo-input:-webkit-autofill,
.pfit-customer-lookup-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #0f172a !important;
}

/* PayFast IT Group — Hard Asset Save Repair */
.notice.bad,
.notice.warn,
.notice.good {
  font-weight: 800;
}

.form .muted {
  color: #475569 !important;
}

.asset-save-required {
  color: #991b1b;
  font-weight: 900;
}

/* PayFast IT Group — Technician Mobile PWA */
.tech-app-hero {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 16px;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #eef8fb 100%);
  border: 1px solid #dbe5ef;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(15, 34, 56, .08);
}

.tech-app-hero img {
  width: 74px;
  height: 74px;
}

.tech-app-hero h1 {
  margin: 4px 0;
}

.tech-app-hero p {
  margin: 0;
  color: #475569;
}

.tech-app-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.tech-app-actions a {
  display: block;
  background: #0f4c81;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 900;
  text-align: center;
  padding: 16px 12px;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 76, 129, .20);
}

.tech-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.tech-metric-grid div {
  background: #ffffff;
  border: 1px solid #dbe5ef;
  border-radius: 16px;
  padding: 14px;
}

.tech-metric-grid span {
  display: block;
  color: #64748b;
  font-weight: 900;
  font-size: .78rem;
  text-transform: uppercase;
}

.tech-metric-grid strong {
  display: block;
  color: #102033;
  font-size: 1.9rem;
}

.tech-result-card {
  display: block;
  background: #ffffff;
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  padding: 13px;
  margin: 8px 0;
  text-decoration: none;
  color: #102033 !important;
}

.tech-result-card strong,
.tech-result-card span {
  display: block;
  color: #102033 !important;
}

.pfit-install-hint {
  background: #fff8e6;
  border-left: 5px solid #f59e0b;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #102033;
  font-weight: 800;
}

@media (max-width: 700px) {
  .clean-app-shell {
    display: block;
  }

  .clean-sidebar {
    display: none;
  }

  .clean-topbar {
    padding: 14px;
  }

  .clean-topbar p {
    display: none;
  }

  .clean-content {
    padding: 14px;
  }

  .tech-app-actions {
    grid-template-columns: 1fr 1fr;
  }

  .tech-app-actions a {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  input,
  select,
  textarea,
  button,
  .button {
    font-size: 16px !important;
  }
}

/* PayFast IT Group — Main Menu 500 Rescue */
.rescue-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.rescue-menu-card {
  display: block;
  background: #ffffff;
  border: 1px solid #dbe5ef;
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(15, 34, 56, .08);
}

.rescue-menu-card strong {
  display: block;
  color: #102033 !important;
  font-size: 1.05rem;
  margin-top: 6px;
}

.rescue-menu-card span:not(.badge) {
  display: block;
  color: #475569 !important;
  margin-top: 4px;
}

/* PayFast IT Group — Secure Private Message Center */
.secure-message-thread {
  display: grid;
  gap: 12px;
}

.secure-message-bubble {
  border: 1px solid #dbe5ef;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
  color: #102033;
}

.secure-message-bubble.staff {
  border-left: 5px solid #0f4c81;
}

.secure-message-bubble.customer {
  border-left: 5px solid #12a3a8;
  background: #f7feff;
}

.secure-message-bubble strong,
.secure-message-bubble p,
.secure-message-bubble span {
  color: #102033 !important;
}

.secure-thread-card {
  display: block;
  border: 1px solid #dbe5ef;
  border-radius: 16px;
  padding: 14px;
  margin: 10px 0;
  text-decoration: none;
  background: #ffffff;
}

.secure-thread-card strong,
.secure-thread-card span {
  display: block;
  color: #102033 !important;
}

/* PayFast IT Group — Client Offboarding Center */
.compact-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.compact-form select,
.compact-form button {
  margin: 0;
}

@media (max-width: 700px) {
  .compact-form {
    grid-template-columns: 1fr;
  }
}

/* PayFast IT Group — Email Center */
.email-status-queued {
  background: #fff8e6;
}

.email-status-failed {
  background: #fee2e2;
}

.email-status-sent {
  background: #dcfce7;
}

/* PayFast IT Group — Email Settings Test Center */
.email-test-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.email-test-output {
  background: #0f172a;
  color: #dbeafe;
  border-radius: 14px;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .email-test-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* PayFast IT Group — Email Template Manager */
.template-body-editor {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.email-template-preview {
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  white-space: pre-wrap;
  overflow: auto;
  line-height: 1.5;
}

code {
  background: #eef2ff;
  color: #1e293b;
  padding: 3px 7px;
  border-radius: 8px;
  font-weight: 800;
}

/* PayFast IT Group — Email/Asset Cleanup UI */
.cleanup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.cleanup-card {
  display: block;
  background: #ffffff;
  border: 1px solid #dbe5ef;
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(15, 34, 56, .08);
}

.cleanup-card strong {
  display: block;
  color: #102033 !important;
  font-size: 1.06rem;
  margin-top: 6px;
}

.cleanup-card span:not(.badge) {
  display: block;
  color: #475569 !important;
  margin-top: 5px;
  line-height: 1.35;
}

.cleanup-advanced summary {
  cursor: pointer;
  font-weight: 900;
  color: #102033;
  font-size: 1.05rem;
}

.cleanup-advanced .button {
  margin: 6px 6px 0 0;
}

/* Hide noisy technical links from everyday sidebar. The pages still exist. */
.clean-sidebar a[href="/email-settings"],
.clean-sidebar a[href="/email-settings-test"],
.clean-sidebar a[href="/email-delivery-method"],
.clean-sidebar a[href="/email-template-send"],
.clean-sidebar a[href="/email-template-fields"],
.clean-sidebar a[href="/email-outbox"],
.clean-sidebar a[href="/email-inbox"],
.clean-sidebar a[href="/email-routing"],
.clean-sidebar a[href="/email-test"],
.clean-sidebar a[href="/email-status.json"],
.clean-sidebar a[href="/email-delivery-method/status.json"],
.clean-sidebar a[href="/email-template-manager/status.json"],
.clean-sidebar a[href="/asset-save-diagnostics"],
.clean-sidebar a[href="/asset-browser-submit-diagnostics"],
.clean-sidebar a[href="/asset-save-status.json"],
.clean-sidebar a[href="/asset-browser-submit-status.json"],
.clean-sidebar a[href="/form-save-qa.json"],
.clean-sidebar a[href="/client-intake.json"],
.clean-sidebar a[href="/staff-users.json"],
.clean-sidebar a[href="/brand-navigation.json"] {
  display: none !important;
}

/* Keep only the clean high-level email link visible in normal navigation. */
.clean-sidebar a[href="/email-templates"],
.clean-sidebar a[href="/compose-template-email"] {
  display: none !important;
}

@media (max-width: 700px) {
  .cleanup-grid {
    grid-template-columns: 1fr;
  }
}

/* PayFast IT Group — Email/Asset Cleanup UI */
.cleanup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.cleanup-card {
  display: block;
  background: #ffffff;
  border: 1px solid #dbe5ef;
  border-radius: 18px;
  padding: 16px;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(15, 34, 56, .08);
}

.cleanup-card strong {
  display: block;
  color: #102033 !important;
  font-size: 1.06rem;
  margin-top: 6px;
}

.cleanup-card span:not(.badge) {
  display: block;
  color: #475569 !important;
  margin-top: 5px;
  line-height: 1.35;
}

.cleanup-advanced summary {
  cursor: pointer;
  font-weight: 900;
  color: #102033;
  font-size: 1.05rem;
}

.cleanup-advanced .button {
  margin: 6px 6px 0 0;
}

/* Hide noisy technical links from everyday sidebar. The pages still exist. */
.clean-sidebar a[href="/email-settings"],
.clean-sidebar a[href="/email-settings-test"],
.clean-sidebar a[href="/email-delivery-method"],
.clean-sidebar a[href="/email-template-send"],
.clean-sidebar a[href="/email-template-fields"],
.clean-sidebar a[href="/email-outbox"],
.clean-sidebar a[href="/email-inbox"],
.clean-sidebar a[href="/email-routing"],
.clean-sidebar a[href="/email-test"],
.clean-sidebar a[href="/email-status.json"],
.clean-sidebar a[href="/email-delivery-method/status.json"],
.clean-sidebar a[href="/email-template-manager/status.json"],
.clean-sidebar a[href="/asset-save-diagnostics"],
.clean-sidebar a[href="/asset-browser-submit-diagnostics"],
.clean-sidebar a[href="/asset-save-status.json"],
.clean-sidebar a[href="/asset-browser-submit-status.json"],
.clean-sidebar a[href="/form-save-qa.json"],
.clean-sidebar a[href="/client-intake.json"],
.clean-sidebar a[href="/staff-users.json"],
.clean-sidebar a[href="/brand-navigation.json"] {
  display: none !important;
}

/* Keep only the clean high-level email link visible in normal navigation. */
.clean-sidebar a[href="/email-templates"],
.clean-sidebar a[href="/compose-template-email"] {
  display: none !important;
}

@media (max-width: 700px) {
  .cleanup-grid {
    grid-template-columns: 1fr;
  }
}

/* PayFast IT Group — Logout Button */
.pfit-logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #991b1b;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 900;
  border-radius: 999px;
  padding: 9px 14px;
  margin-left: auto;
  box-shadow: 0 8px 18px rgba(153, 27, 27, .18);
}

.pfit-logout-button:hover {
  background: #7f1d1d;
  color: #ffffff !important;
}

.pfit-logout-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #dbe5ef;
}

.pfit-logout-floating {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 99999;
}

@media (max-width: 700px) {
  .pfit-logout-button {
    width: auto;
    min-height: 42px;
    padding: 10px 14px;
    margin-left: 8px;
  }

  .pfit-logout-floating {
    right: 10px;
    top: 10px;
  }
}

/* PayFast IT Group — Auth Hardening Fallback */
body.pfit-guest-login-hardened .clean-sidebar,
body.pfit-guest-login-hardened .pfit-logout-button,
body.pfit-guest-login-hardened .pfit-logout-floating {
  display: none !important;
}

/* PayFast IT Group — Lifecycle / Danger Zone */
.danger-zone {
  border: 2px solid #fecaca !important;
  background: #fff7f7 !important;
}

.danger-zone h2 {
  color: #991b1b !important;
}

.notice.good {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  margin: 14px 0;
}

.notice.bad {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  margin: 14px 0;
}

/* PayFast IT Group — Admin Lifecycle Navigation */
.admin-lifecycle-links {
  border: 1px solid #bfdbfe !important;
  background: #eff6ff !important;
}

.admin-lifecycle-links h2 {
  color: #1e3a8a !important;
}
