/* ============================================================
   3D Pest Control CRM — Global Stylesheet v1.1
   Colors : primary #334256 | accent #b90912 | bg #ffffff
   Font   : Open Sans (Google Fonts)
   ============================================================ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Brand */
  --crm-primary:         #334256;
  --crm-primary-dark:    #243040;
  --crm-primary-light:   #3f5068;
  --crm-accent:          #b90912;
  --crm-accent-dark:     #9a0710;
  --crm-accent-light:    #d4111c;

  /* Neutrals */
  --crm-bg:              #f4f6f9;
  --crm-bg-card:         #ffffff;
  --crm-text:            #1a1a1a;
  --crm-text-muted:      #64748b;
  --crm-text-light:      #94a3b8;
  --crm-border:          #e2e8f0;
  --crm-border-focus:    #334256;

  /* Status */
  --crm-planned:         #2563eb;
  --crm-planned-bg:      #dbeafe;
  --crm-done:            #16a34a;
  --crm-done-bg:         #dcfce7;
  --crm-missed:          #b90912;
  --crm-missed-bg:       #fee2e2;
  --crm-cancelled:       #64748b;
  --crm-cancelled-bg:    #f1f5f9;
  --crm-pending:         #d97706;
  --crm-pending-bg:      #fef3c7;

  /* Sidebar */
  --crm-sidebar-bg:      #334256;
  --crm-sidebar-width:   256px;
  --crm-sidebar-text:    rgba(255,255,255,0.75);
  --crm-sidebar-text-active: #ffffff;
  --crm-sidebar-hover:   rgba(255,255,255,0.08);
  --crm-sidebar-active:  rgba(185,9,18,0.85);

  /* Spacing */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-7:  28px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Radii */
  --r-sm:      6px;
  --r:         10px;
  --r-lg:      14px;
  --r-full:    9999px;
  --radius-md: 8px;

  /* Shadows */
  --sh-sm:  0 1px 2px rgba(51,66,86,0.06);
  --sh:     0 1px 4px rgba(51,66,86,0.08), 0 1px 2px rgba(51,66,86,0.06);
  --sh-md:  0 4px 10px rgba(51,66,86,0.10), 0 2px 4px rgba(51,66,86,0.06);
  --sh-lg:  0 10px 24px rgba(51,66,86,0.12), 0 4px 8px rgba(51,66,86,0.06);

  /* Font */
  --font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --fs-xs:   11px;
  --fs-sm:   13px;
  --fs-base: 14px;
  --fs-md:   15px;
  --fs-lg:   17px;
  --fs-xl:   20px;
  --fs-2xl:  24px;
  --fs-3xl:  30px;

  /* Transition */
  --t: 150ms cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────────────── */
.dddpc-sidebar *,
.dddpc-dashboard *,
.dddpc-module * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.dddpc-sidebar,
.dddpc-dashboard,
.dddpc-module {
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--crm-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Body push when sidebar present ────────────────────────── */
body.dddpc-has-sidebar {
  padding-left: var(--crm-sidebar-width) !important;
  background: var(--crm-bg) !important;
  transition: padding-left var(--t);
}

@media (max-width: 1023px) {
  body.dddpc-has-sidebar {
    padding-left: 0 !important;
  }
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.dddpc-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--crm-sidebar-width);
  height: 100vh;
  background: var(--crm-sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  transition: transform var(--t), width var(--t);
  box-shadow: 4px 0 16px rgba(51,66,86,0.15);
}

/* Header */
.dddpc-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  min-height: 64px;
}

.dddpc-sidebar__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
}

.dddpc-sidebar__logo-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--r-sm);
}

.dddpc-sidebar__logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dddpc-sidebar__logo-text {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

/* Mobile toggle (only shown via CSS media query) */
.dddpc-sidebar__toggle {
  display: none;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  align-items: center;
  justify-content: center;
  transition: color var(--t), background var(--t);
}
.dddpc-sidebar__toggle:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* User block */
.dddpc-sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.dddpc-sidebar__avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.dddpc-sidebar__user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 2px;
}

.dddpc-sidebar__user-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dddpc-sidebar__user-role {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Section label */
.dddpc-sidebar__section-label {
  padding: var(--sp-4) var(--sp-5) var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* Nav list */
.dddpc-sidebar__nav {
  list-style: none;
  padding: 0 var(--sp-3);
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.dddpc-sidebar__nav::-webkit-scrollbar { width: 3px; }
.dddpc-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.dddpc-sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.dddpc-sidebar__nav-item {
  margin-bottom: 2px;
}

/* Default (not active, not hovered) — pure white at 90% opacity */
.dddpc-sidebar__nav-link {
  display: flex !important;
  align-items: center !important;
  gap: var(--sp-3) !important;
  padding: 9px var(--sp-3) !important;
  border-radius: var(--r-sm) !important;
  text-decoration: none !important;
  color: rgba(255,255,255,0.90) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 500 !important;
  transition: background var(--t), color var(--t) !important;
  white-space: nowrap !important;
  background: transparent !important;
}

/* Hover — slightly brighter background, full white text */
.dddpc-sidebar__nav-link:hover {
  background: rgba(255,255,255,0.10) !important;
  color: #ffffff !important;
}

/* Active item */
.dddpc-sidebar__nav-item--active .dddpc-sidebar__nav-link {
  background: var(--crm-accent) !important;
  color: #ffffff !important;
}

.dddpc-sidebar__nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.dddpc-sidebar__nav-label { flex: 1; }

/* Support / WhatsApp button */
.dddpc-sidebar__support {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-2) var(--sp-3);
  padding: 9px var(--sp-3);
  border-radius: var(--r-sm);
  background: #25D366 !important;
  border: 1px solid #25D366 !important;
  text-decoration: none;
  color: #ffffff !important;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background var(--t), border-color var(--t);
  cursor: pointer;
}
.dddpc-sidebar__support:hover {
  background: #1da851 !important;
  border-color: #1da851 !important;
  color: #ffffff !important;
}

.dddpc-sidebar__support svg { flex-shrink: 0; }

/* Divider */
.dddpc-sidebar__divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: var(--sp-2) var(--sp-5);
  flex-shrink: 0;
}

/* Footer */
.dddpc-sidebar__footer {
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.dddpc-sidebar__logout {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: #ffffff !important;
  text-decoration: none;
  font-size: var(--fs-sm);
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--r-sm);
  transition: color var(--t), background var(--t);
}
.dddpc-sidebar__logout:hover { color: #fff !important; background: rgba(255,255,255,0.06); }

/* Overlay */
.dddpc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99998;
  backdrop-filter: blur(2px);
}
.dddpc-sidebar-overlay.is-visible { display: block; }

/* Mobile trigger button */
.dddpc-mobile-trigger {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 99997;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  background: var(--crm-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-md);
  transition: background var(--t);
}
.dddpc-mobile-trigger:hover { background: var(--crm-primary-dark); }

/* ============================================================
   PAGE STRUCTURE
   ============================================================ */
.dddpc-dashboard,
.dddpc-module {
  width: 100%;
  padding: var(--sp-8);
}

.dddpc-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.dddpc-page-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--crm-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.dddpc-page-subtitle {
  font-size: var(--fs-sm);
  color: var(--crm-text-muted);
  margin-top: 4px;
}

.dddpc-page-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.dddpc-section-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--crm-text);
  margin-bottom: var(--sp-4);
}

/* ============================================================
   STATS CARDS
   ============================================================ */
.dddpc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.dddpc-stat-card {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  box-shadow: var(--sh);
  transition: box-shadow var(--t), transform var(--t);
}
.dddpc-stat-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }

.dddpc-stat-card__icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dddpc-stat-card__icon--blue   { background: #dbeafe; color: #1d4ed8; }
.dddpc-stat-card__icon--green  { background: #dcfce7; color: #15803d; }
.dddpc-stat-card__icon--orange { background: #fed7aa; color: #c2410c; }
.dddpc-stat-card__icon--purple { background: #ede9fe; color: #7c3aed; }
.dddpc-stat-card__icon--red    { background: #fee2e2; color: var(--crm-accent); }

.dddpc-stat-card__body { display: flex; flex-direction: column; gap: 3px; }

.dddpc-stat-card__label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--crm-text-muted);
}

.dddpc-stat-card__value {
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--crm-primary);
  letter-spacing: -1px;
  line-height: 1;
}

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.dddpc-quick-actions { margin-bottom: var(--sp-6); }

.dddpc-quick-actions__grid {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.dddpc-quick-action {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--crm-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--sh-sm);
  transition: all var(--t);
}
.dddpc-quick-action:hover {
  border-color: var(--crm-primary);
  box-shadow: var(--sh);
  color: var(--crm-primary);
}

.dddpc-quick-action__icon { color: var(--crm-accent); display: flex; align-items: center; }

/* ============================================================
   CARDS
   ============================================================ */
.dddpc-card {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}

.dddpc-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--crm-border);
  background: #fafbfc;
}

.dddpc-card__title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--crm-primary);
}

.dddpc-card__body { padding: var(--sp-6); }

/* ============================================================
   TABLES
   ============================================================ */
.dddpc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.dddpc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.dddpc-table thead { background: #f8fafc; }

.dddpc-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--crm-text-muted);
  border-bottom: 2px solid var(--crm-border);
  white-space: nowrap;
}

.dddpc-table td {
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--crm-border);
  color: var(--crm-text);
  vertical-align: middle;
}

.dddpc-table tbody tr:last-child td { border-bottom: none; }
.dddpc-table tbody tr:hover td { background: #f8fafc; }
.dddpc-table__cell--strong { font-weight: 600; }

/* DAR-2729 (v1.18.6) — Contract tables (contracts list + installment/payment
   schedule) must read without a horizontal scroll on a 1440px laptop. They fill
   their container; headers may wrap (instead of forcing width via nowrap); the
   long name columns truncate with an ellipsis + a title attribute; cell padding
   is tightened. Scoped to the contract tables only — every other CRM table keeps
   its current layout. Mobile still scrolls via the shared .dddpc-table-wrap. */
.dddpc-table--contracts,
.dddpc-installment-table { width: 100%; }
.dddpc-table--contracts th,
.dddpc-installment-table th { white-space: normal; }         /* let headers wrap, not force width */
.dddpc-table--contracts th,
.dddpc-table--contracts td,
.dddpc-installment-table th,
.dddpc-installment-table td { padding-left: 10px; padding-right: 10px; }
/* Long text columns (Contract Name, Client): truncate rather than overflow.
   The full value stays available via the cell's title attribute. */
.dddpc-table--contracts .dddpc-cell-truncate {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dddpc-table--contracts .dddpc-cell-truncate .dddpc-link { display: inline; }

/* ============================================================
   BUTTONS
   ============================================================ */

/* Full reset for <button> elements using our classes */
button.dddpc-btn {
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-shadow: none;
}

.dddpc-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: var(--sp-2) !important;
  padding: var(--sp-2) var(--sp-4) !important;
  border-radius: var(--r-sm) !important;
  font-family: var(--font) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border: 1.5px solid transparent !important;
  transition: all var(--t) !important;
  white-space: nowrap !important;
  line-height: 1.5 !important;
  color: #ffffff !important;
  vertical-align: middle !important;
}

.dddpc-btn--primary {
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  color: #ffffff !important;
}
.dddpc-btn--primary:hover {
  background: var(--crm-accent) !important;
  border-color: var(--crm-accent) !important;
  color: #ffffff !important;
}

.dddpc-btn--accent {
  background: var(--crm-accent);
  border-color: var(--crm-accent);
  color: #ffffff !important;
}
.dddpc-btn--accent:hover {
  background: var(--crm-accent-dark);
  border-color: var(--crm-accent-dark);
  color: #ffffff !important;
}

.dddpc-btn--secondary {
  background: var(--crm-primary);
  border-color: var(--crm-primary);
  color: #ffffff !important;
}
.dddpc-btn--secondary:hover {
  background: var(--crm-accent) !important;
  border-color: var(--crm-accent) !important;
  color: #ffffff !important;
}

.dddpc-btn--ghost {
  background: #ffffff !important;
  border-color: var(--crm-border) !important;
  color: var(--crm-primary) !important;
}
.dddpc-btn--ghost:hover {
  background: #fff !important;
  border-color: var(--crm-accent) !important;
  color: var(--crm-accent) !important;
}

.dddpc-btn--danger {
  background: var(--crm-accent);
  border-color: var(--crm-accent);
  color: #ffffff !important;
}
.dddpc-btn--danger:hover {
  background: var(--crm-accent-dark);
  border-color: var(--crm-accent-dark);
  color: #ffffff !important;
}

.dddpc-btn--sm  { padding: 3px var(--sp-3); font-size: var(--fs-xs); }
.dddpc-btn--lg  { padding: 11px var(--sp-6); font-size: var(--fs-md); }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.dddpc-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.dddpc-badge--planned,  .dddpc-badge-planned   { background: var(--crm-planned-bg);   color: var(--crm-planned);   }
.dddpc-badge--done,     .dddpc-badge-done       { background: var(--crm-done-bg);      color: var(--crm-done);      }
.dddpc-badge--missed,   .dddpc-badge-missed     { background: var(--crm-missed-bg);    color: var(--crm-missed);    }
.dddpc-badge--cancelled,.dddpc-badge-cancelled  { background: var(--crm-cancelled-bg); color: var(--crm-cancelled); }
.dddpc-badge--pending,  .dddpc-badge-pending    { background: var(--crm-pending-bg);   color: var(--crm-pending);   }
.dddpc-badge--active,   .dddpc-badge-active     { background: var(--crm-done-bg);      color: var(--crm-done);      }
.dddpc-badge--inactive                          { background: var(--crm-cancelled-bg); color: var(--crm-cancelled); }
.dddpc-badge--expired                           { background: var(--crm-missed-bg);    color: var(--crm-missed);    }
.dddpc-badge--paid                              { background: var(--crm-done-bg);      color: var(--crm-done);      }
.dddpc-badge--overdue                           { background: var(--crm-missed-bg);    color: var(--crm-missed);    }
/* DAR-2080 (v1.5.65) — "Other team" (covering) badge. Amber = attention, not an
   error state; covering is legitimate work. `color` is hardened with the
   DAR-1364/DAR-2077 `.dddpc-module …:not(.dddpc-btn)` scoping (specificity 0,3,0)
   so the theme's global rules can't win an unprotected tie. */
.dddpc-badge--other-team                        { background: var(--crm-pending-bg);   color: var(--crm-pending);   }
.dddpc-module .dddpc-badge--other-team:not(.dddpc-btn) { color: var(--crm-pending); }
/* DAR-2078 (v1.8.1) — "Villa Manager" badge on the clients list, for a client
   that is linked from a manager's vm_client_record. Informational blue (reuses
   the planned palette). Colour hardened with the DAR-1364/DAR-2077
   `.dddpc-module …:not(.dddpc-btn)` scoping so the theme cannot win the tie. */
.dddpc-badge--villa-manager                     { background: var(--crm-planned-bg);   color: var(--crm-planned);   margin-left: 8px; }
.dddpc-module .dddpc-badge--villa-manager:not(.dddpc-btn) { color: var(--crm-planned); }

/* DAR-2133 (v1.8.6) — "on behalf of <client>" context line under a manager-billed
   payer in the payments/contracts lists. Small + muted so the primary payer name
   stays prominent. Colour hardened with the DAR-1364/DAR-2077
   `.dddpc-module …:not(.dddpc-btn)` scoping so the theme cannot win the tie. */
.dddpc-payer-context                            { display: block; font-size: var(--fs-xs); color: var(--crm-text-muted); margin-top: 2px; }
.dddpc-module .dddpc-payer-context:not(.dddpc-btn) { color: var(--crm-text-muted); }

/* ============================================================
   FORMS
   ============================================================ */
.dddpc-filters { margin-bottom: var(--sp-5); }

.dddpc-filters__form {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.dddpc-filters__group { display: flex; align-items: center; }

.dddpc-input,
.dddpc-select {
  min-height: 40px;
  padding: 0 var(--sp-3);
  background: #fff;
  border: 1.5px solid var(--crm-border);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--crm-text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  box-sizing: border-box;
}
.dddpc-input:focus,
.dddpc-select:focus {
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(51,66,86,0.10);
}
.dddpc-input  { min-width: 220px; }
.dddpc-select { min-width: 160px; }

/* ACF frontend form styling */
.dddpc-form-card .acf-form .acf-fields { border: none; }
.dddpc-form-card .acf-form .acf-field { padding: var(--sp-4) 0; border-top: 1px solid var(--crm-border); }
.dddpc-form-card .acf-form .acf-field:first-child { border-top: none; }
.dddpc-form-card .acf-form .acf-label label {
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--crm-primary);
  margin-bottom: var(--sp-2);
  display: block;
}
.dddpc-form-card .acf-form .acf-label .description {
  font-size: var(--fs-xs);
  color: var(--crm-text-muted);
  font-weight: 400;
}
.dddpc-form-card .acf-form input[type="text"],
.dddpc-form-card .acf-form input[type="email"],
.dddpc-form-card .acf-form input[type="number"],
.dddpc-form-card .acf-form input[type="url"],
.dddpc-form-card .acf-form textarea,
.dddpc-form-card .acf-form select {
  width: 100%;
  max-width: 520px;
  height: 40px;
  padding: 0 var(--sp-3);
  background: #fff;
  border: 1.5px solid var(--crm-border);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: var(--fs-sm);
  color: var(--crm-text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.dddpc-form-card .acf-form textarea {
  height: auto;
  padding: var(--sp-3);
  min-height: 100px;
  resize: vertical;
}
.dddpc-form-card .acf-form input:focus,
.dddpc-form-card .acf-form textarea:focus,
.dddpc-form-card .acf-form select:focus {
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px rgba(51,66,86,0.10);
  outline: none;
}
.dddpc-form-card .acf-form .acf-submit {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--crm-border);
  margin-top: var(--sp-2);
}
.dddpc-form-card .acf-form .acf-submit button,
.dddpc-form-card .acf-form .acf-submit input[type="submit"] {
  display: inline-flex;
  align-items: center;
  padding: 11px var(--sp-6);
  background: var(--crm-accent);
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: var(--fs-md);
  font-weight: 700;
  color: #fff !important;
  cursor: pointer;
  transition: background var(--t), transform var(--t);
}
.dddpc-form-card .acf-form .acf-submit button:hover,
.dddpc-form-card .acf-form .acf-submit input[type="submit"]:hover {
  background: var(--crm-accent-dark);
  transform: translateY(-1px);
}
.dddpc-acf-fields { padding: 0; }

/* ============================================================
   INTERVENTION CARDS
   ============================================================ */
.dddpc-interventions-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.dddpc-interv-card {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-left: 4px solid var(--crm-planned);
  border-radius: var(--r-lg);
  display: flex;
  align-items: stretch;
  box-shadow: var(--sh);
  overflow: hidden;
  transition: box-shadow var(--t);
}
.dddpc-interv-card:hover { box-shadow: var(--sh-md); }
.dddpc-interv-card--done      { border-left-color: var(--crm-done); }
.dddpc-interv-card--missed    { border-left-color: var(--crm-missed); }
.dddpc-interv-card--cancelled { border-left-color: var(--crm-cancelled); }

.dddpc-interv-card__stripe {
  width: 4px;
  flex-shrink: 0;
}
/* DAR-2731 Round 3 (DAR-1391) — multi-team stripe: one 4px band per assigned
   team, stacked side by side. A single-team card keeps the plain 4px stripe. */
.dddpc-interv-card__stripe--multi {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  width: auto;
}
.dddpc-interv-card__stripe--multi i {
  display: block;
  width: 4px;
  align-self: stretch;
}

/* DAR-1391 (v1.18.39) — My Interventions card left bar = TEAM colour(s), not
   status. Drop the default blue base accent and the status border overrides for
   THIS module only (interventions-today and other .dddpc-interv-card users keep
   their rules). The team-colour stripe element carries the colour; status stays
   visible as the existing pill in the card meta. */
.dddpc-my-interventions .dddpc-interv-card,
.dddpc-my-interventions .dddpc-interv-card--done,
.dddpc-my-interventions .dddpc-interv-card--missed,
.dddpc-my-interventions .dddpc-interv-card--cancelled {
  border-left: none;
}

/* DAR-2947 (v1.18.39) — Contracts list row actions: Print + Edit inline, every
   secondary action behind a "More" popover. */
.dddpc-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.dddpc-actions-more { position: relative; display: inline-flex; }
.dddpc-actions-more__panel {
  position: fixed;
  z-index: 1000;
  min-width: 220px;
  max-width: 340px;
  background: var(--crm-bg-card, #fff);
  border: 1px solid var(--crm-border, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
  padding: 10px;
}
.dddpc-actions-more__panel.is-open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Secondary-action forms stack as full-width rows inside the panel (they are
   inline-flex in the row); never change what they submit. */
.dddpc-actions-more__panel form {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: 0;
}
.dddpc-actions-more__panel .dddpc-renewal-lastsent { width: 100%; }
.dddpc-actions-more__sep {
  border-top: 1px solid var(--crm-border, #e2e8f0);
  margin: 2px 0;
}
/* DAR-3560 — generalised menu items + trigger caret. */
.dddpc-actions-more__btn { white-space: nowrap; }
.dddpc-actions-more__caret { font-size: 10px; margin-left: 2px; opacity: .8; }
/* Link items render as full-width left-aligned menu rows inside the panel. */
.dddpc-actions-more__panel .dddpc-actions-more__item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}
.dddpc-actions-more__item--danger { color: var(--crm-accent, #b90912); }
.dddpc-actions-more__icon { display: inline-flex; width: 1.1em; justify-content: center; }
.dddpc-actions-more__panel a[role="menuitem"]:focus,
.dddpc-actions-more__panel .dddpc-actions-more__item:focus {
  outline: 2px solid var(--crm-accent, #b90912);
  outline-offset: 1px;
}
@media (max-width: 767px) { .dddpc-actions-more__panel { max-width: calc(100vw - 16px); } }
/* DAR-3560 — small centred dialog (villa-manager "Monthly schedule…"); mirrors the
   email preview modal's overlay/box look. */
.dddpc-mini-dialog { position: fixed; inset: 0; z-index: 99990; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; padding: 16px; }
.dddpc-mini-dialog.is-open { display: flex; }
.dddpc-mini-dialog__box { background: var(--crm-bg-card, #fff); border-radius: 10px; width: min(460px, 95vw); box-shadow: 0 8px 40px rgba(0,0,0,.22); overflow: hidden; }
.dddpc-mini-dialog__head { padding: 14px 18px; border-bottom: 1px solid var(--crm-border, #e2e8f0); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dddpc-mini-dialog__close { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; color: var(--crm-text-muted, #64748b); padding: 2px 6px; }
.dddpc-mini-dialog__body { padding: 16px 18px; }
.dddpc-mini-dialog__body .dddpc-manager-planning-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.dddpc-interv-card__time {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--sp-4);
  min-width: 76px;
  flex-shrink: 0;
  border-right: 1px solid var(--crm-border);
  background: #f9fafb;
}

.dddpc-interv-card__time-start { font-size: var(--fs-md); font-weight: 700; color: var(--crm-primary); }
.dddpc-interv-card__time-end   { font-size: var(--fs-xs); color: var(--crm-text-muted); margin-top: 2px; }

.dddpc-interv-card__body {
  flex: 1;
  padding: var(--sp-4) var(--sp-5);
}

.dddpc-interv-card__client { font-size: var(--fs-md); font-weight: 700; color: var(--crm-primary); margin-bottom: 4px; }

.dddpc-interv-card__city {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--crm-text-muted);
  margin-bottom: var(--sp-2);
}

.dddpc-interv-card__meta { display: flex; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--crm-text-muted); }
.dddpc-interv-card__notes { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--crm-text-muted); font-style: italic; }

.dddpc-interv-card__right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  flex-shrink: 0;
}

.dddpc-interv-card__actions { display: flex; gap: var(--sp-2); }

/* ============================================================
   DATE NAV
   ============================================================ */
.dddpc-date-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--sh-sm);
}

.dddpc-date-nav__btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--crm-border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--crm-text-muted);
  text-decoration: none;
  transition: all var(--t);
}
.dddpc-date-nav__btn:hover { background: var(--crm-primary); color: #fff; border-color: var(--crm-primary); }

.dddpc-date-nav__label {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--crm-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ============================================================
   CALENDAR
   ============================================================ */

/* ── Calendar toolbar (view tabs + nav combined) ───────────────── */
.dddpc-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-5);
  box-shadow: var(--sh-sm);
}

.dddpc-cal-views {
  display: flex;
  gap: 2px;
  background: var(--crm-bg);
  border-radius: var(--radius-md);
  padding: 3px;
}

.dddpc-cal-view-btn {
  padding: 5px 16px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--crm-text-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.dddpc-cal-view-btn:hover { color: var(--crm-text); }
.dddpc-cal-view-btn.active {
  background: var(--crm-bg-card);
  color: var(--crm-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.dddpc-cal-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.dddpc-cal-nav__title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--crm-primary);
  min-width: 160px;
  text-align: center;
}

/* ── Week view ──────────────────────────────────────────────────── */
.dddpc-cal-week {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  overflow: hidden;
  margin-bottom: var(--sp-5);
}

.dddpc-cal-week__header,
.dddpc-cal-week__body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.dddpc-cal-week__col-head {
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  border-right: 1px solid var(--crm-border);
  background: var(--crm-bg);
}

.dddpc-cal-week__col-head:last-child { border-right: none; }
.dddpc-cal-week__col-head.is-today { background: rgba(185,9,18,.06); }

.dddpc-cal-week__day-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
}

.dddpc-cal-week__day-name {
  font-size: var(--fs-xs);
  color: var(--crm-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.dddpc-cal-week__day-num {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--crm-primary);
}

.dddpc-cal-week__col-head.is-today .dddpc-cal-week__day-num {
  background: var(--crm-accent);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dddpc-cal-week__col {
  border-right: 1px solid var(--crm-border);
  border-top: 1px solid var(--crm-border);
  min-height: 120px;
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.dddpc-cal-week__col:last-child { border-right: none; }
.dddpc-cal-week__col.is-today { background: rgba(185,9,18,.02); }

.dddpc-cal-week__empty {
  font-size: var(--fs-xs);
  color: var(--crm-text-light);
  text-align: center;
  padding-top: var(--sp-4);
}

.dddpc-cal-week__event {
  padding: 4px 6px;
  border-radius: 4px;
  border-left: 3px solid currentColor;
  font-size: var(--fs-xs);
  cursor: pointer;
  background: var(--crm-bg);
  transition: opacity .15s;
}

.dddpc-cal-week__event:hover { opacity: .8; }

/* ── Day view ───────────────────────────────────────────────────── */
.dddpc-cal-day {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.dddpc-cal-day__item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}

.dddpc-cal-day__item:hover {
  box-shadow: var(--sh);
  transform: translateX(2px);
}

.dddpc-cal-day__time {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--crm-primary);
  min-width: 90px;
  flex-shrink: 0;
}

.dddpc-cal-day__info { flex: 1; min-width: 0; }
.dddpc-cal-day__client { font-weight: 600; font-size: var(--fs-md); color: var(--crm-text); }
.dddpc-cal-day__meta { font-size: var(--fs-sm); color: var(--crm-text-muted); margin-top: 2px; }
.dddpc-cal-day__status { flex-shrink: 0; }

/* ── Event time label (month/week) ─────────────────────────────── */
.dddpc-cal-evt__time { font-weight: 700; opacity: .8; }
.dddpc-cal-evt__label { font-size: 11px; line-height: 1.3; }
.dddpc-cal-evt__type { font-size: 10px; opacity: .7; margin-top: 2px; }

/* Clickable events */
.dddpc-cal-evt { cursor: pointer; }
.dddpc-cal-evt:hover { opacity: .85; }

/* ── Intervention popup ─────────────────────────────────────────── */
.dddpc-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
}

.dddpc-popup.is-open { display: flex; align-items: center; justify-content: center; }

.dddpc-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
}

.dddpc-popup__box {
  position: relative;
  z-index: 1;
  background: var(--crm-bg-card);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: min(480px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dddpc-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--crm-border);
  flex-shrink: 0;
}

.dddpc-popup__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--crm-primary);
  margin: 0;
}

.dddpc-popup__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--crm-text-muted);
  padding: var(--sp-1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
}

.dddpc-popup__close:hover { color: var(--crm-accent); background: rgba(185,9,18,.06); }

.dddpc-popup__body {
  padding: var(--sp-5) var(--sp-6);
  overflow-y: auto;
  flex: 1;
}

.dddpc-popup__grid { display: flex; flex-direction: column; gap: var(--sp-3); }

.dddpc-popup__row {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
}

.dddpc-popup__key {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--crm-text-muted);
  min-width: 72px;
  flex-shrink: 0;
}

.dddpc-popup__val {
  font-size: var(--fs-sm);
  color: var(--crm-text);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.dddpc-popup__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dddpc-popup__status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.dddpc-popup__status--planned   { background: var(--crm-planned-bg);   color: var(--crm-planned); }
.dddpc-popup__status--done      { background: var(--crm-done-bg);      color: var(--crm-done); }
.dddpc-popup__status--missed    { background: var(--crm-missed-bg);    color: var(--crm-missed); }
.dddpc-popup__status--cancelled { background: var(--crm-cancelled-bg); color: var(--crm-cancelled); }

.dddpc-popup__notes {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--crm-bg);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.dddpc-popup__notes strong { display: block; margin-bottom: var(--sp-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--crm-text-muted); }
.dddpc-popup__notes p { margin: 0; color: var(--crm-text); white-space: pre-line; }

.dddpc-popup__footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--crm-border);
  display: flex;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* Responsive calendar */
@media (max-width: 768px) {
  .dddpc-cal-toolbar { flex-direction: column; align-items: stretch; }
  .dddpc-cal-nav { justify-content: space-between; }
  .dddpc-cal-week__col-head, .dddpc-cal-week__col { padding: var(--sp-1); }
  .dddpc-cal-week__day-name { font-size: 9px; }
  .dddpc-cal-week__day-num { font-size: var(--fs-sm); }
  .dddpc-cal-week__col { min-height: 80px; }
  .dddpc-cal-day__item { flex-wrap: wrap; }
  .dddpc-cal-day__time { min-width: auto; }
  .dddpc-popup__header, .dddpc-popup__body, .dddpc-popup__footer { padding: var(--sp-4); }
}

.dddpc-calendar {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.dddpc-calendar__header {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  border-bottom: 2px solid var(--crm-border);
  background: var(--crm-primary);
}

.dddpc-calendar__weekday {
  padding: 10px var(--sp-2);
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.7);
}

.dddpc-calendar__grid { display: grid; grid-template-columns: repeat(7,1fr); }

.dddpc-calendar__cell {
  min-height: 110px;
  border-right: 1px solid var(--crm-border);
  border-bottom: 1px solid var(--crm-border);
  padding: var(--sp-2);
  transition: background var(--t);
}
.dddpc-calendar__cell:nth-child(7n) { border-right: none; }
.dddpc-calendar__cell:hover:not(.dddpc-calendar__cell--empty) { background: #f8fafc; }
.dddpc-calendar__cell--empty { background: #fafbfc; }
.dddpc-calendar__cell--today { background: #fff8f8; }
.dddpc-calendar__cell--today .dddpc-calendar__day-number a {
  background: var(--crm-accent);
  color: #fff;
  border-radius: var(--r-full);
  padding: 2px 8px;
}

.dddpc-calendar__day-number {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--crm-primary);
  margin-bottom: var(--sp-1);
  display: flex;
  justify-content: flex-end;
}
.dddpc-calendar__day-number a {
  text-decoration: none;
  color: inherit;
  padding: 2px 5px;
  border-radius: var(--r-full);
  transition: background var(--t), color var(--t);
}
.dddpc-calendar__day-number a:hover { background: var(--crm-primary); color: #fff; }

.dddpc-calendar__event {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid var(--crm-planned);
  background: var(--crm-planned-bg);
  color: var(--crm-planned);
}
.dddpc-calendar__event--done      { border-left-color: var(--crm-done);      background: var(--crm-done-bg);      color: var(--crm-done); }
.dddpc-calendar__event--missed    { border-left-color: var(--crm-missed);     background: var(--crm-missed-bg);    color: var(--crm-missed); }
.dddpc-calendar__event--cancelled { border-left-color: var(--crm-cancelled);  background: var(--crm-cancelled-bg); color: var(--crm-cancelled); }
.dddpc-calendar__more { font-size: var(--fs-xs); color: var(--crm-text-muted); padding: 1px 6px; }

.dddpc-calendar__legend { display: flex; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3) 0; }
.dddpc-calendar__legend-item { display: flex; align-items: center; }

/* ============================================================
   DAR-1355 (v1.5.19) — Hourly time grid (week & day views)
   ------------------------------------------------------------
   Grid spans 07:00 → 16:00 in 15-minute increments. 9 hour-rows
   × 4 quarter-hour lines = 36 grid rows. Row height is driven by
   --cal-row-h (28px desktop / 22px mobile). Events are absolutely
   positioned by --evt-top-min / --evt-dur-min / --evt-col /
   --evt-ncols custom properties emitted inline by the PHP layout.
   Month view is untouched; week + day use this grid.
   ============================================================ */

.dddpc-cal-grid {
  --cal-row-h: 28px;
  --cal-gutter-w: 56px;
  border: 1px solid var(--crm-border, #e2e8f0);
  border-radius: 8px;
  background: var(--crm-card-bg, #fff);
  overflow: hidden;
}
/* Horizontal scroll wrapper — week view scrolls on narrow viewports;
   day view never needs to scroll horizontally but reuses the wrapper. */
.dddpc-cal-grid__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Day-header row (week: 7 day labels; day: nothing — header is empty) */
.dddpc-cal-grid__head {
  display: flex;
  border-bottom: 1px solid var(--crm-border, #e2e8f0);
  background: var(--crm-bg, #f8fafc);
  min-width: max-content;
}
.dddpc-cal-grid__head-gutter {
  flex: 0 0 var(--cal-gutter-w);
  border-right: 1px solid var(--crm-border, #e2e8f0);
}
.dddpc-cal-grid__head-col {
  flex: 1 0 110px;
  min-width: 110px;
  padding: 10px 8px;
  text-align: center;
  border-right: 1px solid var(--crm-border, #e2e8f0);
}
.dddpc-cal-grid__head-col:last-child { border-right: none; }
.dddpc-cal-grid__head-col.is-today { background: rgba(185, 9, 18, 0.06); }
.dddpc-cal-grid__head-link { text-decoration: none; color: var(--crm-text, #1f2937); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dddpc-cal-grid__head-name { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--crm-text-muted, #64748b); }
.dddpc-cal-grid__head-num { font-size: 17px; font-weight: 700; }
.dddpc-cal-grid__head-col.is-today .dddpc-cal-grid__head-num { color: var(--crm-accent, #b90912); }

/* ── Untimed (all-day) row above the grid — for events with no start time */
.dddpc-cal-grid__untimed {
  display: flex;
  border-bottom: 1px solid var(--crm-border, #e2e8f0);
  background: rgba(0, 0, 0, 0.02);
  min-width: max-content;
}
.dddpc-cal-grid__untimed-gutter {
  flex: 0 0 var(--cal-gutter-w);
  border-right: 1px solid var(--crm-border, #e2e8f0);
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted, #64748b);
  text-align: right;
}
.dddpc-cal-grid__untimed-col {
  flex: 1 0 110px;
  min-width: 110px;
  padding: 4px;
  border-right: 1px solid var(--crm-border, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dddpc-cal-grid__untimed-col:last-child { border-right: none; }
.dddpc-cal-grid__untimed-evt {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--crm-card-bg, #fff);
  border-left: 3px solid var(--crm-text-muted, #64748b);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Body (gutter + N positioning columns) */
.dddpc-cal-grid__body {
  display: flex;
  min-width: max-content;
  position: relative;
}
.dddpc-cal-grid__gutter {
  flex: 0 0 var(--cal-gutter-w);
  border-right: 1px solid var(--crm-border, #e2e8f0);
  background: var(--crm-bg, #f8fafc);
  position: sticky;
  left: 0;
  z-index: 2;
}
.dddpc-cal-grid__hour {
  height: calc(var(--cal-row-h) * 4);   /* one hour = 4 quarter-rows */
  padding: 4px 8px 0 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--crm-text-muted, #64748b);
  text-align: right;
  border-bottom: 1px solid var(--crm-border, #e2e8f0);
  box-sizing: border-box;
}
.dddpc-cal-grid__hour:last-child { border-bottom: none; }
.dddpc-cal-grid__cols {
  flex: 1;
  display: flex;
  min-width: 0;
}
.dddpc-cal-grid__col {
  flex: 1 0 110px;
  min-width: 110px;
  position: relative;
  border-right: 1px solid var(--crm-border, #e2e8f0);
  height: calc(var(--cal-row-h) * 36);  /* 9 hours × 4 rows = 36 */
  /* Hour lines (strong) + 15-min lines (faint) drawn via gradients. */
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--cal-row-h) - 1px),
      rgba(0, 0, 0, 0.04) calc(var(--cal-row-h) - 1px),
      rgba(0, 0, 0, 0.04) var(--cal-row-h)
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--cal-row-h) * 4 - 1px),
      rgba(0, 0, 0, 0.10) calc(var(--cal-row-h) * 4 - 1px),
      rgba(0, 0, 0, 0.10) calc(var(--cal-row-h) * 4)
    );
}
.dddpc-cal-grid__col:last-child { border-right: none; }
.dddpc-cal-grid__col.is-today { background-color: rgba(185, 9, 18, 0.03); }

/* DAR-1355 part 2 (v1.5.23) — Click-empty-slot-to-create affordance.
   Empty area of the column shows a "+" cursor and faint highlight on hover
   so the action is discoverable. Event blocks (.dddpc-cal-grid__event)
   keep their own pointer cursor and the click handler ignores empty-slot
   intent when the user is hovering an event. Mobile: tap area is the
   same — no hover state but the cursor:pointer hints work. */
.dddpc-cal-grid__col { cursor: copy; }
.dddpc-cal-grid__col:hover { background-color: rgba(59, 130, 246, 0.05); }
.dddpc-cal-grid__col.is-today:hover { background-color: rgba(185, 9, 18, 0.06); }
.dddpc-cal-grid__event { cursor: pointer; } /* override the column's copy cursor when over an event */

/* Day view: single wide column. */
.dddpc-cal-grid--day .dddpc-cal-grid__col { min-width: 0; flex: 1; }
.dddpc-cal-grid--day .dddpc-cal-grid__untimed-col { min-width: 0; flex: 1; }
.dddpc-cal-grid--day .dddpc-cal-grid__head { display: none; } /* the page header already shows the day label */

/* ── Positioned event blocks */
.dddpc-cal-grid__event {
  position: absolute;
  top: calc(var(--evt-top-min, 0) * (var(--cal-row-h) / 15));
  height: calc(var(--evt-dur-min, 30) * (var(--cal-row-h) / 15));
  left: calc(var(--evt-col, 0) * (100% / var(--evt-ncols, 1)));
  width: calc((100% / var(--evt-ncols, 1)) - 4px);
  margin: 1px 2px;
  padding: 4px 6px;
  box-sizing: border-box;
  border-radius: 4px;
  background: var(--crm-card-bg, #fff);
  border-left: 3px solid var(--crm-text-muted, #64748b);
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s, transform 0.15s;
}
.dddpc-cal-grid__event:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}
.dddpc-cal-grid__event .dddpc-cal-evt__time {
  display: block;
  font-weight: 600;
  font-size: 11px;
}
.dddpc-cal-grid__event .dddpc-cal-evt__label {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dddpc-cal-grid__event .dddpc-cal-evt__team {
  display: block;
  font-size: 10px;
  color: var(--crm-text-muted, #64748b);
}

/* Clamp indicators: event spills above 07:00 or below 16:00. */
.dddpc-cal-grid__event--clamp-before::before {
  content: "↑ ";
  font-weight: 700;
  color: var(--crm-text-muted, #64748b);
}
.dddpc-cal-grid__event--clamp-after::after {
  content: " ↓";
  font-weight: 700;
  color: var(--crm-text-muted, #64748b);
}

/* Reuse the existing .dddpc-calendar__event--{status} background tints —
   they already define background/color/border per planned/done/missed/cancelled.
   No need to duplicate. */

/* ── Mobile */
@media (max-width: 768px) {
  .dddpc-cal-grid { --cal-row-h: 22px; --cal-gutter-w: 44px; }
  .dddpc-cal-grid__head-col,
  .dddpc-cal-grid__col,
  .dddpc-cal-grid__untimed-col { min-width: 130px; }
  .dddpc-cal-grid--day .dddpc-cal-grid__col { min-width: 0; }
  .dddpc-cal-grid__event { font-size: 10px; padding: 3px 5px; }
  .dddpc-cal-grid__event .dddpc-cal-evt__team { display: none; } /* keep blocks readable on small screens */
}
.dddpc-map-controls { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.dddpc-map-layer-btn.active {
  background: var(--crm-primary) !important;
  border-color: var(--crm-primary) !important;
  color: #fff !important;
}

/* Zone legend */
.dddpc-zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
}
.dddpc-zone-legend__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--crm-text);
}
.dddpc-zone-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,.15);
}
.dddpc-map-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--crm-border);
  box-shadow: var(--sh);
  margin-bottom: var(--sp-6);
}
.dddpc-map { width: 100%; display: block; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.dddpc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  color: var(--crm-text-muted);
}
.dddpc-empty svg { opacity: 0.25; }
.dddpc-empty p { font-size: var(--fs-md); margin: 0; }

/* ============================================================
   ALERTS
   ============================================================ */
.dddpc-alert {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-5);
  border: 1px solid transparent;
  font-weight: 500;
}
.dddpc-alert--error   { background: #fee2e2; color: var(--crm-accent);    border-color: #fca5a5; }
.dddpc-alert--warning { background: #fef9c3; color: #92400e; border-color: #fde047; }
.dddpc-alert--success { background: #dcfce7; color: var(--crm-done);      border-color: #86efac; }
.dddpc-alert--info    { background: #dbeafe; color: var(--crm-planned);   border-color: #93c5fd; }

/* ============================================================
   PAGINATION
   ============================================================ */
.dddpc-pagination {
  display: flex;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-5) 0;
}
.dddpc-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--crm-text-muted);
  border: 1.5px solid var(--crm-border);
  background: var(--crm-bg-card);
  transition: all var(--t);
}
.dddpc-pagination .page-numbers:hover,
.dddpc-pagination .page-numbers.current {
  background: var(--crm-primary);
  color: #fff;
  border-color: var(--crm-primary);
}

/* ============================================================
   LINKS
   ============================================================ */
.dddpc-link {
  color: var(--crm-accent);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: color var(--t);
}
.dddpc-link:hover { color: var(--crm-accent-dark); text-decoration: underline; }

/* ============================================================
   SPINNER
   ============================================================ */
.dddpc-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dddpc-spin 0.6s linear infinite;
  margin-left: var(--sp-2);
}
@keyframes dddpc-spin { to { transform: rotate(360deg); } }

/* ============================================================
   RESPONSIVE — TABLET (1024px)
   ============================================================ */
@media (max-width: 1023px) {
  .dddpc-sidebar {
    transform: translateX(-100%);
  }
  .dddpc-sidebar.is-open {
    transform: translateX(0);
  }
  .dddpc-mobile-trigger {
    display: flex;
  }
  .dddpc-sidebar__toggle {
    display: flex;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (768px)
   ============================================================ */
@media (max-width: 768px) {
  .dddpc-dashboard,
  .dddpc-module {
    padding: var(--sp-4);
  }

  .dddpc-page-header {
    flex-direction: column;
    gap: var(--sp-3);
  }

  .dddpc-page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .dddpc-stats-grid {
    grid-template-columns: repeat(2,1fr);
    gap: var(--sp-3);
  }

  .dddpc-calendar__cell { min-height: 64px; }
  .dddpc-calendar__event { font-size: 9px; }

  .dddpc-interv-card {
    flex-wrap: wrap;
  }
  .dddpc-interv-card__time {
    border-right: none;
    border-bottom: 1px solid var(--crm-border);
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--sp-3);
    width: 100%;
    min-width: 0;
    padding: var(--sp-3) var(--sp-4);
  }
  .dddpc-interv-card__right {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    padding: var(--sp-2) var(--sp-4) var(--sp-4);
    border-top: 1px solid var(--crm-border);
  }

  .dddpc-filters__form { flex-direction: column; align-items: stretch; }
  .dddpc-input, .dddpc-select { width: 100%; min-width: 0; }

  .dddpc-table th,
  .dddpc-table td { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); }

  .dddpc-quick-actions__grid { display: grid; grid-template-columns: 1fr 1fr; }

  /* hide less-important table columns on mobile */
  .dddpc-table .hide-mobile { display: none; }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE (480px)
   ============================================================ */
@media (max-width: 480px) {
  .dddpc-stats-grid { grid-template-columns: 1fr; }
  .dddpc-page-title { font-size: var(--fs-xl); }
  .dddpc-calendar__weekday { font-size: 9px; padding: var(--sp-2) 2px; }
  .dddpc-quick-actions__grid { grid-template-columns: 1fr; }
}

/* ============================================================
   FRONTEND FORMS
   ============================================================ */

.dddpc-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dddpc-acf-fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  margin-bottom: var(--sp-7);
}

/* Individual field wrapper */
.dddpc-form__field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.dddpc-form__field--skip {
  padding: var(--sp-3) var(--sp-4);
  background: var(--crm-bg);
  border-radius: var(--radius-md);
  border: 1px dashed var(--crm-border);
}

.dddpc-form__skip-note {
  margin: 0;
  color: var(--crm-text-muted);
  font-size: var(--fs-sm);
}

/* Label */
.dddpc-form__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--crm-text);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.dddpc-form__required {
  color: var(--crm-accent);
  font-weight: 700;
}

/* DAR-3105 — inline field error (required first-visit date / preferred times). */
.dddpc-form__field-error {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--crm-accent, #b90912);
}

/* Full-width inputs */
.dddpc-input--full,
.dddpc-textarea,
.dddpc-select--full {
  width: 100%;
  box-sizing: border-box;
}

.dddpc-input {
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--crm-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--crm-text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.dddpc-input:focus {
  border-color: var(--crm-border-focus);
  box-shadow: 0 0 0 3px rgba(51,66,86,.12);
}

.dddpc-textarea {
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--crm-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--crm-text);
  background: #fff;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  min-height: 80px;
}

.dddpc-textarea:focus {
  border-color: var(--crm-border-focus);
  box-shadow: 0 0 0 3px rgba(51,66,86,.12);
}

.dddpc-select {
  /* Use min-height + no vertical padding. Horizontal padding only — text is
     vertically centered via line-height equal to min-height. This matches
     how native <select> elements center their text in all browsers. */
  min-height: 44px;
  height: auto;
  padding: 0 40px 0 14px;
  border: 1.5px solid var(--crm-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 44px;
  color: var(--crm-text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center / 12px no-repeat;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Normalize option rendering — some browsers inherit odd padding */
.dddpc-select option {
  padding: 8px 10px;
  font-size: var(--fs-sm);
  line-height: 1.4;
  color: var(--crm-text);
  background: #fff;
}

.dddpc-select:focus {
  border-color: var(--crm-border-focus);
  box-shadow: 0 0 0 3px rgba(51,66,86,.12);
}

/* Checkbox group */
.dddpc-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--crm-bg);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--crm-border);
}

.dddpc-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--crm-text);
  cursor: pointer;
  user-select: none;
}

.dddpc-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--crm-border);
  border-radius: 4px;
  accent-color: var(--crm-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* Toggle (true/false) */
.dddpc-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  user-select: none;
}

.dddpc-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dddpc-toggle__slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--crm-border);
  border-radius: 999px;
  flex-shrink: 0;
  transition: background .2s;
}

.dddpc-toggle__slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}

.dddpc-toggle input:checked + .dddpc-toggle__slider {
  background: var(--crm-primary);
}

.dddpc-toggle input:checked + .dddpc-toggle__slider::after {
  transform: translateX(20px);
}

.dddpc-toggle__text {
  font-size: var(--fs-sm);
  color: var(--crm-text);
  font-weight: 500;
}

/* Color picker */
.dddpc-color-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.dddpc-color {
  width: 48px;
  height: 40px;
  padding: 2px;
  border: 1.5px solid var(--crm-border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.dddpc-color-val {
  font-size: var(--fs-sm);
  color: var(--crm-text-muted);
  font-family: monospace;
}

/* Form actions bar */
.dddpc-form__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--crm-border);
}

/* Form card spacing */
.dddpc-form-card .dddpc-card__body {
  padding: var(--sp-7);
}

@media (max-width: 640px) {
  .dddpc-form-card .dddpc-card__body { padding: var(--sp-4); }
  .dddpc-form__actions { flex-direction: column; align-items: stretch; }
  .dddpc-checkbox-group { padding: var(--sp-3); }
}

/* ──────────────────────────────────────────────────────────────
   Repeater fields (DAR-502 / DAR-503)
   ────────────────────────────────────────────────────────────── */
.dddpc-repeater__rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.dddpc-repeater__row {
  /* DAR-1345 v1.5.5 — stretch instead of flex-start so the meta bar (toggles + ×)
     can vertically center against the inputs grid.
     DAR-1367 v1.5.12 — allow the row to wrap so the meta bar drops to a clean
     SECOND line on narrow widths instead of crowding under the phone input. */
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: stretch;
  padding: var(--sp-3);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  background: var(--color-surface-subtle, #f8fafc);
}

.dddpc-repeater__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
  flex: 1;
  /* DAR-1367 v1.5.12 — allow shrink BEFORE wrap so the grid actually
     re-flows when the row is narrow. Without this min-width:0 the flex
     item refuses to shrink below its intrinsic content. */
  min-width: 0;
}

/* DAR-1367 v1.5.12 — Inputs inside the repeater grid cannot keep the global
   .dddpc-input { min-width: 220px }: when an input is wider than its 160px
   grid track it overflows + slides under the meta bar, putting the toggles
   on top of the phone field. Neutralize the min-width here and let the
   cell width drive the input width. */
.dddpc-repeater__fields .dddpc-input {
  min-width: 0;
  width: 100%;
}

.dddpc-repeater__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dddpc-repeater__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* DAR-2941 (v1.18.35) — Split-billing form polish.
   Row 1's client select is locked to the contract client: it still submits
   (not disabled) but is not interactive, and reads as read-only. */
.dddpc-repeater__field select.is-locked {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
  pointer-events: none;
}
/* Per-row live amount preview, under the Share % input. */
.dddpc-split-amt {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  margin-top: 2px;
}
/* Running total line for the parties repeater; JS colours it red when ≠ 100%. */
.dddpc-split-total {
  margin: 8px 0 2px;
  font-size: 13px;
  font-weight: 700;
}

/* DAR-1345 v1.5.6 — Meta bar mirrors a field cell: hidden label row + a content
   row that flexes to fill the input-height band and centers its contents.
   Centers toggles + × on the input boxes with no hardcoded heights.
   .dddpc-repeater__row { align-items: stretch } is what lets meta-row flex:1. */
.dddpc-repeater__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* DAR-1367 v1.5.12 — when the row wraps (narrow viewport), the meta bar
     becomes its own line below the inputs grid. `flex: 1 1 auto` lets it
     fill that line so the × sits at the right edge, not floating mid-row. */
  flex: 1 1 auto;
  flex-shrink: 0;
  padding-left: var(--sp-3);
}
.dddpc-repeater__meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.4;
  visibility: hidden;
  user-select: none;
}
.dddpc-repeater__meta-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.dddpc-repeater__meta .dddpc-toggle { white-space: nowrap; }

.dddpc-repeater__remove {
  align-self: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--crm-text-muted, #64748b);
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.dddpc-repeater__remove:hover {
  background: var(--crm-bg);
  color: var(--crm-text);
}

/* DAR-1364 — Defensive normalize for bare buttons inside .dddpc-module.
   The active theme ships a global `[type=button],[type=submit],button { border:1px solid #c36 }`
   at specificity (0,1,0). That ties our `.dddpc-repeater__remove` rule, so the
   pink border showed or hid depending on stylesheet load order (visible on a
   normal refresh, gone on a hard refresh that bypassed Autoptimize). Scoping
   to `.dddpc-module *:not(.dddpc-btn)` brings specificity to (0,2,1) — wins
   reliably without touching `.dddpc-btn` or removing the global. */
.dddpc-module button:not(.dddpc-btn),
.dddpc-module input[type="button"]:not(.dddpc-btn),
.dddpc-module input[type="submit"]:not(.dddpc-btn) {
  border: 0;
  background: none;
}
.dddpc-repeater__remove { border: 0 !important; }

/* DAR-2077 (v1.5.62) — Harden `color` exactly as DAR-1364 (above) hardened the
   border. The theme's global `button { color:#fff }` ties our base
   `.dddpc-repeater__remove` rule at (0,1,0) and wins on stylesheet load order,
   painting the × white on the light row background (invisible at rest — the
   remove control existed but couldn't be seen or found). Reusing the same
   `.dddpc-module …:not(.dddpc-btn)` scoping lifts specificity to (0,3,0), so our
   colour wins reliably without !important and without touching `.dddpc-btn`.
   Legible at rest (slate #64748b on the light card ≈ 4.7:1, AA) and near-black
   on hover. */
.dddpc-module .dddpc-repeater__remove:not(.dddpc-btn) {
  color: var(--crm-text-muted, #64748b);
}
.dddpc-module .dddpc-repeater__remove:not(.dddpc-btn):hover {
  background: var(--crm-bg);
  color: var(--crm-text);
}

.dddpc-repeater__template { display: none !important; }
script.dddpc-repeater__template { display: none !important; }

@media (max-width: 640px) {
  .dddpc-repeater__row { flex-direction: column; align-items: stretch; }
  .dddpc-repeater__meta { flex-direction: row; padding-left: 0; }
  .dddpc-repeater__meta-label { display: none; }
  .dddpc-repeater__meta-row { width: 100%; justify-content: space-between; }
}

/* ──────────────────────────────────────────────────────────────
   Flatpickr theme override (bug fix — nicer date picker)
   ────────────────────────────────────────────────────────────── */
.flatpickr-input.dddpc-input { background: #fff; }
.flatpickr-calendar {
  border-radius: var(--radius-md) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15) !important;
  font-family: inherit !important;
}
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
span.flatpickr-weekday {
  color: var(--crm-text) !important;
  background: transparent !important;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--crm-text) !important;
  border-color: var(--crm-text) !important;
  color: #fff !important;
}
.flatpickr-day.today {
  border-color: var(--crm-border-focus, var(--crm-text)) !important;
}
.flatpickr-day:hover {
  background: var(--crm-bg) !important;
}
/* DAR-1344 (v1.5.5 corrective) — the CSS revert block shipped in v1.5.4 was
   removed: the calendar is appended to <body> so .dddpc-module never reached
   it; the year input is killed by the theme/Elementor global input rules,
   and no stylesheet wins reliably (Autoptimize caches it). Year is now forced
   via inline `style.setProperty(..., 'important')` from a flatpickr callback
   — see dddpcSyncYear() in assets/js/crm-scripts.js. */

/* ──────────────────────────────────────────────────────────────
   Zone editor (DAR-512)
   ────────────────────────────────────────────────────────────── */
.dddpc-zone-editor__toolbar {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-4);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--crm-border);
}

.dddpc-zone-editor__map {
  height: 560px;
  width: 100%;
}

.dddpc-zone-editor__status {
  font-size: 13px;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
}
.dddpc-zone-editor__status.is-drawing { background: #dbeafe; color: #1d4ed8; }
.dddpc-zone-editor__status.is-dirty   { background: #fef3c7; color: #92400e; }
.dddpc-zone-editor__status.is-saving  { background: #e2e8f0; color: #334256; }
.dddpc-zone-editor__status.is-saved   { background: #dcfce7; color: #15803d; }
.dddpc-zone-editor__status.is-error   { background: #fee2e2; color: #b91c1c; }

/* DAR-2084 — "Show other zones" toolbar toggle. Colour hardened per the
   DAR-1364/DAR-2077 `.dddpc-module …:not(.dddpc-btn)` pattern so the theme
   can't win the specificity tie. */
.dddpc-zone-editor__context-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.dddpc-module .dddpc-zone-editor__context-toggle:not(.dddpc-btn) { color: var(--crm-text-muted); }

/* DAR-2084 — Read-only context-zone label (Leaflet permanent tooltip). Subtle
   and subordinate to the active shape. The map's revert block only reverts
   margin/padding/line-height, so background/colour set here are safe; colour is
   hardened via the same scoping pattern. */
.dddpc-module .dddpc-zone-context-label:not(.dddpc-btn) {
  color: var(--crm-text);
  background: rgba(255, 255, 255, 0.78);
  border: none;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Hide the GeoJSON textarea from the main zone form — it's internal data,
   edited via the map tool, not by hand. */
.dddpc-zone-geometry-field,
.dddpc-form__field input[name="zone_geometry"],
.dddpc-form__field textarea[name="zone_geometry"] {
  display: none;
}

/* WhatsApp icon in clients list */
.dddpc-wa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transition: transform .15s, opacity .15s;
  text-decoration: none;
  line-height: 1;
}
.dddpc-wa-icon:hover {
  transform: scale(1.15);
  opacity: 0.9;
}

/* ──────────────────────────────────────────────────────────────
   Leaflet zone editor overrides (DAR-512)
   ──────────────────────────────────────────────────────────────
   CRITICAL: the .dddpc-module * { margin:0; padding:0; box-sizing:border-box }
   rule at the top of this file STRIPS every descendant's spacing, which
   breaks Leaflet.draw's toolbar sprite positioning, click regions, and the
   map tile layout itself. We need to fully opt out of that reset inside
   the map container. */
.dddpc-zone-editor__map,
.dddpc-zone-editor__map *,
.dddpc-zone-editor__map *::before,
.dddpc-zone-editor__map *::after {
  box-sizing: content-box !important;
}

/* Reset margin/padding overrides inside the Leaflet map.
   Using "revert" (CSS Cascade Level 4, widely supported) tells the browser
   to fall back to what Leaflet's own stylesheet specified. */
.dddpc-zone-editor__map .leaflet-container,
.dddpc-zone-editor__map .leaflet-pane,
.dddpc-zone-editor__map .leaflet-pane *,
.dddpc-zone-editor__map .leaflet-control,
.dddpc-zone-editor__map .leaflet-control *,
.dddpc-zone-editor__map .leaflet-bar,
.dddpc-zone-editor__map .leaflet-bar *,
.dddpc-zone-editor__map .leaflet-draw,
.dddpc-zone-editor__map .leaflet-draw * {
  margin: revert !important;
  padding: revert !important;
  line-height: revert !important;
}

.dddpc-zone-editor__map.leaflet-container {
  background: #f8fafc;
  font-family: inherit;
  width: 100%;
}

/* DAR-303 — Intervention report styles */
.dddpc-report-photos-existing {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.dddpc-report-photo {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.dddpc-report-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dddpc-report-photo__remove {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  padding: 3px 6px;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.dddpc-report-photo__remove input {
  margin: 0;
}
.dddpc-form__hint {
  font-size: 12px;
  color: var(--crm-text-muted);
  display: block;
  margin-top: 4px;
}
.dddpc-signature-wrap canvas {
  cursor: crosshair;
}

/* ────────────────────────────────────────────────────────────────────────────
 * DAR-961 (v1.3.9) — Client form refactor.
 * Conditional Hotel/Company Name field. Display toggling is JS-driven
 * (shortcode-forms.php) but expose a utility class for future server-rendered
 * conditionals. Toggle styles already shipped in v1.3.x — see .dddpc-toggle*.
 * ──────────────────────────────────────────────────────────────────────────── */
.dddpc-form__field[hidden],
.dddpc-form__field--hidden {
  display: none !important;
}

/* ────────────────────────────────────────────────────────────────────────────
 * DAR-963 (v1.4.0) — Contract form: read-only inline display panels for
 * inherited values (Hotel/Company Name from client_entity_name, Personal
 * Address from client_address). Refreshed via AJAX on contract_client change.
 * Reused later by DAR-962 (print views).
 * ──────────────────────────────────────────────────────────────────────────── */
.dddpc-form__display {
  padding: 10px 14px;
  background: var(--crm-bg);
  border: 1.5px solid var(--crm-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  color: var(--crm-text);
  min-height: 40px;
  line-height: 1.5;
  white-space: pre-line;
}
.dddpc-form__display:empty::before {
  content: "—";
  color: var(--crm-text-muted);
}

/* ────────────────────────────────────────────────────────────────────────────
 * DAR-967 (v1.4.1) — Part F filter alignment fix.
 * Elementor's wrapper / global `select { width: 100% }` rules were stretching
 * each select to full width, causing the filter row to stack vertically.
 * Force horizontal layout with auto-width selects/inputs and a small min-width
 * floor; collapse to full width only below 640px.
 * ──────────────────────────────────────────────────────────────────────────── */
.dddpc-filters__form {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.dddpc-filters__form .dddpc-select,
.dddpc-filters__form select.dddpc-select,
.dddpc-filters__form .dddpc-input,
.dddpc-filters__form input.dddpc-input {
  width: auto !important;
  min-width: 140px;
  flex: 0 1 auto;
}
.dddpc-filters__group {
  display: inline-flex;
  flex: 0 1 auto;
}
@media (max-width: 640px) {
  .dddpc-filters__form .dddpc-select,
  .dddpc-filters__form select.dddpc-select,
  .dddpc-filters__form .dddpc-input,
  .dddpc-filters__form input.dddpc-input {
    width: 100% !important;
    flex: 1 1 100%;
  }
  .dddpc-filters__group { width: 100%; }
}

/* ────────────────────────────────────────────────────────────────────────────
 * DAR-967 (v1.4.1) — Interventions list: Day | Range tabs, range pickers,
 * presets, day groups, empty-state counts + Jump CTA, scope badge.
 * ──────────────────────────────────────────────────────────────────────────── */
.dddpc-scope-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--crm-text-muted);
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  border-radius: 999px;
}
.dddpc-mode-tabs {
  display: inline-flex;
  gap: 2px;
  margin-bottom: var(--sp-4);
  padding: 3px;
  background: var(--crm-bg);
  border-radius: var(--radius-md);
}
.dddpc-mode-tab {
  padding: 6px 18px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--crm-text-muted);
  text-decoration: none;
  border-radius: calc(var(--radius-md) - 2px);
  transition: background .15s, color .15s;
}
.dddpc-mode-tab:hover { color: var(--crm-text); }
.dddpc-mode-tab.is-active {
  background: var(--crm-bg-card);
  color: var(--crm-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.dddpc-date-nav__input {
  min-width: 0;
  max-width: 180px;
  height: 36px;
  margin: 0;
}
.dddpc-date-nav__today { margin-left: 8px; }

.dddpc-range-controls {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--sh-sm);
}
.dddpc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--sp-3);
}
.dddpc-preset-btn {
  padding: 6px 14px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--crm-text);
  background: var(--crm-bg);
  border: 1.5px solid var(--crm-border);
  border-radius: var(--r-full);
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.dddpc-preset-btn:hover {
  background: var(--crm-primary);
  color: #fff;
  border-color: var(--crm-primary);
}
.dddpc-range-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
}
.dddpc-range-form__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-muted);
}
.dddpc-range-form__label .dddpc-input {
  min-width: 160px;
  height: 38px;
  font-size: var(--fs-sm);
  color: var(--crm-text);
  text-transform: none;
  letter-spacing: 0;
}

.dddpc-day-group { margin-bottom: var(--sp-6); }
.dddpc-day-group__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px 14px;
  margin-bottom: var(--sp-3);
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
}
.dddpc-day-group__date {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--crm-primary);
}
.dddpc-day-group__weekday {
  font-weight: 500;
  color: var(--crm-text-muted);
  font-size: var(--fs-sm);
}
.dddpc-day-group__count {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--crm-text-muted);
}

.dddpc-empty-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
  margin-top: var(--sp-5);
}
.dddpc-empty-counts__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 22px;
  min-width: 130px;
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color .15s, transform .1s;
}
.dddpc-empty-counts__item:hover {
  border-color: var(--crm-primary);
  transform: translateY(-1px);
}
.dddpc-empty-counts__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-muted);
}
.dddpc-empty-counts__value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--crm-primary);
  line-height: 1.1;
}
.dddpc-empty-counts__none {
  margin-top: var(--sp-4);
  color: var(--crm-text-muted);
  font-style: italic;
}
.dddpc-empty-jump {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 24px !important;
  margin-top: var(--sp-5);
  line-height: 1.2;
}
.dddpc-empty-jump__date {
  font-size: var(--fs-xs);
  font-weight: 500;
  opacity: 0.85;
}

/* ────────────────────────────────────────────────────────────────────────────
 * DAR-965 (v1.5.0) — Auto-generated invoice draft badge.
 * Renders next to the Ref in the payments dashboard. Distinct from the
 * status badge — communicates "this is a machine-generated draft awaiting
 * human validation", which is a property of the row, not its status alone.
 * ──────────────────────────────────────────────────────────────────────────── */
.dddpc-badge--autodraft {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  white-space: nowrap;
}

/* DAR-1413 (v1.5.43) — Build stamp. No CSS rules changed in this version;
   the source file mtime flip is intentional so dddpc_asset_ver() emits a
   fresh ?ver string on this deploy regardless of OPcache state. The actual
   v1.5.43 fix is a one-line reg.update() addition to the inline PWA JS in
   includes/helpers/cache.php — see CHANGELOG.md for the full forensic. */

/* ============================================================
   DAR-1361 (v1.5.42) — Installment plan UI
   ------------------------------------------------------------
   Polish layer. Reuses dddpc-card / dddpc-form__field / dddpc-input /
   dddpc-table / dddpc-btn / dddpc-alert — adds only the bits these
   primitives don't cover:
     - card subtitle directly under the title
     - panel-level vertical rhythm between summary + form
     - summary header with inline totals (Total · Paid · Outstanding)
     - 2-column form grid that collapses to 1 column on narrow widths
     - right-aligned amount column in the table
   No new palette — uses the existing --crm-* variables and --sp-*.
   ============================================================ */
.dddpc-card__subtitle {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-sm);
  color: var(--crm-text-muted);
  line-height: 1.5;
}
.dddpc-card__subtitle code {
  font-size: 12px;
  padding: 1px 6px;
  background: var(--crm-bg);
  border-radius: 4px;
  color: var(--crm-text);
}

.dddpc-installment-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-7);
}
.dddpc-installment-panel > .dddpc-alert {
  margin: 0;
}
.dddpc-installment-panel__error-detail {
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  font-family: monospace;
  color: var(--crm-missed);
  white-space: pre-wrap;
}

/* ── Summary section (header + table + replace hint) ──────────── */
.dddpc-installment-summary {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.dddpc-installment-summary__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.dddpc-installment-summary__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--crm-primary);
}
.dddpc-installment-summary__totals {
  display: flex;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.dddpc-installment-summary__totals li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-2) var(--sp-4);
  background: var(--crm-bg);
  border: 1px solid var(--crm-border);
  border-radius: var(--r-sm, 6px);
  min-width: 110px;
}
.dddpc-installment-summary__totals li span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-muted);
  font-weight: 600;
}
.dddpc-installment-summary__totals li strong {
  font-size: var(--fs-md);
  color: var(--crm-text);
  font-weight: 700;
  white-space: nowrap;
}
.dddpc-installment-summary__balance strong { color: var(--crm-missed); }
.dddpc-installment-summary__balance--clear strong { color: var(--crm-done); }

/* ── Plan table — right-align the Amount column ───────────────── */
.dddpc-installment-table__amount {
  text-align: right;
  white-space: nowrap;
}
.dddpc-installment-table__docs {
  white-space: nowrap;
}
.dddpc-installment-table__docs .dddpc-btn + .dddpc-btn {
  margin-left: var(--sp-1);
}

/* ── Setup form ───────────────────────────────────────────────── */
.dddpc-installment-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.dddpc-installment-form__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--crm-primary);
}
.dddpc-installment-form .dddpc-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}
.dddpc-installment-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  gap: var(--sp-5) var(--sp-6);
}
.dddpc-installment-form__grid .dddpc-form__field {
  min-width: 0;
}
.dddpc-installment-form__grid .dddpc-input,
.dddpc-installment-form__grid .dddpc-select {
  min-width: 0;
  width: 100%;
  max-width: 260px;
}

@media (max-width: 720px) {
  .dddpc-installment-form__grid { grid-template-columns: 1fr; }
  .dddpc-installment-form__grid .dddpc-input,
  .dddpc-installment-form__grid .dddpc-select { max-width: none; }
  .dddpc-installment-summary__header { flex-direction: column; }
}

/* DAR-2125 (v1.5.79) — Hide SuperPWA's false "You are currently offline"
   snackbar (the SW works; only the bogus notification is unwanted). SuperPWA
   renders it OUTSIDE .dddpc-module, so the module scoping pattern cannot reach
   it — these selectors are intentionally global. Scoped to SuperPWA's OWN
   markup so an unrelated .snackbar (theme / other plugin) is never hidden:
   a .snackbar that contains SuperPWA's unique #snackbar-msg. The #snackbar-msg
   / .snackbar-close rules are a fallback for browsers without :has() support —
   both are SuperPWA-specific (a unique id + its close button), so they cannot
   affect anything else. */
.snackbar:has(#snackbar-msg) { display: none !important; }
#snackbar-msg,
.snackbar-close { display: none !important; }

/* ============================================================
   DAR-2173 (v1.10.0) — Prospect pipeline kanban
   ============================================================ */
.dddpc-kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.dddpc-kanban__col { flex: 1 1 0; min-width: 240px; background: var(--crm-bg); border: 1px solid var(--crm-border); border-radius: var(--r); padding: 12px; }
.dddpc-kanban__col--target { outline: 2px dashed var(--crm-primary); outline-offset: 2px; background: var(--crm-planned-bg); }
.dddpc-kanban__col-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--crm-text-muted); margin-bottom: 12px; }
.dddpc-kanban__count { background: var(--crm-bg-card); border: 1px solid var(--crm-border); border-radius: var(--r-full); padding: 1px 8px; font-size: var(--fs-xs); color: var(--crm-text-muted); }
.dddpc-kanban__cards { min-height: 40px; display: flex; flex-direction: column; gap: 10px; }
.dddpc-kanban__card { background: var(--crm-bg-card); border: 1px solid var(--crm-border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--sh-sm); cursor: grab; touch-action: none; user-select: none; }
.dddpc-kanban__card--dragging { opacity: .4; }
.dddpc-kanban__card--ghost { box-shadow: var(--sh-lg); opacity: .95; transform: rotate(1.5deg); }
.dddpc-module .dddpc-kanban__name:not(.dddpc-btn) { display: block; font-weight: 700; color: var(--crm-text); text-decoration: none; margin-bottom: 2px; }
.dddpc-module .dddpc-kanban__name:not(.dddpc-btn):hover { color: var(--crm-primary); text-decoration: underline; }
.dddpc-kanban__property { font-size: var(--fs-sm); color: var(--crm-text-muted); margin-bottom: 8px; }
.dddpc-kanban__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--crm-text-muted); }
.dddpc-kanban__quote { font-weight: 700; color: var(--crm-text-light); }

/* ============================================================================
 * DAR-3225 — Searchable client picker (progressive enhancement).
 * ========================================================================== */
.dddpc-cs { position: relative; }
.dddpc-cs__native { display: none !important; }
.dddpc-cs__input { cursor: text; }
.dddpc-cs__list {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 2px);
  margin: 0; padding: 4px; list-style: none;
  max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--crm-border, #e2e8f0);
  border-radius: var(--r-sm, 6px); box-shadow: var(--sh-md, 0 4px 10px rgba(51,66,86,0.10));
}
.dddpc-cs__opt {
  padding: 8px 10px; border-radius: 4px; cursor: pointer;
  font-size: var(--fs-sm, 13px); color: var(--crm-text, #1a1a1a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dddpc-cs__opt:hover,
.dddpc-cs__opt.is-active { background: var(--crm-bg, #f4f6f9); }
.dddpc-cs__opt[aria-selected="true"] { font-weight: 600; }
.dddpc-cs__empty { padding: 8px 10px; color: var(--crm-text-muted, #64748b); font-size: var(--fs-sm, 13px); }
