/**
 * PTOPS modern shell — loads after Kickstart / legacy main.css (typography + layout helpers)
 * Palette: county green accent on neutral gray surfaces
 *
 * Contrast (WCAG 2.2 AA): normal text ≥4.5:1 vs adjacent background; primary buttons
 * use only gradient stops that meet ≥4.5:1 with white (#fff). Legacy #40916c kept as
 * --ptops-green-soft for non–text-on-green use only.
 */
:root {
  --ptops-bg: #e8eef0;
  --ptops-bg-alt: #dfe8eb;
  --ptops-surface: #ffffff;
  --ptops-border: #c5d0d5;
  --ptops-text: #1c2b2f;
  --ptops-muted: #5a6f75;
  --ptops-brand: #1b4332;
  --ptops-brand-mid: #2d6a4f;
  /* Link:hover, borders on light surfaces — ≥4.5:1 vs white */
  --ptops-accent: #265640;
  /* Decorative / tints only — do not use as white text background */
  --ptops-green-soft: #40916c;
  /* Primary button hover: lighter top stop, still ≥4.5:1 with white */
  --ptops-btn-hover-start: #347559;
  --ptops-danger: #9b2226;
  --ptops-danger-bg: #fde8e8;
  --ptops-focus: #2d6a4f;
  --ptops-radius: 10px;
  --ptops-radius-sm: 6px;
  --ptops-shadow: 0 2px 8px rgba(15, 35, 40, 0.07);
  --ptops-shadow-lg: 0 8px 32px rgba(15, 35, 40, 0.1);
  --ptops-font: "Source Sans Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.body,
body.ptops-page-login,
body.ptops-page-app {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ptops-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ptops-text) !important;
  background: linear-gradient(165deg, var(--ptops-bg-alt) 0%, var(--ptops-bg) 45%, #d4e0e4 100%);
  background-attachment: fixed;
}

body.ptops-page-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 3rem;
}

/* --- Login shell --- */
.ptops-login-wrap {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.ptops-login-card {
  background: var(--ptops-surface);
  border-radius: 16px;
  box-shadow: var(--ptops-shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 2rem 1.75rem 2.25rem;
  margin-top: 0.5rem;
}

.ptops-login-card table {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border-collapse: separate;
  border-spacing: 0 0.65rem;
}

.ptops-login-card td {
  vertical-align: middle;
}

.ptops-login-form {
  margin: 0;
}

.ptops-login-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ptops-field-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ptops-field-row label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ptops-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ptops-login-submit-row {
  margin-top: 1.25rem;
}

.ptops-login-submit-row input[type="button"],
.ptops-login-submit-row input[type="submit"] {
  width: 100%;
}

.ptops-login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  justify-content: center;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ptops-border);
}

/* IP / date on login gradient: --ptops-muted fails on lighter stops; opacity worsens contrast */
.ptops-login-footer-meta {
  margin-top: 1.5rem;
  text-align: center;
  font-style: italic;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ptops-text);
}

.ptops-disclaimer {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ptops-muted);
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--ptops-radius-sm);
  border: 1px solid rgba(197, 208, 213, 0.85);
}

.ptops-disclaimer--legal {
  color: var(--ptops-muted);
}

.ptops-brand-bar {
  text-align: center;
  margin-bottom: 0.25rem;
}

.ptops-brand-bar img {
  max-height: 88px;
  width: auto;
  height: auto;
}

h1,
h2,
h3 {
  color: var(--ptops-brand);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* --- Typography (legacy class names — “white*” was for old dark BG; force dark text on light) --- */
.whitetextTitle100,
.whitetextTitle,
.loginscreenText {
  color: var(--ptops-brand) !important;
  text-shadow: none !important;
  font-weight: 600;
}

.whitetextTitle100.tight,
.whitetextTitle {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem) !important;
  line-height: 1.25;
}

/* Paragraph / table body copy */
.whitetext {
  color: var(--ptops-text) !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

.whitelittle,
.whitelittle2 {
  color: var(--ptops-muted) !important;
  text-shadow: none !important;
  font-weight: 600 !important;
}

/* Still used on some upload / result pages */
.whitetextA,
.whitemedium {
  color: var(--ptops-text) !important;
  text-shadow: none !important;
  font-weight: 500;
}

/* Tables that keep class="whitetext" from the old layout */
table.whitetext,
table.whitetext td,
table.whitetext th {
  color: var(--ptops-text) !important;
  text-shadow: none !important;
}

table.whitetext td.whitetextTitle,
table.whitetext td.whitetextTitle100,
table.whitetext .whitetextTitle {
  color: var(--ptops-brand) !important;
}

table.whitetext .whitelittle,
table.whitetext .whitelittle2 {
  color: var(--ptops-muted) !important;
}

table.whitetext a {
  color: var(--ptops-brand-mid) !important;
}

/* Legacy centered chrome (paymentrequest.php, etc.) */
center {
  color: var(--ptops-text);
}

center > table:not(.whitetext) td,
center > table:not(.whitetext) th {
  color: var(--ptops-text) !important;
  text-shadow: none !important;
}

.instruction,
.bluetext {
  color: var(--ptops-brand-mid) !important;
  text-shadow: none !important;
}

.rowTitle {
  color: var(--ptops-surface) !important;
  background: var(--ptops-brand);
  padding: 0.35rem 0.5rem;
  border-radius: var(--ptops-radius-sm);
}

/* --- Links --- */
a {
  color: var(--ptops-brand-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--ptops-accent);
}

a.whiteText,
.whiteText {
  color: var(--ptops-brand-mid) !important;
  font-weight: 600;
}

a.whiteText:hover,
.whiteText:hover {
  color: var(--ptops-accent) !important;
}

/* Keyboard focus (WCAG 2.4.7) — Kickstart uses outline:0 on links; button inputs need a ring vs green fill */
a:focus-visible {
  outline: 2px solid var(--ptops-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Forms --- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  padding: 0.5rem 0.75rem;
  background: #fafcfc;
  color: var(--ptops-text);
  max-width: 100%;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

input:focus:not([type="button"]):not([type="submit"]):not([type="reset"]),
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--ptops-focus);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
  background: var(--ptops-surface);
}

/* ≥4.5:1 vs #fafcfc and #fff (verified); opacity 1 for Firefox placeholder dimming */
input::placeholder,
textarea::placeholder {
  color: var(--ptops-muted);
  opacity: 1;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: var(--ptops-muted);
}

input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
  color: var(--ptops-muted);
}

input[type="button"],
input[type="submit"],
input[type="reset"],
button {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: none !important;
  border-radius: var(--ptops-radius-sm);
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  background: linear-gradient(180deg, var(--ptops-brand-mid) 0%, var(--ptops-brand) 100%) !important;
  background-image: linear-gradient(180deg, var(--ptops-brand-mid) 0%, var(--ptops-brand) 100%) !important;
  color: #fff !important;
  text-shadow: none !important;
  box-shadow: 0 1px 2px rgba(27, 67, 50, 0.25);
  transition:
    transform 0.05s ease,
    background 0.15s ease,
    color 0.15s ease;
}

/*
 * Kickstart’s button:hover uses a light gray gradient but does not override our white text.
 * Hover uses only AA-safe stops vs white (no brightness() filter — it washed out contrast).
 */
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
button:hover {
  filter: none;
  background: linear-gradient(180deg, var(--ptops-btn-hover-start) 0%, var(--ptops-brand) 100%) !important;
  background-image: linear-gradient(180deg, var(--ptops-btn-hover-start) 0%, var(--ptops-brand) 100%) !important;
  color: #fff !important;
  border: none !important;
  text-shadow: none !important;
}

input[type="button"]:active,
input[type="submit"]:active,
button:active {
  transform: translateY(1px);
}

input[type="button"]:disabled,
input[type="submit"]:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow:
    0 0 0 3px var(--ptops-focus),
    0 1px 2px rgba(27, 67, 50, 0.25);
  border: none !important;
}

/* Kickstart uses a.button with outline:none — match link focus for keyboard users */
a.button:focus-visible {
  outline: 2px solid var(--ptops-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/*
 * Ghost / neutral buttons: component rules set box-shadow: none !important, which beats the
 * global CTA focus ring. Solid outline keeps 2.4.7 Focus Visible (WCAG AA) on light surfaces.
 */
.ptops-usermgmt button.ptops-usermgmt-tab:focus-visible,
.ptops-usermgmt button.ptops-usermgmt-sort:focus-visible,
.ptops-usermgmt-detail-actions #btnCancel:focus-visible {
  outline: 2px solid var(--ptops-focus) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px var(--ptops-surface), 0 0 0 4px var(--ptops-focus) !important;
}

/* Kickstart / legacy small buttons */
button.small,
button.medium {
  border-radius: var(--ptops-radius-sm);
}

/* --- Alerts & messages --- */
.error,
span.error {
  display: block;
  color: var(--ptops-danger) !important;
  font-style: normal !important;
  font-weight: 500;
  background: var(--ptops-danger-bg);
  border: 1px solid #f5c2c7;
  border-radius: var(--ptops-radius);
  padding: 0.85rem 1rem;
  margin: 0.5rem auto;
  max-width: 52rem;
  text-shadow: none !important;
}

.message,
.importmessage {
  color: var(--ptops-brand-mid) !important;
}

.debugMessage {
  color: var(--ptops-danger) !important;
}

.processing {
  color: var(--ptops-brand-mid) !important;
  font-weight: 500;
}

/* --- App layout (legacy pages still using <center>) --- */
center {
  display: block;
  width: 100%;
  padding: 0.5rem 0.25rem 2rem;
}

center > table.whitetext {
  background: var(--ptops-surface);
  border-radius: 16px;
  box-shadow: var(--ptops-shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.75);
  padding: 1.25rem 1rem 1.75rem !important;
  max-width: min(1200px, 100%);
}

/* --- Home: single-column flow (home.php / home2.php) --- */
.ptops-home {
  max-width: min(1600px, 100%);
  margin: 0 auto;
  padding: 0.5rem 1rem 2.5rem;
  box-sizing: border-box;
}

.ptops-home-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0 1.25rem;
  border-bottom: 1px solid var(--ptops-border);
  margin-bottom: 1rem;
}

.ptops-home-logo {
  max-height: 76px;
  width: auto;
  height: auto;
}

.ptops-home-hero-text {
  flex: 1 1 240px;
  min-width: 0;
}

/* Override main.css .whitetextTitle (width 75%, text-align center) for home hero */
.ptops-home-hero-text .ptops-home-heading.whitetextTitle,
.ptops-home-hero-text h1.ptops-home-heading {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left !important;
}

.ptops-home-heading {
  margin: 0;
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  line-height: 1.2;
}

/* Override main.css .whitelittle { text-align: center } */
.ptops-home-fiscalyear {
  margin: 0.4rem 0 0;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left !important;
}

.ptops-impersonating-banner {
  background: #fff3cd;
  border: 1px solid #e0c766;
  padding: 0.35rem 0.65rem;
  border-radius: var(--ptops-radius-sm);
  display: inline-block;
  max-width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.ptops-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--ptops-radius);
  margin: 0 0 1rem;
}

.ptops-alert--danger {
  background: var(--ptops-danger-bg);
  border: 1px solid #f5c2c7;
  color: var(--ptops-danger);
}

.ptops-alert--success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #1b5e20;
}

.ptops-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ptops-home-due-dates {
  margin-bottom: 1.15rem;
  padding: 0.9rem 1.15rem;
  background: linear-gradient(135deg, #e6f4ea 0%, #f0faf3 100%);
  border: 1px solid rgba(64, 145, 108, 0.5);
  border-radius: var(--ptops-radius);
  box-shadow: var(--ptops-shadow);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ptops-text);
}

.ptops-home-due-dates p {
  margin: 0.4rem 0;
}

.ptops-home-due-dates p:first-child {
  margin-top: 0;
}

.ptops-home-due-dates p:last-child {
  margin-bottom: 0;
}

.ptops-home-due-dates em {
  font-style: normal;
  font-weight: 600;
  color: var(--ptops-brand);
}

.ptops-home-userbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--ptops-surface);
  border-radius: var(--ptops-radius);
  border: 1px solid var(--ptops-border);
  box-shadow: var(--ptops-shadow);
  margin-bottom: 1.25rem;
  overflow: visible;
}

.ptops-home-userbar__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.ptops-home-signed-in {
  font-size: 0.95rem;
  color: var(--ptops-text);
}

.ptops-home-userbar__secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
  justify-content: flex-end;
  flex: 1 1 auto;
  overflow: visible;
}

.ptops-form-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

/* Searchable impersonate combobox (home.php) */
.ptops-impersonate-combobox {
  position: relative;
  z-index: 200;
  min-width: 18rem;
  width: min(32rem, 100%);
  max-width: 100%;
}

.ptops-combobox__input {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  background: #fafcfc;
  color: var(--ptops-text);
}

.ptops-combobox__input:focus {
  outline: 2px solid var(--ptops-focus);
  outline-offset: 1px;
  border-color: var(--ptops-brand-mid);
  background: #fff;
}

.ptops-combobox__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.2rem);
  z-index: 300;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: min(20rem, 60vh);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--ptops-surface);
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius);
  box-shadow: var(--ptops-shadow-lg);
}

.ptops-combobox__option {
  padding: 0.55rem 0.9rem;
  margin: 0 0.25rem;
  border-radius: var(--ptops-radius-sm);
  cursor: pointer;
  border-bottom: 1px solid rgba(197, 208, 213, 0.45);
}

.ptops-combobox__option:last-child {
  border-bottom: 0;
}

.ptops-combobox__option.is-hidden {
  display: none !important;
}

.ptops-combobox__option:hover,
.ptops-combobox__option.is-active {
  background: rgba(38, 86, 64, 0.12);
}

.ptops-combobox__option--myself {
  background: rgba(27, 67, 50, 0.04);
}

.ptops-combobox__option--myself:hover,
.ptops-combobox__option--myself.is-active {
  background: rgba(38, 86, 64, 0.16);
}

.ptops-combobox__option--profile-action {
  background: rgba(27, 67, 50, 0.04);
}

.ptops-combobox__option--profile-action:hover,
.ptops-combobox__option--profile-action.is-active {
  background: rgba(38, 86, 64, 0.16);
}

.ptops-combobox__primary {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ptops-text);
  line-height: 1.25;
}

.ptops-combobox__secondary {
  display: block;
  font-size: 0.875rem;
  color: var(--ptops-muted);
  margin-top: 0.2rem;
  line-height: 1.3;
  font-weight: 500;
}

.ptops-combobox__option--myself .ptops-combobox__primary {
  color: var(--ptops-brand);
}

.ptops-field-label {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ptops-muted);
}

.ptops-home-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ptops-inline-form {
  display: inline;
}

.ptops-home-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 920px) {
  .ptops-home-panels {
    grid-template-columns: 1.12fr 1fr;
    align-items: stretch;
  }
}

.ptops-panel {
  background: var(--ptops-surface);
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--ptops-shadow);
}

.ptops-panel-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ptops-brand);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(45, 106, 79, 0.2);
}

.ptops-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.ptops-stat {
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 0.65rem 0.75rem;
  background: #f5faf9;
  border-radius: var(--ptops-radius-sm);
  border: 1px solid var(--ptops-border);
  color: var(--ptops-text);
}

.ptops-stat--emphasis {
  grid-column: 1 / -1;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #e6f4ea 0%, #f0faf3 100%);
  border-color: rgba(64, 145, 108, 0.45);
}

.ptops-pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.ptops-pay-row form {
  margin: 0;
}

.ptops-panel-hint {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  color: var(--ptops-muted);
  line-height: 1.45;
}

.ptops-parcel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.ptops-parcel-actions #manualParcelNo {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 100%;
}

.ptops-parcel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.ptops-link-prominent {
  font-weight: 600;
  font-size: 1rem;
}

.ptops-home-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ptops-muted);
}

.ptops-home .message,
.ptops-home .debugMessage {
  margin: 0 0 1rem;
}

.ptops-home-grid-section {
  margin-top: 0.25rem;
}

.ptops-section-heading {
  margin: 0 0 0.65rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ptops-brand);
}

.ptops-home-grid-section .ptops-table-shell {
  margin-top: 0;
}

.nav {
  background: var(--ptops-surface);
  border-radius: var(--ptops-radius);
  box-shadow: var(--ptops-shadow);
  border: 1px solid var(--ptops-border);
  padding: 0.75rem !important;
}

.main {
  background: var(--ptops-surface);
  border-radius: var(--ptops-radius);
  box-shadow: var(--ptops-shadow);
  border: 1px solid var(--ptops-border);
  padding: 0.75rem !important;
}

.foot {
  padding: 1rem;
  color: var(--ptops-muted);
  font-size: 0.9rem;
}

/* --- DataTables: modern wrapper (replaces legacy float layout) --- */
.ptops-table-shell {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0 0;
}

/* Card shell: #example_wrapper (injected by DataTables) */
.ptops-table-shell .dataTables_wrapper {
  position: relative;
  float: none !important;
  clear: both !important;
  zoom: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0 !important;
  background: var(--ptops-surface);
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius);
  box-shadow: var(--ptops-shadow-lg);
  overflow: visible;
}

/* Custom dom: toolbar row (length + filter) */
.ptops-table-shell .ptops-dt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, #f4f8f9 0%, #e8f0f2 100%);
  border-bottom: 1px solid var(--ptops-border);
}

.ptops-table-shell .ptops-dt-toolbar .dataTables_length,
.ptops-table-shell .ptops-dt-toolbar .dataTables_filter {
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--ptops-text) !important;
  font-size: 0.9375rem;
}

.ptops-table-shell .ptops-dt-toolbar .dataTables_length {
  text-align: left !important;
}

.ptops-table-shell .ptops-dt-toolbar .dataTables_filter {
  text-align: right !important;
  margin-left: auto !important;
}

.ptops-table-shell .ptops-dt-toolbar .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-weight: 500;
  color: var(--ptops-muted);
}

.ptops-table-shell .ptops-dt-toolbar .dataTables_length label {
  font-weight: 500;
  color: var(--ptops-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ptops-table-shell .ptops-dt-toolbar .dataTables_length select {
  font: inherit;
  padding: 0.35rem 2rem 0.35rem 0.6rem;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  background-color: var(--ptops-surface);
  color: var(--ptops-text);
  cursor: pointer;
}

/* Processing indicator between toolbar and table */
.ptops-table-shell .dataTables_wrapper .dataTables_processing {
  float: none !important;
  clear: both !important;
  z-index: 3;
  border-radius: var(--ptops-radius-sm);
}

/* Table region: use full shell width; no inner horizontal scrollbar on large screens */
.ptops-table-shell .ptops-table-panel {
  width: 100%;
  max-width: 100%;
  overflow-x: visible;
  border-bottom: 1px solid var(--ptops-border);
  background: var(--ptops-surface);
}

.ptops-table-shell .ptops-table-panel > table.dataTable {
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  max-width: none;
  min-width: 0;
  table-layout: auto;
}

/* Scrolling DataTables (if enabled later) */
.ptops-table-shell .dataTables_wrapper .dataTables_scroll {
  width: 100% !important;
}

.ptops-table-shell .dataTables_wrapper .dataTables_scrollHead,
.ptops-table-shell .dataTables_wrapper .dataTables_scrollBody {
  border-color: var(--ptops-border);
}

.ptops-table-shell .dataTables_wrapper .dataTables_scrollBody {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* TableTools (if initialized) */
.ptops-table-shell .dataTables_wrapper .DTTT_container {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--ptops-border);
  background: #fafcfc;
}

/* Footer row: info + pagination */
.ptops-table-shell .ptops-dt-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.65rem 1rem;
  background: #f6fafb;
  border-top: 1px solid var(--ptops-border);
}

.ptops-table-shell .ptops-dt-footer .dataTables_info {
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--ptops-muted) !important;
  font-size: 0.875rem;
}

.ptops-table-shell .ptops-dt-footer .dataTables_paginate {
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: right !important;
}

/* Page jump + pagination grouped on the right */
.ptops-table-shell .ptops-dt-pager-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  justify-content: flex-end;
}

.ptops-table-shell .ptops-dt-goto {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--ptops-muted);
}

.ptops-table-shell .ptops-dt-goto label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.ptops-table-shell .ptops-dt-goto input.ptops-dt-page-input {
  width: 3.75rem;
  min-width: 3rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  background: var(--ptops-surface);
  font: inherit;
  text-align: center;
}

.ptops-table-shell .ptops-dt-goto input.ptops-dt-page-input:focus {
  outline: none;
  border-color: var(--ptops-focus);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.ptops-table-shell .ptops-dt-goto input.ptops-dt-page-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 639px) {
  .ptops-table-shell .ptops-dt-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ptops-table-shell .ptops-dt-footer .dataTables_paginate {
    text-align: center !important;
  }

  .ptops-table-shell .ptops-dt-pager-cluster {
    justify-content: center;
  }
}

/* Pagination buttons */
.ptops-table-shell .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--ptops-radius-sm) !important;
  border: 1px solid var(--ptops-border) !important;
  background: var(--ptops-surface) !important;
  color: var(--ptops-text) !important;
  margin: 0.15rem !important;
  padding: 0.35rem 0.65rem !important;
  min-width: 2.25rem !important;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.ptops-table-shell .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #eef6f2 !important;
  border-color: var(--ptops-accent) !important;
  color: var(--ptops-brand) !important;
}

.ptops-table-shell .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.ptops-table-shell .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: linear-gradient(180deg, var(--ptops-brand-mid) 0%, var(--ptops-brand) 100%) !important;
  border-color: var(--ptops-brand-mid) !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(27, 67, 50, 0.2);
}

.ptops-table-shell .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.45 !important;
}

.ptops-table-shell .dataTables_wrapper .dataTables_paginate .paginate_button:not(.disabled):not(.current):focus-visible {
  outline: 2px solid var(--ptops-focus) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px var(--ptops-surface), 0 0 0 4px var(--ptops-focus) !important;
  z-index: 1;
}

.ptops-table-shell .dataTables_wrapper .dataTables_paginate .paginate_button.current:not(.disabled):focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 2px !important;
  box-shadow:
    0 0 0 3px var(--ptops-focus),
    0 1px 2px rgba(27, 67, 50, 0.2) !important;
  z-index: 1;
}

/* Search field */
.ptops-table-shell .ptops-dt-toolbar .dataTables_filter input {
  margin-left: 0 !important;
  min-width: min(100%, 14rem);
  padding: 0.45rem 0.75rem !important;
  border: 1px solid var(--ptops-border) !important;
  border-radius: var(--ptops-radius-sm) !important;
  background: var(--ptops-surface) !important;
  font: inherit !important;
}

.ptops-table-shell .ptops-dt-toolbar .dataTables_filter input:focus {
  outline: none;
  border-color: var(--ptops-focus) !important;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

@media (max-width: 900px) {
  .ptops-table-shell .ptops-table-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

table.dataTable thead th {
  background: linear-gradient(180deg, #f0f5f6 0%, #e2ebee 100%) !important;
  color: var(--ptops-brand) !important;
  font-weight: 600 !important;
  border-bottom: 2px solid var(--ptops-border) !important;
}

table.dataTable tbody tr:nth-child(even) {
  background-color: #f7fafb !important;
}

table.dataTable tbody tr:hover {
  background-color: #eef6f2 !important;
}

/* --- Generic tables --- */
table {
  border-collapse: collapse;
}

td.highlight {
  background-color: #fff8e6 !important;
}

/* --- Misc --- */
.xallx {
  background: transparent !important;
}

.totalText {
  color: var(--ptops-brand-mid) !important;
}

.redtext {
  color: var(--ptops-danger) !important;
}

/* --- User management & form grids --- */
.ptops-back-link {
  font-weight: 600;
}

.ptops-usermgmt .message,
.ptops-usermgmt-message {
  min-height: 1.25rem;
  margin-bottom: 1rem;
  color: var(--ptops-brand-mid) !important;
}

/* User management page: readable copy (legacy class names + global button style) */
.ptops-usermgmt {
  color: var(--ptops-text);
}

.ptops-usermgmt .ptops-home-heading.whitetextTitle,
.ptops-usermgmt h1.ptops-home-heading {
  color: var(--ptops-brand) !important;
}

.ptops-usermgmt .ptops-home-fiscalyear.whitelittle {
  color: var(--ptops-muted) !important;
}

/* Tab + column-sort controls are <button>; override global green/white CTA */
.ptops-usermgmt button.ptops-usermgmt-tab {
  color: var(--ptops-muted) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.ptops-usermgmt button.ptops-usermgmt-tab:hover {
  filter: none !important;
  transform: none !important;
  color: var(--ptops-text) !important;
  background: rgba(255, 255, 255, 0.65) !important;
}

.ptops-usermgmt button.ptops-usermgmt-tab.is-active {
  color: var(--ptops-brand) !important;
  background: var(--ptops-surface) !important;
  box-shadow: var(--ptops-shadow) !important;
}

.ptops-usermgmt button.ptops-usermgmt-sort {
  color: var(--ptops-brand) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.ptops-usermgmt button.ptops-usermgmt-sort:hover {
  filter: none !important;
  transform: none !important;
  color: var(--ptops-brand) !important;
  background: rgba(255, 255, 255, 0.5) !important;
}

.ptops-usermgmt button.ptops-usermgmt-sort:active {
  transform: none !important;
}

.ptops-usermgmt-detail-actions #btnCancel {
  background: var(--ptops-bg-alt) !important;
  color: var(--ptops-text) !important;
  border: 1px solid var(--ptops-border) !important;
  box-shadow: none !important;
  filter: none !important;
}

.ptops-usermgmt-detail-actions #btnCancel:hover {
  filter: brightness(0.98) !important;
  background: #e2ebee !important;
}

/* User management — tabbed lists + sortable tables */
.ptops-usermgmt-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.25rem;
  background: #eef3f4;
  border-radius: var(--ptops-radius);
  border: 1px solid var(--ptops-border);
}

.ptops-usermgmt-tab {
  flex: 1 1 auto;
  min-width: 7.5rem;
  margin: 0;
  padding: 0.55rem 0.85rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ptops-muted);
  background: transparent;
  border: none;
  border-radius: var(--ptops-radius-sm);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.ptops-usermgmt-tab:hover {
  color: var(--ptops-text);
  background: rgba(255, 255, 255, 0.65);
}

.ptops-usermgmt-tab.is-active {
  color: var(--ptops-brand);
  background: var(--ptops-surface);
  box-shadow: var(--ptops-shadow);
}

.ptops-usermgmt-tabpanel {
  margin-bottom: 0.5rem;
}

.ptops-usermgmt-tabpanel[hidden] {
  display: none !important;
}

.ptops-usermgmt-table-wrap {
  max-height: min(52vh, 28rem);
  overflow: auto;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius);
  background: var(--ptops-surface);
  box-shadow: var(--ptops-shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 106, 79, 0.4) #e8eef0;
}

.ptops-usermgmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.ptops-usermgmt-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.ptops-usermgmt-table thead tr {
  background: linear-gradient(180deg, #f0f5f6 0%, #e2ebee 100%);
  border-bottom: 2px solid var(--ptops-border);
}

.ptops-usermgmt-table th {
  padding: 0;
  text-align: left;
  font-weight: 600;
  color: var(--ptops-brand);
}

.ptops-usermgmt-sort {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-weight: 600;
  color: inherit;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 0;
}

.ptops-usermgmt-sort:hover {
  background: rgba(255, 255, 255, 0.5);
}

.ptops-usermgmt-table thead tr.ptops-usermgmt-filter-row {
  background: #f2f7f8;
  border-bottom: 1px solid var(--ptops-border);
}

.ptops-usermgmt-table thead tr.ptops-usermgmt-filter-row th {
  padding: 0.4rem 0.55rem;
  vertical-align: middle;
  font-weight: 500;
  color: var(--ptops-text);
}

.ptops-usermgmt-col-filter {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  background: #fff;
  color: var(--ptops-text);
}

.ptops-usermgmt-col-filter:focus {
  outline: 2px solid var(--ptops-focus);
  outline-offset: 1px;
  border-color: var(--ptops-brand-mid);
}

.ptops-usermgmt-sort.is-sorted::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: auto;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  opacity: 0.75;
}

.ptops-usermgmt-sort.is-sorted-asc::after {
  border-bottom: 6px solid var(--ptops-brand-mid);
  border-top: 0;
}

.ptops-usermgmt-sort.is-sorted-desc::after {
  border-top: 6px solid var(--ptops-brand-mid);
  border-bottom: 0;
}

.ptops-usermgmt-table tbody tr {
  border-bottom: 1px solid #e8eef0;
  transition: background 0.12s ease;
}

.ptops-usermgmt-table tbody tr:nth-child(even) {
  background: #f9fbfc;
}

.ptops-usermgmt-table tbody tr:hover {
  background: #eef6f2;
  cursor: pointer;
}

.ptops-usermgmt-table tbody tr.is-selected {
  background: linear-gradient(90deg, #e6f4ea 0%, #dff3e8 100%);
  box-shadow: inset 3px 0 0 var(--ptops-accent);
}

.ptops-usermgmt-table td {
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
  color: var(--ptops-text);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ptops-usermgmt-table td:nth-child(1),
.ptops-usermgmt-table td:nth-child(2) {
  max-width: 12rem;
}

.ptops-usermgmt-table td:nth-child(3),
.ptops-usermgmt-table td:nth-child(4) {
  max-width: 14rem;
}

.ptops-usermgmt-badge {
  display: inline-block;
  margin-right: 0.25rem;
  padding: 0.12rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
}

.ptops-usermgmt-badge--me {
  background: #dbeafe;
  color: #1e40af;
}

.ptops-usermgmt-badge--unverified {
  background: #fef3c7;
  color: #92400e;
}

.ptops-usermgmt-muted {
  font-size: 0.85rem;
  color: var(--ptops-muted);
}

.ptops-usermgmt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--ptops-border);
}

/* --- Admin: application logs (viewlogs.php) --- */
.ptops-viewlogs-hero-tag {
  font-weight: 600;
  color: var(--ptops-muted);
}

.ptops-viewlogs-panel .ptops-panel-hint code {
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  background: #eef2f4;
  border-radius: 4px;
}

.ptops-viewlogs-limit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
}

.ptops-viewlogs-limit-form--bottom {
  margin: 1.25rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--ptops-border);
}

.ptops-viewlogs-limit-select {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  background: #fafcfc;
  color: var(--ptops-text);
  min-width: 8rem;
}

.ptops-viewlogs-count {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ptops-muted);
}

.ptops-viewlogs-empty {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ptops-muted);
}

/* View logs: DataTables + per-column filters */
.ptops-viewlogs-dt-shell {
  margin-top: 0.5rem;
}

.ptops-viewlogs-dt-shell .dataTables_wrapper .dataTable thead .ptops-viewlogs-filter-row th {
  padding: 0.4rem 0.55rem;
  vertical-align: middle;
  background: #f2f7f8;
  border-bottom: 1px solid var(--ptops-border);
}

.ptops-viewlogs-dt-shell .dataTables_wrapper .dataTable thead tr:first-child th {
  font-weight: 600;
  color: var(--ptops-brand);
  background: linear-gradient(180deg, #f0f5f6 0%, #e2ebee 100%);
  border-bottom: 2px solid var(--ptops-border);
  padding: 0.65rem 0.75rem;
}

.ptops-viewlogs-filter-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ptops-viewlogs-col-filter {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  background: #fff;
  color: var(--ptops-text);
}

.ptops-viewlogs-col-filter:focus {
  outline: 2px solid var(--ptops-focus);
  outline-offset: 1px;
  border-color: var(--ptops-brand-mid);
}

.ptops-viewlogs-dt-shell table.dataTable tbody td {
  vertical-align: top;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ptops-viewlogs-dt-shell table.dataTable tbody td.ptops-viewlogs-msg-cell {
  max-width: min(42rem, 55vw);
}

.ptops-viewlogs-dt-shell .dataTables_wrapper .dataTable tbody tr:hover {
  cursor: default;
}

/* --- Admin: system settings (systemsettings.php) --- */
.ptops-syssettings-hero-tag {
  font-weight: 600;
  color: var(--ptops-muted);
}

.ptops-syssettings-panel .ptops-panel-hint {
  margin-top: 0.35rem;
}

.ptops-syssettings-empty {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ptops-muted);
}

.ptops-syssettings-table-shell {
  margin-top: 0.65rem;
  overflow-x: auto;
}

.ptops-syssettings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ptops-syssettings-table th,
.ptops-syssettings-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--ptops-border);
  vertical-align: middle;
  text-align: left;
}

.ptops-syssettings-table thead th {
  font-weight: 600;
  color: var(--ptops-brand);
  background: linear-gradient(180deg, #f0f5f6 0%, #e2ebee 100%);
  border-bottom: 2px solid var(--ptops-border);
}

.ptops-syssettings-name {
  font-weight: 600;
  width: 22%;
  min-width: 9rem;
}

.ptops-syssettings-value-cell {
  min-width: 14rem;
}

.ptops-syssettings-group-head-row .ptops-syssettings-group-head {
  padding: 0.5rem 0.65rem 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ptops-brand);
  background: #eef4f6;
  border-bottom: 1px solid var(--ptops-border);
}

.ptops-syssettings-group-head-row + tr .ptops-syssettings-name,
.ptops-syssettings-group-head-row + tr .ptops-syssettings-value-cell {
  border-top: none;
}

.ptops-syssettings-roll-row .ptops-syssettings-roll-cell {
  padding: 0.85rem 0.65rem 0.35rem;
  background: #fafcfc;
  border-bottom: 1px solid var(--ptops-border);
}

.ptops-syssettings-roll-form {
  margin: 0;
}

.ptops-syssettings-roll-btn {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: var(--ptops-radius-sm);
  cursor: pointer;
  border: 1px solid var(--ptops-brand-mid);
  background: linear-gradient(180deg, #f4fafb 0%, #e2ebee 100%);
  color: var(--ptops-brand);
}

.ptops-syssettings-roll-btn:hover {
  filter: brightness(0.97);
}

.ptops-syssettings-row-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.ptops-syssettings-input {
  flex: 1 1 12rem;
  min-width: 8rem;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  background: #fff;
  color: var(--ptops-text);
  box-sizing: border-box;
}

.ptops-syssettings-input:focus {
  outline: 2px solid var(--ptops-focus);
  outline-offset: 1px;
  border-color: var(--ptops-brand-mid);
}

.ptops-syssettings-select {
  flex: 0 1 auto;
  min-width: 6.5rem;
  background: #fafcfc;
}

.ptops-syssettings-cancel,
.ptops-syssettings-save {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--ptops-radius-sm);
  cursor: pointer;
}

.ptops-syssettings-cancel {
  color: var(--ptops-text);
  background: var(--ptops-surface);
  border: 1px solid var(--ptops-border);
}

.ptops-syssettings-cancel:hover {
  background: var(--ptops-bg);
  border-color: var(--ptops-brand-mid);
}

.ptops-syssettings-cancel:focus-visible {
  outline: 2px solid var(--ptops-focus);
  outline-offset: 1px;
}

/* Kickstart sets `button { display: inline-block }`, which beats the UA [hidden] rule. */
button.ptops-syssettings-cancel[hidden] {
  display: none !important;
}

.ptops-usermgmt-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--ptops-border);
}

.ptops-form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ptops-form-grid--twocol .ptops-form-row {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
  gap: 0.65rem 1rem;
  align-items: center;
}

@media (max-width: 540px) {
  .ptops-form-grid--twocol .ptops-form-row {
    grid-template-columns: 1fr;
  }
}

.ptops-form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ptops-muted);
}

.ptops-form-control input,
.ptops-form-control select {
  width: 100%;
  max-width: 28rem;
}

/* --- Bulk parcel management --- */
.ptops-bulk-parcels .ptops-section-heading {
  margin-bottom: 1rem;
}

.ptops-bulk-workspace {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 900px) {
  .ptops-bulk-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }
}

.ptops-bulk-actions-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.ptops-bulk-step {
  margin-bottom: 0;
}

.ptops-bulk-step-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
}

.ptops-bulk-file {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.ptops-bulk-file-label {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ptops-muted);
}

.ptops-bulk-instructions {
  min-width: 0;
  text-align: left !important;
}

@media (min-width: 900px) {
  .ptops-bulk-instructions {
    position: sticky;
    top: 0.75rem;
  }
}

.ptops-bulk-instructions .ptops-bulk-step-title {
  margin-top: 0;
  text-align: left;
}

.ptops-bulk-instructions .ptops-bulk-spec {
  line-height: 1.35;
  text-align: left;
}

.ptops-bulk-spec ul {
  list-style: none;
  margin: 0.15rem 0 0.4rem;
  padding-left: 0;
}

/* Indent instruction lines under each “Import file specification …” heading */
.ptops-bulk-spec > p + ul {
  margin-left: 1.1rem;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(45, 106, 79, 0.22);
}

.ptops-bulk-spec li {
  margin: 0 0 0.12rem;
  padding-left: 0;
  line-height: 1.35;
}

.ptops-bulk-spec li:last-child {
  margin-bottom: 0;
}

.ptops-bulk-spec p {
  margin: 0.28rem 0 0;
  line-height: 1.35;
}

.ptops-bulk-spec p:first-child {
  margin-top: 0;
}

.ptops-bulk-spec--check {
  margin-top: 0.55rem !important;
  color: var(--ptops-brand-mid);
}

.ptops-bulk-ops {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  max-width: none;
}

.ptops-bulk-actions-col .ptops-bulk-ops input[type="button"] {
  width: 100%;
  text-align: center;
}

.ptops-bulk-progress {
  text-align: center;
}

.ptops-bulk-progress-title {
  text-align: left;
}

.ptops-bulk-progressbar {
  display: none;
  width: min(100%, 320px);
  height: 1.15rem;
  margin: 0 auto 0.75rem;
}

.ptops-bulk-status {
  min-height: 1.25rem;
}

.ptops-bulk-loaded {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--ptops-muted);
}

/* --- Batch lookup (internal tool; shell matches ptops-home hero) --- */
.ptops-lookup-page .ptops-lookup-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.ptops-lookup-page .ptops-lookup-panel .ptops-panel-hint {
  margin: 0 0 1rem;
  max-width: 40rem;
}

.ptops-lookup-detail .ptops-form-control input[disabled],
.ptops-lookup-detail .ptops-form-control select[disabled] {
  opacity: 0.95;
  cursor: not-allowed;
}

.ptops-lookup-nav {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ptops-border);
}

/* --- Password reset (forgotpassword.php; shell matches home hero) --- */
.ptops-forgot-page .ptops-forgot-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.ptops-forgot-page .ptops-forgot-panel {
  width: 100%;
  max-width: min(28rem, 100%);
  margin-left: auto;
  margin-right: auto;
}

.ptops-forgot-page .ptops-forgot-errors {
  margin: 0 auto 1rem;
  max-width: min(40rem, 100%);
}

.ptops-forgot-page .ptops-forgot-errors .error,
.ptops-forgot-page .ptops-forgot-errors p {
  margin: 0 0 0.5rem;
}

.ptops-forgot-page .ptops-forgot-errors .error:last-child,
.ptops-forgot-page .ptops-forgot-errors p:last-child {
  margin-bottom: 0;
}

.ptops-forgot-nav {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ptops-border);
  justify-content: center;
}

.ptops-req-star {
  color: var(--ptops-brand);
  font-weight: 800;
}

/* --- Account registration (registration.php; shell matches home hero) --- */
.ptops-register-page .ptops-register-workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.ptops-register-page .ptops-register-panel {
  width: 100%;
  max-width: min(36rem, 100%);
  margin-left: auto;
  margin-right: auto;
}

.ptops-register-page .ptops-register-errors {
  margin: 0 auto 1rem;
  max-width: min(40rem, 100%);
}

.ptops-register-page .ptops-register-errors .error,
.ptops-register-page .ptops-register-errors p {
  margin: 0 0 0.5rem;
}

.ptops-register-page .ptops-register-errors .error:last-child,
.ptops-register-page .ptops-register-errors p:last-child {
  margin-bottom: 0;
}

.ptops-register-intro {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ptops-muted);
}

.ptops-register-intro a {
  color: var(--ptops-brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ptops-register-intro a:hover {
  color: var(--ptops-brand-mid);
}

.ptops-register-rules {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: #f5faf9;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  font-size: 0.875rem;
  color: var(--ptops-text);
  line-height: 1.45;
}

.ptops-register-rules__title {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ptops-muted);
}

.ptops-register-rules ul {
  margin: 0;
  padding-left: 1.25rem;
}

.ptops-register-rules > ul > li {
  margin: 0.35rem 0;
}

.ptops-register-rules ul ul {
  margin: 0.35rem 0 0;
}

.ptops-register-section-heading {
  margin: 1.35rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ptops-brand);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(45, 106, 79, 0.2);
}

.ptops-register-panel form .ptops-register-section-heading:first-of-type {
  margin-top: 0;
}

.ptops-register-required-note {
  margin-top: 1rem;
  margin-bottom: 0;
}

.ptops-register-nav {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ptops-border);
  justify-content: center;
}

/* --- Payment confirmation modal (home pay buttons) --- */
body.ptops-modal-open {
  overflow: hidden;
}

.ptops-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ptops-modal.is-open {
  display: flex;
}

.ptops-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 40, 45, 0.45);
  backdrop-filter: blur(2px);
}

.ptops-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  max-height: min(90vh, 640px);
  overflow-y: auto;
  background: var(--ptops-surface);
  border-radius: var(--ptops-radius);
  box-shadow: var(--ptops-shadow-lg);
  border: 1px solid var(--ptops-border);
  padding: 1.35rem 1.5rem 1.25rem;
}

.ptops-modal__title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ptops-brand);
  line-height: 1.3;
}

.ptops-pay-modal__summary {
  margin-bottom: 1rem;
}

.ptops-pay-modal__intro {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--ptops-muted);
  font-weight: 600;
}

.ptops-pay-modal__amount {
  margin: 0;
  padding: 0.65rem 0.85rem;
  background: #f5faf9;
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ptops-text);
  line-height: 1.4;
}

.ptops-pay-modal__and {
  margin: 0.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ptops-muted);
}

.ptops-pay-modal__total-field {
  margin: 0 0 1rem;
}

.ptops-pay-modal__total-label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ptops-muted);
}

.ptops-pay-modal__total-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ptops-text);
  background: var(--ptops-surface);
  border: 1px solid var(--ptops-border);
  border-radius: var(--ptops-radius-sm);
  cursor: default;
}

.ptops-pay-modal__total-input:focus {
  outline: none;
  border-color: var(--ptops-focus);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}

.ptops-pay-modal__notes {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  font-size: 0.875rem;
  color: var(--ptops-muted);
  line-height: 1.45;
}

.ptops-pay-modal__notes li {
  margin-bottom: 0.4rem;
}

.ptops-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.ptops-modal__btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--ptops-radius-sm);
  padding: 0.55rem 1.15rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  cursor: pointer;
  border: none;
}

/* Escape global `button { … !important }` CTA styles so Cancel vs Continue are visually distinct (1.4.1 Use of Color). */
button.ptops-modal__btn--primary {
  background: linear-gradient(180deg, var(--ptops-brand-mid) 0%, var(--ptops-brand) 100%) !important;
  background-image: linear-gradient(180deg, var(--ptops-brand-mid) 0%, var(--ptops-brand) 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 1px 2px rgba(27, 67, 50, 0.25);
}

button.ptops-modal__btn--primary:hover {
  filter: none !important;
  background: linear-gradient(180deg, var(--ptops-btn-hover-start) 0%, var(--ptops-brand) 100%) !important;
  background-image: linear-gradient(180deg, var(--ptops-btn-hover-start) 0%, var(--ptops-brand) 100%) !important;
  color: #fff !important;
  border: none !important;
}

button.ptops-modal__btn--secondary {
  background: var(--ptops-bg-alt) !important;
  background-image: none !important;
  color: var(--ptops-text) !important;
  border: 1px solid var(--ptops-border) !important;
  box-shadow: none !important;
}

button.ptops-modal__btn--secondary:hover {
  filter: none !important;
  background: #e2ebee !important;
  background-image: none !important;
  color: var(--ptops-text) !important;
  border: 1px solid var(--ptops-border) !important;
}

/* Focus: visible ring for keyboard users (2.4.7 Focus Visible; 2.4.13 Focus Appearance AA). */
button.ptops-modal__btn:focus {
  outline: none;
}

button.ptops-modal__btn:focus-visible {
  outline: 2px solid var(--ptops-focus);
  outline-offset: 2px;
  /* !important: secondary uses box-shadow: none !important in default state */
  box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.35) !important;
}

button.ptops-modal__btn--primary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow:
    0 0 0 3px var(--ptops-focus),
    0 1px 2px rgba(27, 67, 50, 0.25) !important;
}
