/*
 * CRM V1.2 — Wepro Phone section design system (UIV12-132).
 *
 * Shared hero, filter drawer, table card, action, and modal styles for
 * Manage Numbers, Anonymous / Block Numbers, Manage IVR, the IVR report
 * pages, and Twilio Purchase Number.
 *
 * Everything is scoped to `.wphone-page` / `.wphone-filter-panel` /
 * `.wphone-modal` so it cannot leak into other redesigned pages.
 *
 * Reference: docs/crm-v12-ui-guide.md, .cursor/rules/crm-v12-page-redesign.mdc
 */

/*
 * Tokens live on :root because drawers and modals are rendered as siblings of
 * `.wphone-page` (Bootstrap moves them), so they cannot inherit from it.
 */
:root {
  --wphone-green: #43b02a;
  --wphone-green-dark: #2f7d20;
  --wphone-green-soft: #edf9e9;
  --wphone-green-line: #bfe6b5;
  --wphone-ink: #111827;
  --wphone-muted: #64748b;
  --wphone-line: #e3e9f2;
  --wphone-soft: #f6f8fb;
}

.wphone-page {
  background:
    radial-gradient(circle at top left, rgba(79, 170, 50, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.11), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 44%, #eef3f8 100%);
  color: #162033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: calc(100vh - 64px);
}

.wphone-page .container-fluid {
  max-width: none !important;
  padding: 16px 12px 24px !important;
  width: 100%;
}

#main-wrapper.wepro-modern-nav .page-wrapper.wphone-page > .container-fluid {
  max-width: none !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* ---------------------------------------------------------------- Hero -- */

.wphone-hero,
.wphone-card {
  background: #ffffff;
  border: 1px solid var(--wphone-line);
  border-radius: 20px;
  box-shadow: 0 14px 34px rgba(22, 32, 51, 0.07);
}

.wphone-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95)),
    linear-gradient(135deg, rgba(79, 170, 50, 0.10), rgba(37, 99, 235, 0.08));
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.wphone-eyebrow {
  color: var(--wphone-green-dark);
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.wphone-hero-title h1 {
  color: var(--wphone-ink);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0;
}

.wphone-hero-title p {
  color: var(--wphone-muted);
  font-size: 14px;
  line-height: 1.45;
  margin: 5px 0 0;
  max-width: 680px;
}

.wphone-hero-actions {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
}

.wphone-hero-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.wphone-count-pill {
  background: var(--wphone-green-soft);
  border: 1px solid #cfedc6;
  border-radius: 999px;
  color: #378620;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 12px;
  text-align: center;
  white-space: nowrap;
}

.wphone-count-pill strong {
  color: #24651f;
  font-size: 12px;
  font-weight: 800;
}

.wphone-hero-filter {
  min-width: 180px;
  text-align: left;
  width: 220px;
}

.wphone-hero-filter label {
  text-align: left;
}

/* Transient hero status line (verification codes, sync progress). */
.wphone-hero-note {
  color: var(--wphone-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.wphone-hero-note:empty {
  display: none;
}

.wphone-hero-note.is-error {
  color: #b91c1c;
}

/* ------------------------------------------------------------- Buttons -- */

.wphone-btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  line-height: 1;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none !important;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
  white-space: nowrap;
}

.wphone-btn i {
  font-size: 14px;
  line-height: 1;
}

.wphone-btn:focus,
.wphone-btn:focus-visible,
.wphone-btn:active {
  box-shadow: none;
  outline: none;
}

.wphone-btn-primary {
  background: var(--wphone-green);
  border-color: var(--wphone-green);
  color: #ffffff !important;
}

.wphone-btn-primary:hover,
.wphone-btn-primary:focus,
.wphone-btn-primary:focus-visible,
.wphone-btn-primary:active {
  background: var(--wphone-green-dark);
  border-color: var(--wphone-green-dark);
  color: #ffffff !important;
}

.wphone-btn-primary:disabled,
.wphone-btn-primary.is-disabled {
  background: #94a3b8;
  border-color: #94a3b8;
  cursor: not-allowed;
}

.wphone-btn-secondary {
  background: #ffffff;
  border-color: #cfd9e8;
  color: var(--wphone-ink) !important;
}

.wphone-btn-secondary:hover,
.wphone-btn-secondary:focus,
.wphone-btn-secondary:focus-visible,
.wphone-btn-secondary:active {
  background: #f8fafc;
  border-color: #cfd9e8;
  color: var(--wphone-ink) !important;
}

.wphone-filter-toggle {
  background: var(--wphone-green-soft);
  border-color: var(--wphone-green-line);
  color: var(--wphone-green-dark) !important;
}

.wphone-filter-toggle:hover,
.wphone-filter-toggle:focus,
.wphone-filter-toggle:focus-visible,
.wphone-filter-toggle:active,
.wphone-filter-toggle.is-active {
  background: #dff3d8;
  border-color: var(--wphone-green);
  color: var(--wphone-green-dark) !important;
}

/* ---------------------------------------------------------- Table card -- */

.wphone-card {
  margin-bottom: 16px;
  overflow: hidden;
}

.wphone-card:last-child {
  margin-bottom: 0;
}

.wphone-card-heading {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-bottom: 1px solid #edf1f7;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin: 0;
  padding: 16px 20px;
}

.wphone-card-heading h2 {
  color: var(--wphone-ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.018em;
  margin: 0;
}

.wphone-card-heading p {
  color: var(--wphone-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.wphone-chip {
  background: var(--wphone-green-soft);
  border: 1px solid var(--wphone-green-line);
  border-radius: 999px;
  color: var(--wphone-green-dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  white-space: nowrap;
}

.wphone-card-body {
  padding: 16px 20px 20px;
}

/*
 * Inline filter row, used instead of the drawer when a page has two filters
 * or fewer (see .cursor/rules/crm-v12-page-redesign.mdc §2).
 */
.wphone-toolbar {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  width: 100%;
}

.wphone-toolbar-fields {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

.wphone-toolbar .wphone-field,
.wphone-toolbar-fields .wphone-field {
  flex: 0 1 280px;
  max-width: 280px;
  min-width: 0;
  width: 280px;
}

.wphone-assign-strip {
  align-items: flex-start;
  background: #f8faf8;
  border: 1px solid #e3e8e3;
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 16px;
}

.wphone-assign-strip-copy {
  align-items: flex-start;
  display: flex;
  flex: 1 1 220px;
  gap: 12px;
  min-width: 0;
}

.wphone-assign-step {
  background: #dff3d8;
  border-radius: 999px;
  color: #2f7d32;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
  padding: 7px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.wphone-assign-strip-copy h3 {
  color: #111827;
  font-size: 15px;
  font-weight: 750;
  margin: 0 0 4px;
}

.wphone-assign-strip-copy p {
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.wphone-assign-strip .wphone-toolbar-fields {
  flex: 1 1 320px;
}

.wphone-assign-status {
  align-items: center;
  align-self: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  gap: 8px;
  padding: 8px 12px;
  white-space: nowrap;
}

.wphone-assign-status[data-ready="true"] {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #067647;
}

.wphone-assign-status-dot {
  background: currentColor;
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.wphone-purchase-table-note {
  color: #667085;
  font-size: 13px;
  margin: 0 0 10px;
}

.wphone-purchase-empty {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wphone-purchase-empty strong {
  color: #111827;
  font-size: 15px;
}

.wphone-purchase-empty p {
  margin: 0 0 8px;
  max-width: 420px;
}

.wphone-buy-summary {
  display: grid;
  gap: 12px;
  margin: 0;
}

.wphone-buy-summary > div {
  background: #f8faf8;
  border: 1px solid #e3e8e3;
  border-radius: 12px;
  padding: 12px 14px;
}

.wphone-buy-summary dt {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.wphone-buy-summary dd {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  word-break: break-word;
}

.wphone-purchase-busy {
  align-items: center;
  background: rgba(15, 23, 42, 0.42);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 2000;
}

.wphone-purchase-busy[hidden] {
  display: none !important;
}

.wphone-purchase-busy-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
  max-width: 360px;
  padding: 28px 24px;
  text-align: center;
  width: calc(100% - 32px);
}

.wphone-purchase-busy-card strong {
  color: #111827;
  display: block;
  font-size: 16px;
  margin: 14px 0 6px;
}

.wphone-purchase-busy-card p {
  color: #667085;
  font-size: 13px;
  margin: 0;
}

.wphone-purchase-busy-spinner {
  animation: wphone-purchase-spin .8s linear infinite;
  border: 3px solid #dff3d8;
  border-radius: 50%;
  border-top-color: #43a83f;
  display: inline-block;
  height: 36px;
  width: 36px;
}

@keyframes wphone-purchase-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
  .wphone-assign-status {
    width: 100%;
  }
}

.wphone-table-area.wepro-v12-dt-area {
  min-width: 0;
  padding-bottom: 0;
}

.wphone-table-area .wepro-v12-dt-controls {
  margin-bottom: 6px;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

.wphone-table-area .wepro-v12-dt-export-btn {
  order: 1;
}

.wphone-table-area .wepro-v12-dt-columns-btn {
  order: 2;
}

.wphone-table-area .wepro-v12-dt-controls-search {
  order: 3;
}

.wphone-table-area .wepro-v12-dt-scroll-top {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wphone-table-area .wepro-v12-dt-scroll-main,
.wphone-table-area .wepro-v12-dt-scroll {
  scrollbar-color: #b7c4d4 #f1f5f9;
  scrollbar-width: thin;
}

.wphone-table-area .wepro-v12-dt-scroll-main::-webkit-scrollbar,
.wphone-table-area .wepro-v12-dt-scroll::-webkit-scrollbar {
  height: 12px;
}

.wphone-table-area .wepro-v12-dt-scroll-main::-webkit-scrollbar-track,
.wphone-table-area .wepro-v12-dt-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
  margin: 0 4px;
}

.wphone-table-area .wepro-v12-dt-scroll-main::-webkit-scrollbar-thumb,
.wphone-table-area .wepro-v12-dt-scroll::-webkit-scrollbar-thumb {
  background: #b7c4d4;
  border: 3px solid #f1f5f9;
  border-radius: 999px;
  min-width: 48px;
}

.wphone-table-area .wepro-v12-dt-scroll-main::-webkit-scrollbar-thumb:hover,
.wphone-table-area .wepro-v12-dt-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.wphone-table {
  margin-bottom: 0 !important;
}

.wphone-table .wphone-cell-strong {
  color: var(--wphone-ink);
  font-weight: 700;
}

.wphone-table .wphone-cell-muted {
  color: #94a3b8;
}

.wphone-table .wphone-cell-mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

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

.wphone-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 10px;
  white-space: nowrap;
}

.wphone-badge-success {
  background: #dcfce7;
  color: #166534;
}

.wphone-badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.wphone-badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.wphone-badge-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.wphone-badge-neutral {
  background: #e2e8f0;
  color: #334155;
}

.wphone-badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

/* ------------------------------------------------------- Action column -- */

.wphone-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.wphone-actions-empty {
  color: #94a3b8;
}

.wphone-action-btn {
  align-items: center;
  background: #ffffff;
  border: 1px solid #cfd9e8;
  border-radius: 10px;
  color: var(--wphone-ink) !important;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0 12px;
  text-decoration: none !important;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
  white-space: nowrap;
}

.wphone-action-btn i {
  color: #64748b;
  font-size: 13px;
}

.wphone-action-btn:hover,
.wphone-action-btn:focus,
.wphone-action-btn:focus-visible,
.wphone-action-btn:active {
  background: #f8fafc;
  border-color: #cfd9e8;
  box-shadow: none;
  color: var(--wphone-ink) !important;
  outline: none;
  text-decoration: none !important;
}

.wphone-action-btn.is-primary {
  background: var(--wphone-green-soft);
  border-color: var(--wphone-green-line);
  color: var(--wphone-green-dark) !important;
}

.wphone-action-btn.is-primary i {
  color: var(--wphone-green-dark);
}

.wphone-action-btn.is-primary:hover,
.wphone-action-btn.is-primary:focus,
.wphone-action-btn.is-primary:focus-visible,
.wphone-action-btn.is-primary:active {
  background: #dff3d8;
  border-color: var(--wphone-green);
  color: var(--wphone-green-dark) !important;
}

.wphone-action-btn.is-danger {
  background: #fef2f2;
  border-color: #fbd5d5;
  color: #b91c1c !important;
}

.wphone-action-btn.is-danger i {
  color: #b91c1c;
}

.wphone-action-btn.is-danger:hover,
.wphone-action-btn.is-danger:focus,
.wphone-action-btn.is-danger:focus-visible,
.wphone-action-btn.is-danger:active {
  background: #fee2e2;
  border-color: #f5b5b5;
  color: #991b1b !important;
}

.wphone-action-btn.is-icon {
  min-width: 36px;
  padding: 0 10px;
}

.wphone-action-btn.is-icon span {
  display: none;
}

.wphone-table .wepro-v12-dt-actions-trigger {
  height: 36px;
  min-width: 36px;
  padding: 0;
  width: 36px;
}

.wphone-table .wepro-v12-dt-actions-trigger.dropdown-toggle::after {
  display: none;
}

.wphone-table .wepro-v12-dt-actions-trigger:focus,
.wphone-table .wepro-v12-dt-actions-trigger:focus-visible,
.wphone-table .wepro-v12-dt-actions-trigger:active {
  box-shadow: none;
  outline: none;
}

/* ------------------------------------------------------- Filter drawer -- */

.wphone-filter-panel {
  background: #ffffff;
  border: 0;
  border-left: 1px solid var(--wphone-line, #e3e9f2);
  bottom: 0;
  box-shadow: -16px 0 48px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.24s ease, visibility 0.32s ease;
  visibility: hidden;
  width: 360px;
  z-index: 1045;
}

.wphone-filter-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
}

body.wphone-filter-panel-open {
  overflow-x: hidden;
}

.wphone-filter-panel .jobs-filter-panel-header {
  align-items: flex-start;
  border-bottom: 1px solid #edf1f7;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: space-between;
  padding: 18px 18px 14px;
}

.wphone-filter-panel .jobs-filter-panel-header h3 {
  color: var(--wphone-ink, #111827);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.wphone-filter-panel .jobs-filter-panel-header p {
  color: #64748b;
  font-size: 13px;
  margin: 4px 0 0;
}

.wphone-filter-panel .jobs-filter-panel-close {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.wphone-filter-panel .jobs-filter-panel-close:hover,
.wphone-filter-panel .jobs-filter-panel-close:focus,
.wphone-filter-panel .jobs-filter-panel-close:focus-visible,
.wphone-filter-panel .jobs-filter-panel-close:active {
  border-color: #e2e8f0;
  box-shadow: none;
  outline: none;
}

.wphone-filter-panel .jobs-filter-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 18px;
}

.wphone-filter-panel .jobs-filter-panel-footer {
  border-top: 1px solid #edf1f7;
  display: grid;
    grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  gap: 10px;
  padding: 14px 18px 18px;
}

.wphone-filter-panel .jobs-filter-panel-footer .btn {
  border-radius: 12px;
  font-weight: 600;
  min-height: 44px;
  width: 100%;
}

.wphone-filter-panel .jobs-filter-panel-footer .btn:focus,
.wphone-filter-panel .jobs-filter-panel-footer .btn:focus-visible,
.wphone-filter-panel .jobs-filter-panel-footer .btn:active {
  box-shadow: none;
  outline: none;
}

.wphone-filter-panel .jobs-filter-section-label {
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0 10px;
}

.wphone-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

/* --------------------------------------------------------------- Field -- */

.wphone-field {
  margin-bottom: 0;
}

.wphone-field label {
  color: #475569;
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.wphone-field .wphone-required {
  color: #dc2626;
  margin-left: 2px;
}

.wphone-field .form-control {
  background: #ffffff;
  border: 1px solid #cfd9e8;
  border-radius: 12px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 400;
  min-height: 44px;
}

.wphone-field textarea.form-control {
  min-height: 88px;
}

.wphone-field .form-control:focus,
.wphone-field .form-control:focus-visible,
.wphone-field .form-control:active {
  border-color: #cfd9e8;
  box-shadow: none !important;
  outline: none !important;
}

.wphone-field .form-control:disabled,
.wphone-field .form-control[readonly] {
  background: #f8fafc;
  color: #94a3b8;
}

.wphone-field-hint {
  color: #94a3b8;
  display: block;
  font-size: 12px;
  margin-top: 6px;
}

.wphone-field-error {
  color: #dc2626;
  display: none;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

.wphone-field.has-error .wphone-field-error {
  display: block;
}

.wphone-field.has-error .form-control,
.wphone-field.has-error .wepro-v12-search-select__trigger,
.wphone-field.has-error .wepro-v12-multi-select__trigger {
  border-color: #f2b8b8;
}

/* --------------------------------------------------------------- Modal -- */

.wphone-modal .modal-dialog {
  max-width: min(80vw, 1100px) !important;
  width: auto;
}

.wphone-modal.wphone-modal-sm .modal-dialog {
  max-width: min(80vw, 520px) !important;
}

.wphone-modal.wphone-modal-md .modal-dialog {
  max-width: min(80vw, 760px) !important;
}

.wphone-modal .modal-content {
  border: 0;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.wphone-modal .modal-header {
  align-items: flex-start;
  background: #f8fafc;
  border-bottom: 1px solid #e3e9f2;
  flex: 0 0 auto;
  padding: 14px 18px;
}

.wphone-modal .modal-title {
  color: #111827;
  font-size: 20px;
  font-weight: 750;
  margin: 0;
}

.wphone-modal .modal-subtitle {
  color: #64748b;
  font-size: 12px;
  margin: 2px 0 0;
}

.wphone-modal .close {
  border-radius: 10px;
  opacity: .6;
}

.wphone-modal .close:focus,
.wphone-modal .close:focus-visible,
.wphone-modal .close:active {
  box-shadow: none;
  opacity: 1;
  outline: none;
}

.wphone-modal .modal-body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 14px 18px;
}

.wphone-modal-section {
  background: #ffffff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  margin-bottom: 12px;
  padding: 14px;
}

.wphone-modal-section:last-child {
  margin-bottom: 0;
}

.wphone-modal-section > h5 {
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

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

.wphone-modal-grid .wphone-field-full {
  grid-column: 1 / -1;
}

.wphone-modal .modal-footer {
  background: #f8fafc;
  border-top: 1px solid #e3e9f2;
  flex: 0 0 auto;
  gap: 10px;
  padding: 12px 18px;
}

.wphone-form-feedback {
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0 0;
  min-height: 18px;
}

.wphone-form-feedback.is-error {
  color: #dc2626;
}

.wphone-form-feedback.is-success {
  color: #15803d;
}

.wphone-form-feedback.is-busy {
  color: #64748b;
}

/* ------------------------------------------------------ Detail screens -- */

/* Breadcrumb replacement on the nested IVR pages. */
.wphone-back-link {
  align-items: center;
  border-radius: 999px;
  color: var(--wphone-muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.wphone-back-link i {
  font-size: 10px;
}

.wphone-back-link:hover,
.wphone-back-link:focus,
.wphone-back-link:focus-visible,
.wphone-back-link:active {
  box-shadow: none;
  color: var(--wphone-green-dark);
  outline: none;
  text-decoration: none;
}

.wphone-stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 16px;
}

.wphone-stat {
  background: #fff;
  border: 1px solid var(--wphone-line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 42, 84, 0.05);
  padding: 14px 16px;
}

.wphone-stat-label {
  color: var(--wphone-muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wphone-stat-value {
  color: var(--wphone-ink);
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 6px;
}

.wphone-audio {
  height: 30px;
  max-width: 220px;
  vertical-align: middle;
}

.wphone-empty {
  border: 1px dashed var(--wphone-line);
  border-radius: 14px;
  color: var(--wphone-muted);
  font-size: 14px;
  padding: 28px 20px;
  text-align: center;
}

/* ------------------------------------------------- Call flow builder -- */

.wflow-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wflow-step {
  background: #fff;
  border: 1px solid var(--wphone-line);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 42, 84, 0.05);
  overflow: hidden;
}

.wflow-step-head {
  align-items: center;
  background: var(--wphone-soft);
  border-bottom: 1px solid var(--wphone-line);
  display: flex;
  gap: 12px;
  padding: 12px 16px;
}

.wflow-step-rank {
  align-items: center;
  display: flex;
  gap: 8px;
}

.wflow-step-index {
  align-items: center;
  background: var(--wphone-green-soft);
  border: 1px solid var(--wphone-green-line);
  border-radius: 999px;
  color: var(--wphone-green-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  min-width: 28px;
  padding: 0 8px;
}

.wflow-step-reorder {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wflow-icon-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--wphone-line);
  border-radius: 6px;
  color: var(--wphone-muted);
  cursor: pointer;
  display: inline-flex;
  height: 16px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 22px;
}

.wflow-icon-btn:hover,
.wflow-icon-btn:focus,
.wflow-icon-btn:focus-visible,
.wflow-icon-btn:active {
  background: var(--wphone-green-soft);
  border-color: var(--wphone-green-line);
  box-shadow: none;
  color: var(--wphone-green-dark);
  outline: none;
}

.wflow-step-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.wflow-step-heading h3 {
  color: var(--wphone-ink);
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.wflow-step-heading p {
  color: var(--wphone-muted);
  font-size: 12px;
  margin: 2px 0 0;
}

.wflow-step-body {
  padding: 16px;
}

.wflow-triggers {
  border-top: 1px dashed var(--wphone-line);
  padding: 14px 16px 16px;
}

.wflow-triggers-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.wflow-triggers-head h4 {
  color: var(--wphone-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.wflow-trigger {
  align-items: end;
  border: 1px solid var(--wphone-line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 90px minmax(140px, 1fr) minmax(160px, 1fr) minmax(180px, 1.4fr) auto;
  margin-bottom: 10px;
  padding: 12px;
}

.wflow-trigger:last-child {
  margin-bottom: 0;
}

.wflow-trigger-remove {
  padding-bottom: 6px;
}

.wflow-trigger-note {
  color: #b45309;
  font-size: 12px;
  margin: 6px 0 0;
}

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

  .wflow-trigger-remove {
    grid-column: 1 / -1;
  }
}

/* ---------------------------------------------------------- Responsive -- */

@media (max-width: 767px) {
  .wphone-page .container-fluid,
  #main-wrapper.wepro-modern-nav .page-wrapper.wphone-page > .container-fluid {
    padding: 12px !important;
  }

  .wphone-hero,
  .wphone-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .wphone-hero-actions {
    align-items: stretch;
    width: 100%;
  }

  .wphone-hero-filter {
    width: 100%;
  }

  .wphone-hero-buttons {
    justify-content: stretch;
  }

  .wphone-hero-buttons .wphone-btn {
    flex: 1 1 auto;
  }

  .wphone-count-pill {
    text-align: center;
  }

  .wphone-hero-title h1 {
    font-size: 24px;
  }

  .wphone-card-heading,
  .wphone-card-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .wphone-filter-panel {
    width: 100%;
  }

  .wphone-modal .modal-dialog,
  .wphone-modal.wphone-modal-sm .modal-dialog,
  .wphone-modal.wphone-modal-md .modal-dialog {
    margin: 8px;
    max-width: calc(100vw - 16px) !important;
  }

  .wphone-modal .modal-content {
    max-height: calc(100vh - 16px);
  }

  .wphone-modal .modal-body {
    max-height: calc(100vh - 186px);
    padding: 12px;
  }

  .wphone-modal .modal-footer {
    align-items: stretch;
    flex-direction: column-reverse;
    padding: 10px 12px;
  }

  .wphone-modal .modal-footer .wphone-btn {
    width: 100%;
  }
}
