:root{
  --wsp-bg:#f3f4f6;
  --wsp-card:#ffffff;
  --wsp-border:#e5e7eb;
  --wsp-text:#111827;
  --wsp-muted:#6b7280;
  --wsp-primary:#4a2d7f; /* purple */
  --wsp-accent:#1fa3b8;  /* teal */
}

/* -------------------------------------------------------------------------
   Theme chrome overrides (portal pages only)
   Many themes output a "page title"/hero area (e.g. "Billing") above our app UI.
   We hide those elements so the portal feels like a standalone application.
   ------------------------------------------------------------------------- */

body.wsp-portal-page .entry-header,
body.wsp-portal-page .page-header,
body.wsp-portal-page .wp-block-post-title,
body.wsp-portal-page h1.entry-title,
body.wsp-portal-page h1.page-title,
body.wsp-portal-page .elementor-page-title,
body.wsp-portal-page .elementor-location-single h1{
  display:none !important;
}

/* Make the portal page background consistent with the app shell and
   remove common theme spacing above/below the content. */
body.wsp-portal-page{background:var(--wsp-bg) !important;}
body.wsp-portal-page #page,
body.wsp-portal-page .site,
body.wsp-portal-page .site-content,
body.wsp-portal-page #content,
body.wsp-portal-page .content,
body.wsp-portal-page .content-area{
  background:transparent !important;
}
body.wsp-portal-page .site-main,
body.wsp-portal-page .content-area,
body.wsp-portal-page .page-content,
body.wsp-portal-page .site-content,
body.wsp-portal-page #content,
body.wsp-portal-page .content{
  padding-top:0 !important;
  margin-top:0 !important;
  padding-bottom:0 !important;
  margin-bottom:0 !important;
}

/* Additional theme containers that commonly add "content padding" above/below
   the page content. We aggressively remove it for portal pages so the app shell
   sits flush against the site header/footer. */
body.wsp-portal-page .entry-content,
body.wsp-portal-page .container,
body.wsp-portal-page .container-fluid,
body.wsp-portal-page .wrap,
body.wsp-portal-page .wrapper,
body.wsp-portal-page .inner-wrap,
body.wsp-portal-page .ast-container,
body.wsp-portal-page .site-content > .container,
body.wsp-portal-page .site-content > .wrap,
body.wsp-portal-page .site-content > .ast-container{
  padding-top:0 !important;
  margin-top:0 !important;
  padding-bottom:0 !important;
  margin-bottom:0 !important;
}

body.wsp-portal-page .site-header{margin-bottom:0 !important;}
body.wsp-portal-page .site-footer{margin-top:0 !important;}

/* Astra-specific spacing resets (Astra adds generous vertical padding around
   the content container in separate-container mode). */
body.wsp-portal-page.ast-separate-container #primary,
body.wsp-portal-page.ast-separate-container #content,
body.wsp-portal-page.ast-separate-container .site-content,
body.wsp-portal-page.ast-separate-container .ast-container,
body.wsp-portal-page.ast-separate-container .content-area,
body.wsp-portal-page.ast-separate-container .site-main,
body.wsp-portal-page.ast-separate-container .ast-article-single,
body.wsp-portal-page.ast-separate-container .ast-article-post,
body.wsp-portal-page.ast-separate-container .ast-woocommerce-container,
body.wsp-portal-page.ast-separate-container .ast-container > .ast-row,
body.wsp-portal-page.ast-separate-container .ast-container > .ast-container,
body.wsp-portal-page.ast-separate-container .ast-container .ast-container,
body.wsp-portal-page.ast-separate-container .ast-container .ast-row{
  padding-top:0 !important;
  padding-bottom:0 !important;
  margin-top:0 !important;
  margin-bottom:0 !important;
}

/* Some Astra variants add padding directly to the article element. */
body.wsp-portal-page.ast-separate-container .ast-article-single,
body.wsp-portal-page.ast-separate-container .ast-article-post{
  padding:0 !important;
}

/* -------------------------------------------------------------------------
   Portal shell (matches class-frontend-portal.php markup)
   ------------------------------------------------------------------------- */

/*
  Most WP themes wrap page content in a centered container with a max-width.
  The staff portal should behave like an app and use the full viewport width.
*/
.wsp-portal{
  background:var(--wsp-bg);
  /* Fill the viewport so the grey app background reaches the footer */
  min-height:100vh;
  /* Reduce the "dead" space between the site header and the app UI */
  padding:0 18px 0 18px;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  color:var(--wsp-text);

  /* Break out of theme content containers */
  width:100vw;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
}

/* Core card styling used throughout the portal */
.wsp-card{
  background:var(--wsp-card);
  border:1px solid var(--wsp-border);
  border-radius:16px;
  box-shadow:0 8px 24px rgba(15,23,42,0.06);
  overflow:hidden;
}

/* Optional internal padding helper for cards that contain form fields */
.wsp-card-pad{padding:16px;}

/* Dashboard KPI cards: 4-up on desktop, stack on small screens */
.wsp-grid > .wsp-card{grid-column:span 3;}
@media (max-width:980px){
  .wsp-grid > .wsp-card{grid-column:span 12;}
}

.wsp-topbar{max-width:none;margin:0 auto 12px auto;background:var(--wsp-card);border:1px solid var(--wsp-border);border-radius:16px;box-shadow:0 8px 24px rgba(15,23,42,0.06);padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:14px;}
.wsp-user-name{font-weight:800;color:var(--wsp-text);}
.wsp-link{color:var(--wsp-primary);text-decoration:none;font-weight:800;}
.wsp-link:hover{text-decoration:underline;}
.wsp-link-btn{background:none;border:none;padding:0;margin:0;color:var(--wsp-primary);font:inherit;font-weight:800;cursor:pointer;}
.wsp-link-btn:hover{text-decoration:underline;}

.wsp-layout{max-width:none;margin:0 auto;display:grid;grid-template-columns:260px 1fr;gap:12px;align-items:start;}
@media (max-width:980px){.wsp-layout{grid-template-columns:1fr;}}

.wsp-nav{background:var(--wsp-card);border:1px solid var(--wsp-border);border-radius:16px;box-shadow:0 8px 24px rgba(15,23,42,0.06);padding:10px;display:flex;flex-direction:column;gap:6px;}
.wsp-nav-item{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:12px;text-decoration:none;color:var(--wsp-text);border:1px solid transparent;font-weight:800;font-size:13px;}
.wsp-nav-item:hover{background:#f9fafb;border-color:var(--wsp-border);}
.wsp-nav-item.active{background:#111827;color:#fff;}

.wsp-main{background:transparent;min-width:0;}

/* Page headers / toolbars */
.wsp-pagehead{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 12px 0;flex-wrap:wrap;}
.wsp-muted{color:var(--wsp-muted);font-size:13px;}
.wsp-actions{display:flex;gap:8px;flex-wrap:wrap;}

.wsp-toolbar{background:var(--wsp-card);border:1px solid var(--wsp-border);border-radius:16px;box-shadow:0 8px 24px rgba(15,23,42,0.06);padding:10px 12px;margin:0 0 12px 0;}
.wsp-toolbar-form{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.wsp-toolbar-form input[type="text"],
.wsp-toolbar-form select{padding:10px 12px;border:1px solid var(--wsp-border);border-radius:12px;font-size:13px;min-width:220px;background:#fff;}

/* Buttons used by portal markup */
.wsp-btn.primary{background:var(--wsp-primary);border-color:var(--wsp-primary);color:#fff;}
.wsp-btn.primary:hover{filter:brightness(0.95);background:var(--wsp-primary);}

/* Cards / blocks used by portal */
.wsp-grid{display:grid;grid-template-columns:repeat(12,1fr);gap:12px;margin:0 0 12px 0;}
.wsp-grid > .wsp-card{padding:14px;}

/* KPI row: use a true 4-column grid so cards don't wrap oddly in narrower
   layouts (sidebar present). */
/* Dashboard totals: legacy compact bar (preferred). */
.wsp-kpi-bar{display:flex;gap:18px;flex-wrap:wrap;align-items:stretch;}
.wsp-kpi{min-width:160px;flex:1 1 160px;}
.wsp-kpi-label{font-size:12px;color:var(--wsp-muted);font-weight:800;}
.wsp-kpi-value{font-size:22px;font-weight:900;margin-top:6px;}
.wsp-quicklinks{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px;}
.wsp-card-title{padding:14px 14px 0 14px;font-weight:900;}

.wsp-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin:12px 0 0 0;width:100%;max-width:none;align-items:stretch;}
.wsp-split > *{min-width:0;}
/* Make the two-column blocks feel consistent (same height) */
.wsp-split .wsp-card{height:100%;}
.wsp-split form{display:flex;}
.wsp-split form .wsp-card{flex:1;}
@media (max-width:760px){.wsp-split{grid-template-columns:1fr;}}

/* Totals + record payment cards contain controls that can overflow a clipped
   card when the viewport is narrower. Allow them to breathe. */
.wsp-card--totals,.wsp-card--record{overflow:visible;}

.wsp-tablewrap{overflow:auto;border-top:1px solid var(--wsp-border);margin-top:12px;}
.wsp-table{width:100%;border-collapse:collapse;font-size:13px;background:#fff;}
.wsp-table th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--wsp-muted);text-align:left;padding:10px 14px;border-bottom:1px solid var(--wsp-border);white-space:nowrap;}
.wsp-table td{padding:10px 14px;border-bottom:1px solid #f3f4f6;vertical-align:top;}
.wsp-table tr:hover td{background:#fafafa;}
.wsp-table .num{text-align:right;white-space:nowrap;}

/* Invoice editor helpers */
.wsp-form{display:flex;flex-direction:column;gap:12px;}
.wsp-form .wsp-card{padding:0;}
.wsp-form-row{padding:14px;display:flex;flex-direction:column;gap:6px;}
.wsp-form-row label{font-size:12px;color:var(--wsp-muted);font-weight:800;}
.wsp-form-row input,
.wsp-form-row select,
.wsp-form-row textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--wsp-border);
  border-radius:12px;
  background:#fff;
  font-size:13px;
  box-sizing:border-box;
}
.wsp-form-row textarea{min-height:76px;}
.wsp-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:0 14px 14px 14px;}
.wsp-form-grid .wsp-form-row{padding:0;}
@media (max-width:980px){.wsp-form-grid{grid-template-columns:1fr;}}

/* Invoice editor: make the customer selector feel less "huge" compared to the
   rest of the form by constraining its maximum width on large screens. */
/* Invoice editor: keep the meta inputs compact on large screens. */
.wsp-customer-select{max-width:420px;}
.wsp-invoice-meta-grid{display:grid;grid-template-columns:minmax(260px,420px) 180px 220px;gap:12px;padding:0 14px 14px 14px;align-items:end;}
.wsp-invoice-meta-grid .wsp-form-row{padding:0;}
@media (max-width:980px){
  .wsp-invoice-meta-grid{grid-template-columns:1fr;}
  .wsp-customer-select{max-width:none;}
}

/* Keep the notes box from spanning an overly wide line on desktop. */
.wsp-notes-row textarea{max-width:860px;}

/* Line items: enforce a consistent grid so columns feel even and inputs don't
   look misaligned across different input types (date/number/select). */
#wsp-items-table{table-layout:fixed;}
#wsp-items-table input,
#wsp-items-table select{
  width:100%;
  min-width:0;
  box-sizing:border-box;
  padding:8px 10px;
  height:40px;
}
#wsp-items-table th,#wsp-items-table td{vertical-align:middle;}

/* Keep duration + its unit on a single line so the row height never changes
   when switching types (therapy minutes vs workshop hours). */
.wsp-duration{display:flex;flex-direction:row;gap:6px;align-items:center;justify-content:flex-start;}
.wsp-duration-unit{font-size:11px;color:var(--wsp-muted);white-space:nowrap;min-width:54px;}
.wsp-unitwrap{display:block;}
.wsp-unitline{display:flex;gap:10px;align-items:center;justify-content:flex-end;}
.wsp-check{font-size:12px;color:var(--wsp-muted);display:flex;gap:6px;align-items:center;white-space:nowrap;margin:0;}
.wsp-check input{margin:0;}
.wsp-item-type{width:100%;}

/* Line item note should not grow too wide on large screens. */
#wsp-items-table td:nth-child(6) input[type="text"]{max-width:420px;}

.wsp-dot{color:#c4c4c4;padding:0 6px;}

/* Screen-reader only helper */
.wsp-sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

.wsp-badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:900;border:1px solid var(--wsp-border);background:#fff;}
.wsp-badge.sent{color:#1d4ed8;border-color:#bfdbfe;background:#eff6ff;}
.wsp-badge.partial{color:#92400e;border-color:#fde68a;background:#fffbeb;}
.wsp-badge.paid{color:#065f46;border-color:#a7f3d0;background:#ecfdf5;}
.wsp-badge.draft{color:#374151;}

/*
 * Footer actions for the invoice editor.
 * In v11 this was a fixed "bar". Users requested it behave like normal page content:
 * you only see it when you scroll to it.
 */
.wsp-footerbar{
  position:static;
  display:block;
  background:transparent;
  border:0;
  padding:0;
  margin:14px 0 0 0;
}

/* legacy sidebar shell removed (portal uses .wsp-topbar + .wsp-layout) */

/* No fixed footerbar, so no extra bottom padding needed. */
.wsp-main{padding:0 0 18px 0;}
.wsp-main-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid var(--wsp-border);}
.wsp-h1{font-size:18px;font-weight:800;margin:0;}
.wsp-h2{font-size:14px;font-weight:800;margin:0;}
.wsp-sub{font-size:13px;color:var(--wsp-muted);margin-top:4px;}

.wsp-actions{display:flex;gap:8px;flex-wrap:wrap;}
.wsp-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 12px;border-radius:12px;border:1px solid var(--wsp-border);background:#fff;color:var(--wsp-text);text-decoration:none;font-size:13px;font-weight:700;cursor:pointer;}
.wsp-btn:hover{background:#f9fafb;}
.wsp-btn-primary{background:var(--wsp-primary);border-color:var(--wsp-primary);color:#fff;}
.wsp-btn-primary:hover{filter:brightness(0.95);background:var(--wsp-primary);}
.wsp-btn-accent{background:var(--wsp-accent);border-color:var(--wsp-accent);color:#fff;}
.wsp-btn-accent:hover{filter:brightness(0.95);background:var(--wsp-accent);}
.wsp-btn-danger{background:#b91c1c;border-color:#b91c1c;color:#fff;}
.wsp-btn-danger:hover{filter:brightness(0.95);background:#b91c1c;}
.wsp-btn-sm{padding:6px 10px;border-radius:10px;font-size:12px;}

.wsp-content{padding:16px;}
.wsp-grid{display:grid;grid-template-columns:repeat(12,1fr);gap:12px;}
.wsp-col-6{grid-column:span 6;}
.wsp-col-4{grid-column:span 4;}
.wsp-col-8{grid-column:span 8;}
.wsp-col-12{grid-column:span 12;}
@media (max-width:980px){.wsp-col-6,.wsp-col-4,.wsp-col-8{grid-column:span 12;}}

.wsp-stat{padding:14px;}
.wsp-stat-label{font-size:12px;color:var(--wsp-muted);}
.wsp-stat-value{font-size:20px;font-weight:900;margin-top:6px;}

.wsp-table-wrap{overflow:auto;border:1px solid var(--wsp-border);border-radius:14px;}
.wsp-table{width:100%;border-collapse:collapse;font-size:13px;background:#fff;}
.wsp-table th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--wsp-muted);text-align:left;padding:10px 10px;border-bottom:1px solid var(--wsp-border);white-space:nowrap;}
.wsp-table td{padding:10px 10px;border-bottom:1px solid #f3f4f6;vertical-align:top;}
.wsp-table tr:hover td{background:#fafafa;}
.wsp-right{text-align:right;}

.wsp-badge{display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:800;border:1px solid var(--wsp-border);background:#fff;}
.wsp-badge.draft{color:#374151;}
.wsp-badge.sent{color:#1d4ed8;border-color:#bfdbfe;background:#eff6ff;}
.wsp-badge.partially_paid{color:#92400e;border-color:#fde68a;background:#fffbeb;}

/* -------------------------------------------------------------------------
   v1.5.5.8 UI overrides (Astra + invoice editor sizing)
   Placed at the end to win against any legacy duplicated rules above.
   ------------------------------------------------------------------------- */

/* KPI bar ("old" look the user preferred): single card with 4 columns */
.wsp-kpi-bar{padding:14px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0 0 12px 0;}
.wsp-kpi-item{padding:6px 12px;}
.wsp-kpi-item:not(:last-child){border-right:1px solid var(--wsp-border);}
@media (max-width:980px){
  .wsp-kpi-bar{grid-template-columns:1fr;}
  .wsp-kpi-item:not(:last-child){border-right:0;border-bottom:1px solid var(--wsp-border);padding-bottom:12px;margin-bottom:8px;}
}

/* Invoice editor sizing: keep customer/due/status compact on desktop */
.wsp-invoice-meta-grid{grid-template-columns:2fr 1fr 1fr;align-items:end;}
@media (max-width:980px){.wsp-invoice-meta-grid{grid-template-columns:1fr;}}
.wsp-customer-select{max-width:520px;}
.wsp-small-field{max-width:240px;}
.wsp-notes-row textarea{max-width:760px;min-height:80px;}

/* Line item alignment + note width */
#wsp-items-table .wsp-item-note{max-width:340px;}
.wsp-unitwrap{align-items:stretch;}
.wsp-unitline{display:flex;align-items:center;gap:10px;justify-content:flex-end;}
.wsp-check-inline{white-space:nowrap;font-size:12px;}
.wsp-check-inline input{width:auto;height:auto;}
.wsp-badge.paid{color:#065f46;border-color:#a7f3d0;background:#ecfdf5;}
.wsp-badge.void{color:#991b1b;border-color:#fecaca;background:#fef2f2;}

.wsp-field{display:flex;flex-direction:column;gap:6px;}
.wsp-label{font-size:12px;color:var(--wsp-muted);font-weight:700;}
.wsp-input,.wsp-select,.wsp-textarea{width:100%;padding:10px 12px;border-radius:12px;border:1px solid var(--wsp-border);background:#fff;font-size:13px;}
.wsp-textarea{min-height:92px;}
.wsp-help{font-size:12px;color:var(--wsp-muted);}

.wsp-items{margin-top:10px;}
.wsp-items .wsp-table th,.wsp-items .wsp-table td{padding:8px;}
.wsp-items input{width:100%;padding:8px 10px;border-radius:10px;border:1px solid var(--wsp-border);font-size:13px;}

.wsp-totals{display:flex;flex-direction:column;gap:6px;align-items:stretch;padding-right:0;}
/* Center the totals block within the card and give it room so the credit UI
 * doesn't collapse into a narrow column. */
.wsp-totals>div{display:flex;justify-content:space-between;gap:18px;width:100%;max-width:420px;margin:0 auto;}
.wsp-totals>div span{color:var(--wsp-muted);font-size:12px;}
.wsp-totals>div strong{font-weight:900;min-width:90px;text-align:right;}

/* Credit apply box (invoice editor totals panel) */
.wsp-creditbox{margin:12px auto 0 auto;padding-top:12px;border-top:1px solid #e7eaf5;max-width:560px;}
.wsp-creditbox-row{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;}
.wsp-creditbox-toggle{display:flex;align-items:center;gap:8px;margin:0;font-size:13px;}
.wsp-creditbox-available{display:flex;align-items:baseline;gap:10px;margin:0;}
.wsp-creditbox-available .wsp-muted{margin-right:4px;white-space:nowrap;}
.wsp-creditbox-amount{margin-top:10px;display:flex;flex-direction:column;gap:6px;align-items:stretch;}
.wsp-creditbox-input{width:100%;max-width:140px;min-width:96px;}
.wsp-creditbox-input:disabled{background:#f3f4f6;color:#111;border-color:#d1d5db;opacity:1;}
.wsp-creditbox-help{display:block;font-size:12px;color:var(--wsp-muted);white-space:nowrap;}

@media (max-width:820px){
  .wsp-creditbox-help{white-space:normal;}
}
.wsp-creditbox-warning{width:100%;font-size:15px;line-height:1.25;font-weight:900;margin-top:4px;color:#b91c1c;}

/* Narrow, centered cards for the invoice editor so the layout matches the
   Totals/Payment history panel width. */
.wsp-card-narrow{max-width:900px;margin-left:auto;margin-right:auto;}

@media (max-width: 520px){
  .wsp-totals>div{max-width:none;}
  .wsp-creditbox{max-width:none;}
  .wsp-creditbox-input{max-width:none;min-width:0;}
  .wsp-creditbox-help{white-space:normal;}
  .wsp-creditbox-row{flex-wrap:wrap;}
}

.wsp-flash{border:1px solid var(--wsp-border);background:#fff;border-radius:14px;padding:10px 12px;margin:0 0 12px 0;font-size:13px;}
.wsp-flash.ok{border-color:#a7f3d0;background:#ecfdf5;}
.wsp-flash.err{border-color:#fecaca;background:#fef2f2;}

/* Loading overlay for async saves/actions */
.wsp-loading{position:fixed;inset:0;display:none;align-items:center;justify-content:center;flex-direction:column;background:rgba(255,255,255,0.75);backdrop-filter:blur(2px);z-index:99999;}
.wsp-loading.active{display:flex;}
.wsp-spinner{width:44px;height:44px;border:4px solid rgba(0,0,0,0.15);border-top-color:rgba(0,0,0,0.65);border-radius:50%;animation:wspSpin .8s linear infinite;}
.wsp-loading-text{margin-top:12px;font-size:13px;font-weight:800;color:rgba(0,0,0,0.75);}
@keyframes wspSpin{to{transform:rotate(360deg);}}

/* Recipient editor (frontend Save & Send) */
.wsp-send-recipients{margin-right:12px;flex:1;min-width:260px;}
.wsp-send-recipients-title{font-weight:800;font-size:13px;margin-bottom:6px;}
.wsp-send-recipients-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start;}
.wsp-send-rec-row label{display:block;font-size:12px;color:var(--wsp-muted);margin-bottom:6px;}
.wsp-recipient-editor{display:flex;flex-wrap:wrap;gap:6px;align-items:center;border:1px solid #d1d5db;border-radius:12px;padding:8px 10px;background:#fff;min-height:42px;}
.wsp-recipient-editor:focus-within{border-color:#4a2d7f;box-shadow:0 0 0 2px rgba(74,45,127,.12)}
.wsp-recipient-tag{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;background:#f3f4f6;font-size:12px;line-height:1;color:#111;}
.wsp-recipient-tag button{border:0;background:transparent;cursor:pointer;line-height:1;font-size:14px;color:#6b7280;padding:0;}
.wsp-recipient-input{border:0;outline:none;min-width:140px;flex:1;font-size:13px;padding:6px 4px;}

@media (max-width: 820px){
  .wsp-send-recipients{margin-right:0;margin-bottom:10px;}
  .wsp-send-recipients-grid{grid-template-columns:1fr;}
}

@media print{
  .wsp-portal-wrap, .wsp-sidebar, .wsp-actions{display:none !important;}
}

.wsp-footerbar-actions{margin-top:16px;display:flex;gap:10px;flex-wrap:wrap;}
.wsp-footerbar-actions .wsp-btn{color:var(--wsp-text)!important;}
.wsp-footerbar-actions .wsp-btn:hover{color:var(--wsp-text)!important;}
.wsp-footerbar-actions .wsp-btn.primary:hover{color:#fff!important;}


/* -----------------------------
   Modal: Email Preview
------------------------------ */
.wsp-modal{position:fixed;inset:0;display:none;z-index:99999;}
.wsp-modal.is-open{display:block;}
.wsp-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,0.55);}
.wsp-modal-card{position:relative;max-width:980px;width:calc(100% - 32px);max-height:calc(100% - 32px);margin:16px auto;background:#fff;border-radius:18px;box-shadow:0 18px 60px rgba(0,0,0,0.35);overflow:hidden;display:flex;flex-direction:column;}
.wsp-modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #e5e7eb;}
.wsp-modal-title{font-size:15px;font-weight:700;}
.wsp-modal-close{border:0;background:transparent;font-size:22px;line-height:1;cursor:pointer;color:#111827;}
.wsp-modal-body{padding:14px 16px;overflow:auto;}
.wsp-modal-footer{padding:12px 16px;border-top:1px solid #e5e7eb;display:flex;justify-content:flex-end;gap:10px;}
.wsp-email-meta{font-size:12px;line-height:1.5;margin-bottom:12px;}
.wsp-email-preview-frame{border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;background:#f9fafb;min-height:360px;}

/* Frontend last sent */
.wsp-last-sent{margin:8px 0 10px 0;padding:10px 12px;border:1px solid #e5e7eb;border-radius:12px;background:#f9fafb;font-size:12px;line-height:1.4;}

.wsp-page-with-footerbar{padding-bottom:90px;}

.wsp-main{padding-bottom:90px;}

/* Notices */
.wsp-alert{margin:16px 0;padding:12px 14px;border-radius:12px;border:1px solid;font-weight:700;line-height:1.4;}
.wsp-alert.success{background:#ecfdf5;border-color:#10b981;color:#065f46;}
.wsp-alert.error{background:#fef2f2;border-color:#ef4444;color:#7f1d1d;}


/* Button defaults (ensure readable against theme overrides) */
.wsp-footerbar-actions .wsp-btn{
  background:#fff;
  border:1px solid var(--wsp-border);
  color:var(--wsp-primary);
}
.wsp-footerbar-actions .wsp-btn:hover,
.wsp-footerbar-actions .wsp-btn:focus{
  background:rgba(99,102,241,0.10);
  color:var(--wsp-primary);
}

/* Primary action (Save) must always be readable */
.wsp-footerbar-actions .wsp-btn.primary{
  background:var(--wsp-primary);
  border-color:var(--wsp-primary);
  color:#fff !important;
}
.wsp-footerbar-actions .wsp-btn.primary:hover,
.wsp-footerbar-actions .wsp-btn.primary:focus{
  background:var(--wsp-primary);
  border-color:var(--wsp-primary);
  color:#fff !important;
  /* Make hover/focus state noticeably different while remaining on-brand */
  filter:brightness(0.85);
  box-shadow:0 0 0 3px rgba(99,102,241,0.22);
}



/* Release 3A+ adjustments: center offline payment actions */
.wsp-payment-actions{display:flex;justify-content:center;align-items:center;gap:14px;flex-wrap:wrap;margin-top:12px;}

/* WSP_EDIT_BTN_LAYOUT_V29: keep action buttons visually separate */
.wsp-table td.num .wsp-btn { display:inline-flex; align-items:center; }
.wsp-table td.num .wsp-btn + .wsp-btn { margin-left:8px; }

/* v31: show modal when PHP renders with .active */
.wsp-modal.active{display:block;}


/* Release 3B final polish */
.wsp-actions-inline{
  display:inline-flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.wsp-actions-inline .wsp-btn{ margin:0 !important; }

/* Ensure modal sits above any table overlays */
.wsp-modal.is-open, .wsp-modal.active { display:block; }
.wsp-modal{ z-index: 999999; }
.wsp-modal-backdrop{ position: fixed; inset: 0; display:block; }

.wsp-modal-backdrop{ text-decoration:none; }

/* Release 3B final v2: helper text */
#wsp-edit-payment-helper{line-height:1.3;}
