/* =============================================================
   GoGetPaid Admin Styles — v1.3
   Part of GoToolkit by GoDev
   ============================================================= */

/* -------------------- CSS Variables -------------------- */
:root {
  --ggp-brand:        #17bfb6;
  --ggp-brand-dark:   #12a89f;
  --ggp-brand-light:  #e8faf9;
  --ggp-text:         #1a1a1a;
  --ggp-text-muted:   #666;
  --ggp-border:       #dde1e5;
  --ggp-bg:           #f6f7f8;
  --ggp-card-bg:      #ffffff;
  --ggp-radius:       10px;
  --ggp-radius-sm:    6px;
  --ggp-shadow:       0 1px 4px rgba(0,0,0,0.07);
  --ggp-shadow-md:    0 2px 10px rgba(0,0,0,0.10);
}

/* -------------------- Scrollbar lock -------------------- */
html {
  overflow-y: scroll;
}

/* -------------------- Wrap -------------------- */


/* -------------------- Header -------------------- */
.gogetpaid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 0 0;
  gap: 16px;
  flex-wrap: wrap;
}

.gogetpaid-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.gogetpaid-header-right img {
  width: auto;
}

.gogetpaid-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ggp-text-muted);
}

.gogetpaid-version-badge {
  background: var(--ggp-brand-light);
  color: var(--ggp-brand-dark);
  border: 1px solid var(--ggp-brand);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.gogetpaid-header-meta a {
  color: var(--ggp-brand);
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
}

.gogetpaid-header-meta a:hover {
  color: var(--ggp-brand-dark);
  text-decoration: underline;
}

.gogetpaid-header-divider {
  color: var(--ggp-border);
}

/* -------------------- Tab Navigation -------------------- */
.gogetpaid-tab-nav {
  display: flex;
  align-items: center;
  background: var(--ggp-brand);
  padding: 10px;
  border-radius: 14px;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  box-shadow: var(--ggp-shadow);
}

.gogetpaid-tab-nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gogetpaid-tab-nav button .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.gogetpaid-tab-nav button:hover {
  color: #121212;
}

.gogetpaid-tab-nav button.active {
  background: #fff;
  color: var(--ggp-brand);
  box-shadow: var(--ggp-shadow-md);
}

.gogetpaid-tab-nav button.active .dashicons {
  color: var(--ggp-brand);
}

/* -------------------- Tab Panels -------------------- */
.gogetpaid-tab {
  display: none;
  background: var(--ggp-card-bg);
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius);
  padding: 28px;
  margin-top: 20px;
}

.gogetpaid-tab.active {
  display: block;
}

.gogetpaid-tab > h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ggp-text);
}

.gogetpaid-tab-intro {
  margin: 0 0 24px 0;
  color: var(--ggp-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* -------------------- Cards -------------------- */
.ggp-card {
  background: var(--ggp-card-bg);
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--ggp-shadow);
}

.ggp-card:last-of-type {
  margin-bottom: 0;
}

.ggp-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ggp-border);
}

.ggp-card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ggp-text);
  flex: 1;
}

.ggp-card-header .dashicons {
  color: var(--ggp-brand);
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* -------------------- Field Groups -------------------- */
.ggp-field-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ggp-field {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: start;
  gap: 12px;
}

.ggp-field > label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ggp-text);
  padding-top: 7px;
  line-height: 1.4;
}

.ggp-field-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ggp-field-input input[type="text"],
.ggp-field-input input[type="email"],
.ggp-field-input input[type="url"],
.ggp-field-input input[type="number"],
.ggp-field-input input[type="date"],
.ggp-field-input textarea,
.ggp-field-input select {
  width: 100%;
  max-width: 560px;
  padding: 8px 10px;
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius-sm);
  font-size: 14px;
  color: var(--ggp-text);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.ggp-field-input input:focus,
.ggp-field-input textarea:focus,
.ggp-field-input select:focus {
  border-color: var(--ggp-brand);
  box-shadow: 0 0 0 2px rgba(23,191,182,0.15);
  outline: none;
}

.ggp-field-input textarea {
  resize: vertical;
  min-height: 100px;
  max-width: 100%;
}

.ggp-field-help {
  font-size: 12px;
  color: var(--ggp-text-muted);
  line-height: 1.5;
}

/* Toggle inline layout */
.ggp-field-toggle {
  align-items: center;
}

.ggp-field-toggle .ggp-field-input {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

/* -------------------- Toggle Switch -------------------- */
.ggp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.ggp-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  overflow: hidden;
}

.ggp-toggle-track {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  background: #ccc;
  border: 1px solid #bbb;
  border-radius: 999px;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
}

.ggp-toggle-knob {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transform: translateY(-50%);
  transition: left 0.25s ease;
}

.ggp-toggle input[type="checkbox"]:checked + .ggp-toggle-track {
  background: var(--ggp-brand);
  border-color: var(--ggp-brand-dark);
}

.ggp-toggle input[type="checkbox"]:checked + .ggp-toggle-track .ggp-toggle-knob {
  left: calc(100% - 21px);
}

.ggp-toggle input[type="checkbox"]:focus-visible + .ggp-toggle-track {
  box-shadow: 0 0 0 3px rgba(23,191,182,0.3);
}

.ggp-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ggp-text);
}

/* Reset WP .wrap checkbox overrides so they don't break toggles */
.wrap input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: auto;
  width: auto;
  height: auto;
  background: none;
  border: none;
  border-radius: 0;
  position: static;
  cursor: pointer;
  display: inline;
  vertical-align: middle;
}

.wrap input[type="checkbox"]::before {
  display: none;
}

/* -------------------- Note / Info Boxes -------------------- */
.ggp-note {
  background: #fffbea;
  border: 1px solid #f0d060;
  border-left: 4px solid #f0b429;
  padding: 10px 14px;
  border-radius: var(--ggp-radius-sm);
  font-size: 13px;
  color: #7a5500;
  line-height: 1.6;
  margin: 14px 0 0;
}

.ggp-note strong { color: #5a3e00; }

.ggp-info {
  background: var(--ggp-brand-light);
  border: 1px solid rgba(23,191,182,0.3);
  border-left: 4px solid var(--ggp-brand);
  padding: 10px 14px;
  border-radius: var(--ggp-radius-sm);
  font-size: 13px;
  color: #0a5752;
  line-height: 1.6;
  margin: 14px 0 0;
}

.ggp-warning {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  border-left: 4px solid #cf1322;
  padding: 10px 14px;
  border-radius: var(--ggp-radius-sm);
  font-size: 13px;
  color: #5c0011;
  line-height: 1.6;
  margin: 14px 0 0;
}

/* -------------------- Save Bar -------------------- */
.gogetpaid-save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 0 4px;
  gap: 12px;
}

#gogetpaid-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px 8px 14px;
  background: var(--ggp-brand);
  color: #fff !important;
  border: none !important;
  border-radius: var(--ggp-radius-sm) !important;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(23,191,182,0.35);
  height: auto;
}

#gogetpaid-save-btn:hover {
  background: var(--ggp-brand-dark) !important;
  box-shadow: 0 4px 12px rgba(23,191,182,0.45);
}

#gogetpaid-save-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23,191,182,0.3);
}

/* -------------------- Invoice Tracker -------------------- */
.ggp-invoice-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.ggp-invoice-add-form .ggp-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 140px;
  min-width: 120px;
}

.ggp-invoice-add-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ggp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ggp-invoice-add-form input[type="text"],
.ggp-invoice-add-form input[type="number"],
.ggp-invoice-add-form input[type="date"],
.ggp-invoice-add-form textarea {
  padding: 8px 10px;
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius-sm);
  font-size: 13px;
  color: var(--ggp-text);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.15s ease;
}

.ggp-invoice-add-form input:focus,
.ggp-invoice-add-form textarea:focus {
  border-color: var(--ggp-brand);
  box-shadow: 0 0 0 2px rgba(23,191,182,0.15);
  outline: none;
}

.ggp-invoice-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  height: 44px;
  background: var(--ggp-brand);
  color: #fff !important;
  border: none !important;
  border-radius: var(--ggp-radius-sm) !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
  align-self: flex-end;
  line-height: 38px;
}

/* Dashicon inside the Add Invoice button */
.ggp-invoice-submit .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 16px;
  flex-shrink: 0;
}

.ggp-invoice-submit:hover {
  background: var(--ggp-brand-dark) !important;
}

/* Invoice table */
#invoice-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

#invoice-table thead tr {
  background: var(--ggp-brand);
}

#invoice-table thead tr th {
  color: #fff;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

#invoice-table tbody tr {
  border-bottom: 1px solid var(--ggp-border);
}

#invoice-table tbody tr:last-child {
  border-bottom: none;
}

#invoice-table tbody tr:hover {
  background: var(--ggp-bg);
}

#invoice-table tbody td {
  padding: 10px 12px;
  color: var(--ggp-text);
  vertical-align: middle;
}

.ggp-invoice-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--ggp-bg);
  border: 1px solid var(--ggp-border) !important;
  border-radius: var(--ggp-radius-sm) !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--ggp-text) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.ggp-invoice-export:hover {
  background: var(--ggp-brand-light) !important;
  border-color: var(--ggp-brand) !important;
  color: var(--ggp-brand-dark) !important;
}

.edit-invoice-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--ggp-brand-light);
  color: var(--ggp-brand-dark) !important;
  border: 1px solid var(--ggp-brand) !important;
  border-radius: var(--ggp-radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 10px;
}

.edit-invoice-btn:hover {
  background: var(--ggp-brand) !important;
  color: #fff !important;
}

.delete-invoice-btn {
  align-items: center;
  padding: 4px 10px;
  background: transparent;
  color: #c00 !important;
  border: 1px solid #c00 !important;
  border-radius: var(--ggp-radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-invoice-btn:hover {
  background: #c00 !important;
  color: #fff !important;
}

/* Edit invoice form */
#edit-invoice-form {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background: var(--ggp-bg);
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius);
  max-width: 480px;
}

#edit-invoice-form h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}

#edit-invoice-form .form-group {
  margin-bottom: 12px;
}

#edit-invoice-form label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

#edit-invoice-form input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius-sm);
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
}

#edit-invoice-form input[type="text"]:focus {
  border-color: var(--ggp-brand);
  outline: none;
  box-shadow: 0 0 0 2px rgba(23,191,182,0.15);
}

#edit-invoice-form button.button-primary {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--ggp-brand);
  color: #fff !important;
  border: none !important;
  border-radius: var(--ggp-radius-sm) !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#edit-invoice-form button.button-primary:hover {
  background: var(--ggp-brand-dark) !important;
}

/* -------------------- Final Notice Email -------------------- */
.ggp-email-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 640px;
}

/* Each field row */
.ggp-email-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ggp-border);
}

.ggp-email-field:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.ggp-email-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ggp-text);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* All text/email/file inputs inside the email form */
.ggp-email-field input[type="text"],
.ggp-email-field input[type="email"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius-sm);
  font-size: 14px;
  color: var(--ggp-text);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ggp-email-field input[type="text"]:focus,
.ggp-email-field input[type="email"]:focus {
  border-color: var(--ggp-brand);
  box-shadow: 0 0 0 2px rgba(23,191,182,0.15);
  outline: none;
}

.ggp-email-field input[type="file"] {
  font-size: 13px;
  color: var(--ggp-text);
  padding: 6px 0;
}

/* Submit row */
.ggp-email-field--submit {
  border-bottom: none;
  padding-top: 18px;
  align-items: flex-start;
}

#send_reminder_button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 26px;
  background: var(--ggp-brand);
  color: #fff;
  border: none;
  border-radius: var(--ggp-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(23,191,182,0.35);
}

#send_reminder_button:hover {
  background: var(--ggp-brand-dark);
  box-shadow: 0 4px 12px rgba(23,191,182,0.45);
}

/* TinyMCE container */
.ggp-tinymce-wrap {
  max-width: 100%;
  width: 100%;
}

.ggp-tinymce-wrap .wp-editor-wrap {
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius-sm);
  overflow: hidden;
}

#email_messages {
    width: 100%;
}

/* -------------------- Agitator Tools -------------------- */
.ggp-agitator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ggp-agitator-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ggp-bg);
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius-sm);
  padding: 14px 16px;
  gap: 12px;
}

.ggp-agitator-item-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ggp-agitator-item-label strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ggp-text);
}

.ggp-agitator-item-label span {
  font-size: 12px;
  color: var(--ggp-text-muted);
  line-height: 1.4;
}

/* -------------------- About / FAQ -------------------- */
.ggp-about-intro {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 5px 20px 20px 20px;
  background: var(--ggp-bg);
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius);
  margin: 20px 0px;
}

.ggp-about-intro img {
  width: 80px;
  flex-shrink: 0;
}

.ggp-about-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Accordion */
.ggp-accordion {
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius);
  overflow: hidden;
}

.ggp-accordion-item {
  border-bottom: 1px solid var(--ggp-border);
}

.ggp-accordion-item:last-child {
  border-bottom: none;
}

.ggp-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ggp-bg);
  color: var(--ggp-text);
  cursor: pointer;
  padding: 14px 16px;
  width: 100%;
  border: none;
  text-align: left;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.ggp-accordion-header:hover {
  background: var(--ggp-brand-light);
  color: var(--ggp-brand-dark);
}

.ggp-accordion-header.active {
  background: var(--ggp-brand-light);
  color: var(--ggp-brand-dark);
}

.ggp-accordion-content {
  padding: 14px 16px;
  display: none;
  background: #fff;
  font-size: 13px;
  color: var(--ggp-text);
  line-height: 1.7;
  border-top: 1px solid var(--ggp-border);
}

.ggp-accordion-header .icon {
  font-size: 18px;
  font-weight: 400;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.ggp-accordion-header.active .icon {
  transform: rotate(45deg);
}

/* -------------------- Disclaimers -------------------- */
.ggp-legal h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--ggp-text);
  margin: 20px 0 6px;
}

.ggp-legal p {
  font-size: 13px;
  color: var(--ggp-text-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}

/* -------------------- Notification Banner (front end) -------------------- */
.payment-notification-banner {
  position: fixed;
  top: 0;
  width: 100%;
  color: #fff;
  text-align: center;
  padding: 10px;
  z-index: 1000;
  font-size: 16px;
  font-weight: bold;
}

body.has-notification-banner {
  margin-top: 50px;
}

/* Admin notification bar */
.notification-bar {
  display: none;
  width: 100%;
  padding: 10px;
  color: #fff;
  background-color: var(--ggp-brand);
  text-align: center;
  position: fixed;
  top: 0;
  z-index: 9999;
}

/* -------------------- Colour picker -------------------- */
.ggp-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ggp-color-row input[type="text"].color-field {
  max-width: 160px;
}


/* -------------------- Final Notice Sent badges -------------------- */

.ggp-fns-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.ggp-fns--yes {
  background: #f0faf4;
  color: #1a6e3a;
  border: 1px solid #9dd6b1;
}

.ggp-fns--no {
  background: var(--ggp-bg);
  color: var(--ggp-text-muted);
  border: 1px solid var(--ggp-border);
}

/* -------------------- Responsive -------------------- */
/* ── 1300px: invoice table stacked + header collapses ───────────────────── */
@media (max-width: 1499px) {
  .gogetpaid-header {
    flex-direction: column;
    align-items: flex-start;
	margin-right:20px; 
  }
  .gogetpaid-header-right {
    order: -1;
    align-items: flex-start;
  }
  .gogetpaid-tab-nav {
    order: 0;
    flex: unset;
	width: 100%;
  }

  /* ── Invoice History: stacked card layout ─────────────────────────────
     APPROACH: flex-direction:row on each td.
     ::before = the label (fixed min-width, flex-shrink:0 — never collapses).
     The cell content sits naturally after it as the second flex item.
     This is rock-solid across all browsers and survives WP's 782px resets. */

  #invoice-table {
    width: 100% !important;
    min-width: 0 !important;
  }

  #invoice-table thead {
    display: none !important;
  }

  #invoice-table tbody {
    display: block !important;
    width: 100% !important;
  }

  #invoice-table tbody tr {
    display: block !important;
    width: 100% !important;
    border: 1px solid var(--ggp-border) !important;
    border-radius: var(--ggp-radius-sm) !important;
    margin-bottom: 12px !important;
    background: #fff !important;
    box-shadow: var(--ggp-shadow) !important;
    overflow: hidden !important;
  }

  #invoice-table tbody tr:hover {
    background: #fff !important;
  }

  /* Each cell = flex row: [label] [value] */
  #invoice-table tbody td {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid var(--ggp-border) !important;
    border-right: none !important;
    font-size: 13px !important;
    color: var(--ggp-text) !important;
    box-sizing: border-box !important;
    gap: 0 !important;
  }

  #invoice-table tbody td:last-child {
    border-bottom: none !important;
  }

  /* Label: fixed 120px column that never shrinks into the value */
  #invoice-table tbody td::before {
    content: attr(data-label) !important;
    display: block !important;
    flex: 0 0 120px !important;
    min-width: 120px !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    color: var(--ggp-text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.4 !important;
    padding-right: 14px !important;
    white-space: nowrap !important;
    align-self: center !important;
  }

  /* Status badge: reset the full-width stretch from base styles */
  #invoice-table .ggp-status-badge {
    width: auto !important;
    display: inline-block !important;
    text-align: left !important;
  }

  /* Status cell: allow text wrapping in the value area */
  #invoice-table tbody td:nth-child(6) {
    white-space: normal !important;
  }

  /* Actions cell: already flex — just hide the label */
  #invoice-table tbody td:last-child::before {
    display: none !important;
  }

  /* First cell (ID) — teal bar makes each invoice card easy to spot */
  #invoice-table tbody td:first-child {
    background-color: #17bfb6 !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 12px !important;
  }

  #invoice-table tbody td:first-child::before {
    color: rgba(255,255,255,0.8) !important;
  }
	
	.edit-invoice-btn {
		display: block;
		width: 50%;
	}
	.delete-invoice-btn {
		display: block;
		width: 50%;
	}
}

/* ── 900px: other field grids collapse ───────────────────────────────────── */
@media (max-width: 900px) {
  .ggp-field {
    grid-template-columns: 1fr;
  }
  .ggp-about-cols {
    grid-template-columns: 1fr;
  }
  .ggp-agitator-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 880px: add-form wraps to 2 cols ─────────────────────────────────────── */
@media (max-width: 880px) {
  .ggp-invoice-add-form .ggp-form-group {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
}

/* ── 782px: WordPress fires its own admin resets here.
   Re-assert our flex-based table rules so nothing collapses.             ── */
@media (max-width: 782px) {
    #invoice-table td::before {
        position: relative !important;  /* or static */
    }
}

/* ── 600px: mobile — add-form single column ──────────────────────────────── */
@media (max-width: 600px) {
  .gogetpaid-tab-nav button {
    padding: 10px 14px;
    font-size: 13px;
  }
  .gogetpaid-tab {
    padding: 18px 14px;
  }

  .ggp-invoice-add-form {
    flex-direction: column;
    gap: 10px;
  }

  .ggp-invoice-add-form .ggp-form-group {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }

  .ggp-invoice-submit {
    width: 100%;
    justify-content: center;
    align-self: stretch;
    height: 44px;
    line-height: 44px;
  }


}


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

.ggp-status-badge {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.4;
  box-sizing: border-box;
  text-transform: uppercase;
}

/* Outstanding — red */
.ggp-status--outstanding {
  background: #fff0f0;
  color: #a80000;
  border: 1px solid #f5c6c6;
}

/* Overdue — deep red */
.ggp-status--overdue {
  background: #a80000;
  color: #ffffff;
  border: 1px solid #8b0000;
}

/* Disputed — orange */
.ggp-status--disputed {
  background: #fff4e5;
  color: #9a4800;
  border: 1px solid #ffc785;
}

/* Paid — green */
.ggp-status--paid {
  background: #f0faf4;
  color: #1a6e3a;
  border: 1px solid #9dd6b1;
}

/* 50% Deposit — blue */
.ggp-status--deposit {
  background: #edf5ff;
  color: #0050a0;
  border: 1px solid #a8c8f5;
}

/* Part-Payment — teal */
.ggp-status--part {
  background: var(--ggp-brand-light);
  color: var(--ggp-brand-dark);
  border: 1px solid var(--ggp-brand);
}

/* Awaiting Approval — purple */
.ggp-status--awaiting {
  background: #f5f0ff;
  color: #5a2d9a;
  border: 1px solid #c4a8f0;
}

/* Written Off — grey */
.ggp-status--written-off {
  background: #f2f2f2;
  color: #555;
  border: 1px solid #ccc;
}

/* Default / unknown */
.ggp-status--default {
  background: var(--ggp-bg);
  color: var(--ggp-text-muted);
  border: 1px solid var(--ggp-border);
}

/* -------------------- Invoice table extras -------------------- */

.ggp-table-empty {
  text-align: center;
  color: var(--ggp-text-muted);
  padding: 28px 20px !important;
  font-style: italic;
}

.ggp-notes-cell {
  color: var(--ggp-text-muted);
  font-size: 12px;
}

/* Status column — no wrapping */
#invoice-table td:nth-child(6) {
  white-space: nowrap;
}

/* Add invoice form — status dropdown */
.ggp-invoice-add-form select {
  padding: 8px 10px;
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius-sm);
  font-size: 13px;
  color: var(--ggp-text);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.15s ease;
  cursor: pointer;
}

.ggp-invoice-add-form select:focus {
  border-color: var(--ggp-brand);
  box-shadow: 0 0 0 2px rgba(23,191,182,0.15);
  outline: none;
}

/* -------------------- Edit Invoice Form (improved) -------------------- */

#edit-invoice-form {
  display: none;
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--ggp-bg);
  border: 1px solid var(--ggp-border);
  border-left: 4px solid var(--ggp-brand);
  border-radius: var(--ggp-radius);
  max-width: 540px;
}

#edit-invoice-form h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ggp-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

#edit-invoice-form .form-group {
  margin-bottom: 14px;
}

#edit-invoice-form label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
  color: var(--ggp-text);
}

#edit-invoice-form select,
#edit-invoice-form input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ggp-border);
  border-radius: var(--ggp-radius-sm);
  font-size: 14px;
  color: var(--ggp-text);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

#edit-invoice-form select:focus,
#edit-invoice-form input[type="text"]:focus {
  border-color: var(--ggp-brand);
  outline: none;
  box-shadow: 0 0 0 2px rgba(23,191,182,0.15);
}

#edit-invoice-form button.button-primary {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--ggp-brand);
  color: #fff !important;
  border: none !important;
  border-radius: var(--ggp-radius-sm) !important;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

#edit-invoice-form button.button-primary:hover {
  background: var(--ggp-brand-dark) !important;
}

#edit-invoice-form button.button {
  font-size: 13px;
}

/* -------------------- Required / Optional labels -------------------- */

.ggp-required {
  color: #c00;
  font-weight: 700;
}

.ggp-optional {
  font-weight: 400;
  color: var(--ggp-text-muted);
}
