/**
 * CRO Admin UI – Design system for Dashboard, Offers, Abandoned Carts, etc.
 * Uses WP admin styles (card, notice, button) with tokens and reusable classes.
 *
 * @package Meyvora_Convert
 */

/* -------------------------------------------------------------------------
   Design tokens
   ------------------------------------------------------------------------- */
:root {
  --meyvc-space-1: 8px;
  --meyvc-space-2: 16px;
  --meyvc-space-3: 24px;
  --meyvc-space-4: 32px;
  --meyvc-border: 1px solid #c3c4c7;
  --meyvc-radius: 4px;
  --meyvc-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  --meyvc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --meyvc-muted: #50575e;
  --meyvc-primary: #2271b1;
  --meyvc-success: #00a32a;
  --meyvc-error: #d63638;
}

/* -------------------------------------------------------------------------
   Card: .meyvc-card + .meyvc-card__header + .meyvc-card__body
   ------------------------------------------------------------------------- */
.meyvc-card {
  background: #fff;
  border: var(--meyvc-border);
  box-shadow: var(--meyvc-shadow);
  margin-bottom: var(--meyvc-space-3);
}

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

.meyvc-card__header {
  margin: 0;
  padding: var(--meyvc-space-2) var(--meyvc-space-3);
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
  border-bottom: 1px solid #f0f0f1;
}

.meyvc-card__header h2 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.meyvc-card__body {
  padding: var(--meyvc-space-3);
}

.meyvc-card__body .meyvc-field + .meyvc-field {
  margin-top: var(--meyvc-space-3);
}

/* Legacy: .meyvc-card__title (use inside __header or alone) */
.meyvc-card__title {
  margin: 0;
  padding: var(--meyvc-space-2) var(--meyvc-space-3);
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
  border-bottom: 1px solid #f0f0f1;
}

/* -------------------------------------------------------------------------
   Grid: .meyvc-grid (gap 16px), .meyvc-grid--gap-3 (24px)
   ------------------------------------------------------------------------- */
.meyvc-grid {
  display: grid;
  gap: var(--meyvc-space-2);
}

.meyvc-grid--gap-3 {
  gap: var(--meyvc-space-3);
}

.meyvc-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}
.meyvc-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
.meyvc-grid--12 {
  grid-template-columns: repeat(12, 1fr);
}
.meyvc-grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.meyvc-grid .meyvc-col-6 {
  grid-column: span 6;
}
.meyvc-grid .meyvc-col-12 {
  grid-column: span 12;
}

/* -------------------------------------------------------------------------
   Field: .meyvc-field (label + control), .meyvc-field__label, .meyvc-field__control, .meyvc-help
   ------------------------------------------------------------------------- */
.meyvc-field {
  display: block;
  margin-bottom: var(--meyvc-space-3);
}

.meyvc-field:last-child {
  margin-bottom: 0;
}

.meyvc-field__label {
  display: block;
  margin-bottom: var(--meyvc-space-1);
  font-weight: 600;
  color: #1d2327;
  font-size: 13px;
}

.meyvc-field__control {
  display: block;
}

.meyvc-field__control input[type="text"],
.meyvc-field__control input[type="number"],
.meyvc-field__control input[type="email"],
.meyvc-field__control select,
.meyvc-field__control textarea {
  width: 100%;
  max-width: 400px;
}

.meyvc-field__control .small-text {
  width: auto;
  max-width: none;
}

.meyvc-help {
  display: block;
  margin-top: var(--meyvc-space-1);
  font-size: 12px;
  color: var(--meyvc-muted);
  line-height: 1.5;
}

.meyvc-help:empty {
  display: none;
}

/* Field row: inline label (e.g. checkbox row) */
.meyvc-field--inline .meyvc-field__control label {
  display: inline;
  font-weight: inherit;
}

/* 2-column field grid: align field rows in two columns */
.meyvc-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--meyvc-space-2) var(--meyvc-space-3);
}

.meyvc-fields-grid .meyvc-field {
  margin-bottom: 0;
}

.meyvc-fields-grid .meyvc-field.meyvc-col-12 {
  grid-column: 1 / -1;
}

.meyvc-fields-grid .meyvc-field.meyvc-col-6 {
  grid-column: span 1;
}

/* Single-column form (default): full-width fields */
.meyvc-fields-grid.meyvc-fields-grid--1col {
  grid-template-columns: 1fr;
}

/* Drawer/panel grid: same as meyvc-fields-grid, used in offer drawer */
.meyvc-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--meyvc-space-2) var(--meyvc-space-3);
}

.meyvc-drawer-grid .meyvc-field {
  margin-bottom: 0;
}

.meyvc-drawer-grid .meyvc-field.meyvc-col-12 {
  grid-column: 1 / -1;
}

.meyvc-drawer-grid .meyvc-field.meyvc-col-6 {
  grid-column: span 1;
}

/* -------------------------------------------------------------------------
   KPI cards: .meyvc-kpi (row), .meyvc-kpi__item (card)
   ------------------------------------------------------------------------- */
.meyvc-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--meyvc-space-2);
  margin-bottom: var(--meyvc-space-3);
}

.meyvc-kpi__item {
  background: #fff;
  border: var(--meyvc-border);
  border-radius: var(--meyvc-radius);
  box-shadow: var(--meyvc-shadow-sm);
  padding: var(--meyvc-space-2);
  transition: box-shadow 0.15s ease;
}

.meyvc-kpi__item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.meyvc-kpi__value {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.3;
  margin-bottom: 2px;
}

.meyvc-kpi__label {
  display: block;
  font-size: 12px;
  color: var(--meyvc-muted);
  line-height: 1.4;
}

/* -------------------------------------------------------------------------
   Empty state: .meyvc-empty
   ------------------------------------------------------------------------- */
.meyvc-empty {
  background: #f6f7f7;
  border: var(--meyvc-border);
  box-shadow: var(--meyvc-shadow);
  padding: var(--meyvc-space-4) var(--meyvc-space-3);
  text-align: center;
}

.meyvc-empty__icon {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--meyvc-space-2);
  color: #8c8f94;
  font-size: 48px;
  line-height: 1;
}

.meyvc-empty__title {
  margin: 0 0 var(--meyvc-space-1) 0;
  font-size: 16px;
  font-weight: 600;
  color: #1d2327;
}

.meyvc-empty__desc {
  margin: 0 0 var(--meyvc-space-2) 0;
  font-size: 13px;
  color: var(--meyvc-muted);
  line-height: 1.5;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.meyvc-empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--meyvc-space-1);
}

/* Utilities */
.meyvc-hidden {
  display: none;
}
.meyvc-muted {
  color: var(--meyvc-muted);
}
.meyvc-bar {
  margin-bottom: var(--meyvc-space-2);
}
.meyvc-bar__count {
  font-size: 13px;
  color: var(--meyvc-muted);
}
.meyvc-impact-notice {
  margin-bottom: var(--meyvc-space-3);
  display: flex;
  align-items: flex-start;
  gap: var(--meyvc-space-2);
}
.meyvc-impact-notice .dashicons {
  color: var(--meyvc-primary);
  flex-shrink: 0;
}
.meyvc-impact-notice p {
  margin: 0;
}
.meyvc-inline-form {
  display: inline;
}
.meyvc-list-plain {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.meyvc-list-plain li {
  margin-bottom: var(--meyvc-space-1);
}
.meyvc-status-ok {
  color: var(--meyvc-success);
}
.meyvc-status-warn {
  color: var(--meyvc-error);
}
.meyvc-max-w {
  max-width: 640px;
}
.meyvc-max-w-800 {
  max-width: 800px;
}
.meyvc-col-check {
  width: 220px;
}
.meyvc-col-status {
  width: 120px;
}
.meyvc-input-num {
  width: 80px;
}

/* Single inner content container (consistent padding; used with layout or standalone) */
.meyvc-ui-inner {
  box-sizing: border-box;
}

/* Message block when no layout wrap (e.g. module not available) */
.meyvc-admin-message {
  padding: var(--meyvc-space-3);
  background: #fff;
  border: var(--meyvc-border);
  box-shadow: var(--meyvc-shadow);
}

.meyvc-admin-message p {
  margin: 0;
}

.tablenav {
  height: auto;
}

.tablenav:after {
  content: "";
  display: block;
  clear: both;
}

/* -------------------------------------------------------------------------
   Tables: .meyvc-table (sticky header, zebra, hover, tighter spacing)
   ------------------------------------------------------------------------- */
.meyvc-table-wrap {
  overflow-x: auto;
  margin-top: 0;
  border: var(--meyvc-border);
  border-radius: var(--meyvc-radius);
  box-shadow: var(--meyvc-shadow);
  background: #fff;
  clear: both;
}

.meyvc-table,
table.meyvc-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
}

.meyvc-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f7f7;
  border-bottom: var(--meyvc-border);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
}

.meyvc-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #1d2327;
  white-space: nowrap;
}

.meyvc-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f1;
  vertical-align: middle;
}

.meyvc-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

.meyvc-table tbody tr:hover {
  background: #f0f6fc;
}

.meyvc-table tbody tr:last-child td {
  border-bottom: none;
}

.meyvc-table tbody tr.meyvc-table-empty-row:hover {
  background: #f9f9f9;
}

.meyvc-table th.meyvc-table-num,
.meyvc-table td.meyvc-table-num {
  text-align: right;
  white-space: nowrap;
}

.meyvc-table .meyvc-table-empty,
.meyvc-table .meyvc-no-data {
  padding: var(--meyvc-space-4) var(--meyvc-space-3);
  text-align: center;
  color: var(--meyvc-muted);
  font-size: 13px;
}

/* Table actions: subtle links or small buttons */
.meyvc-table-actions,
.meyvc-table .meyvc-table-actions {
  white-space: nowrap;
}

.meyvc-inline-form {
  display: inline;
}

.meyvc-table-action-link,
.meyvc-table-actions a:not(.button) {
  display: inline-block;
  margin-right: 12px;
  padding: 0;
  font-size: 12px;
  color: var(--meyvc-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}

.meyvc-table-action-link:hover,
.meyvc-table-actions a:not(.button):hover {
  color: #135e96;
  text-decoration: underline;
}

.meyvc-table-actions .button,
.meyvc-table-actions .button-link {
  margin-right: 6px;
  margin-bottom: 0;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.5;
  vertical-align: middle;
}

.meyvc-table-actions .button-link {
  color: var(--meyvc-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}

.meyvc-table-actions .button-link:hover {
  text-decoration: underline;
}

.meyvc-table-actions .button-link.delete-link {
  color: var(--meyvc-error);
}

/* Empty state row (full-width message) */
.meyvc-table-empty-state {
  padding: var(--meyvc-space-4) var(--meyvc-space-3);
  text-align: center;
  background: #f6f7f7;
  border: var(--meyvc-border);
  border-radius: var(--meyvc-radius);
  margin-bottom: var(--meyvc-space-3);
}

.meyvc-table-empty-state__icon {
  display: block;
  font-size: 32px;
  color: #8c8f94;
  margin-bottom: var(--meyvc-space-2);
}

.meyvc-table-empty-state__title {
  margin: 0 0 var(--meyvc-space-1);
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
}

.meyvc-table-empty-state__text {
  margin: 0;
  font-size: 13px;
  color: var(--meyvc-muted);
}
.meyvc-mt-1 {
  margin-top: var(--meyvc-space-1);
}
.meyvc-mt-2 {
  margin-top: var(--meyvc-space-2);
}
.meyvc-mt-3 {
  margin-top: var(--meyvc-space-3);
}
.meyvc-mb-1 {
  margin-bottom: var(--meyvc-space-1);
}
.meyvc-mb-2 {
  margin-bottom: var(--meyvc-space-2);
}
.meyvc-section-desc {
  margin-top: 0;
  margin-bottom: var(--meyvc-space-2);
}
.meyvc-fw-600 {
  font-weight: 600;
}
.meyvc-select-min {
  min-width: 200px;
}
.meyvc-select-min--wide {
  min-width: 260px;
}

/* Per-category discount rows (cart page): flex row layout */
.meyvc-per-category-discount-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meyvc-per-category-discount-list .meyvc-add-per-cat {
  margin-top: 4px;
  align-self: flex-start;
}

.meyvc-per-cat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.meyvc-per-cat-row .meyvc-per-cat-select,
.meyvc-per-cat-row .select2-container {
  flex: 1;
  min-width: 140px;
}

.meyvc-per-cat-row .meyvc-input-num {
  width: 80px;
  min-width: 80px;
}

.meyvc-per-cat-row .meyvc-remove-per-cat {
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Unified layout (MEYVC_Admin_UI / MEYVC_Admin_Layout): full-width wrapper, header,
   tabs, content. Used on EVERY CRO admin page. Header/nav/content inners share
   one container (max-width var(--meyvc-container-max), padding 24px, margin 0 auto) — see
   meyvc-admin-modern.css for shared rule. No 100vw; use width: 100% to avoid overflow.
   ------------------------------------------------------------------------- */
/* Top-level layout wrapper. When used by MEYVC_Admin_UI (no .wrap), margin matches WP .wrap. Only MEYVC_Admin_Layout::render_page() outputs .wrap. */
.meyvc-admin-layout {
  width: 100%;
  max-width: none;
  margin: 12px 0 0;
  box-sizing: border-box;
}

.meyvc-admin-layout__header {
  width: 100%;
  background: #fff;
  margin-bottom: 0;
  box-sizing: border-box;
}

/* Header: H1 + subtitle + primary CTA. Horizontal padding from shared container (modern). */
.meyvc-admin-layout__header-inner {
  max-width: var(--meyvc-container-max);
  margin-left: auto;
  margin-right: auto;
}

.meyvc-admin-layout__content {
  width: 100%;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-top: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 24px;
  margin-top: -1px;
  min-height: 200px;
  box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   .meyvc-ui-layout* (same structure: full width, tabs aligned with content)
   Use these class names if you prefer; layout works identically.
   ------------------------------------------------------------------------- */
.meyvc-ui-layout {
  width: 100%;
  max-width: none;
  margin-top: 12px;
  box-sizing: border-box;
}

.meyvc-ui-layout__header {
  width: 100%;
  background: #fff;
  margin-bottom: 0;
  box-sizing: border-box;
}

.meyvc-ui-layout__header-inner {
  max-width: var(--meyvc-container-max);
  padding-left: 24px;
  padding-right: 24px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 0;
  padding-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}

.meyvc-ui-layout__tabs {
  width: 100%;
  background: #f0f0f1;
  border: 1px solid #c3c4c7;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.meyvc-ui-layout__tabs-inner {
  max-width: var(--meyvc-container-max);
  padding-left: 24px;
  padding-right: 24px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.meyvc-ui-layout__tabs .meyvc-ui-nav__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  min-width: min-content;
}

.meyvc-ui-layout__tabs .meyvc-ui-nav__link {
  display: block;
  padding: 10px 16px;
  color: #2c3338;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition:
    background 0.1s ease,
    border-color 0.1s ease,
    color 0.1s ease;
}

.meyvc-ui-layout__tabs .meyvc-ui-nav__link:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #1d2327;
}

.meyvc-ui-layout__tabs .meyvc-ui-nav__link--active {
  background: #f0f6fc;
  color: #1d2327;
  font-weight: 500;
  border-bottom-color: #2271b1;
  position: relative;
  z-index: 1;
  box-shadow: 0 -1px 0 #fff inset;
}

.meyvc-ui-layout__content {
  width: 100%;
  max-width: var(--meyvc-container-max);
  padding-left: 24px;
  padding-right: 24px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.meyvc-ui-layout__content-inner {
  width: 100%;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-top: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
  padding: 24px;
  margin-top: -1px;
  min-height: 200px;
  box-sizing: border-box;
}

/* Shared nav link styles (used by both .meyvc-admin-layout__nav and .meyvc-ui-layout__tabs) */
.meyvc-ui-nav__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  min-width: min-content;
}

.meyvc-ui-nav__item {
  margin: 0;
  padding: 0;
  border: none;
}

.meyvc-ui-nav__link {
  display: block;
  padding: 10px 16px;
  color: #2c3338;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition:
    background 0.1s ease,
    border-color 0.1s ease,
    color 0.1s ease;
}

.meyvc-ui-nav__link:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #1d2327;
}

.meyvc-ui-nav__link--active {
  background: #f0f6fc;
  color: #1d2327;
  font-weight: 500;
  border-bottom-color: #2271b1;
  position: relative;
  z-index: 1;
  box-shadow: 0 -1px 0 #fff inset;
}

/* -------------------------------------------------------------------------
   Page header: title (h1) + one-line subtitle + right primary CTA
   8px grid: 16px gap, 24px bottom spacing
   ------------------------------------------------------------------------- */
.meyvc-ui-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #c3c4c7;
}

.meyvc-ui-header__text {
  flex: 1;
  min-width: 0;
}

.meyvc-ui-header__title {
  margin: 0 0 8px 0;
  font-size: 23px;
  font-weight: 400;
  line-height: 1.3;
  color: #1d2327;
}

.meyvc-ui-header__subtitle {
  margin: 0;
  font-size: 13px;
  color: #50575e;
  line-height: 1.5;
  max-width: 560px;
}

.meyvc-ui-header__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meyvc-ui-header__actions .button-primary {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* .meyvc-card__body: form-table compatibility */
.meyvc-card__body .form-table {
  margin-top: 0;
}

.meyvc-card__body .form-table:last-child {
  margin-bottom: 0;
}

.meyvc-card.meyvc-card--no-title .meyvc-card__body {
  padding: var(--meyvc-space-3);
}

/* Legacy KPI row/card (use .meyvc-kpi + .meyvc-kpi__item) */
.meyvc-ui-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--meyvc-space-2);
  margin-bottom: var(--meyvc-space-3);
}

.meyvc-ui-kpi-card {
  background: #fff;
  border: var(--meyvc-border);
  border-radius: var(--meyvc-radius);
  box-shadow: var(--meyvc-shadow-sm);
  padding: var(--meyvc-space-2);
  transition: box-shadow 0.15s ease;
}

.meyvc-ui-kpi-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.meyvc-ui-kpi-card__icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-bottom: var(--meyvc-space-1);
  color: var(--meyvc-primary);
  font-size: 24px;
  line-height: 1;
}

.meyvc-ui-kpi-card__value {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.3;
  margin-bottom: 2px;
}

.meyvc-ui-kpi-card__label {
  display: block;
  font-size: 12px;
  color: var(--meyvc-muted);
  line-height: 1.4;
}

/* Legacy .meyvc-ui-card (alias for .meyvc-card when no __body used) */
.meyvc-ui-card {
  background: #fff;
  border: var(--meyvc-border);
  box-shadow: var(--meyvc-shadow);
  border-radius: 0;
  padding: var(--meyvc-space-3);
  margin-bottom: var(--meyvc-space-3);
}

.meyvc-ui-card__title {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f1;
}

/* KPI card (MEYVC_Admin_UI::render_kpi_card) */
.meyvc-ui-kpi-card,
.meyvc-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
.meyvc-kpi-card__label,
.meyvc-ui-kpi-card .meyvc-kpi-card__label {
  font-size: 12px;
  color: #646970;
}
.meyvc-kpi-card__value,
.meyvc-ui-kpi-card .meyvc-kpi-card__value {
  font-size: 20px;
  font-weight: 600;
  color: #1d2327;
}
.meyvc-kpi-card__hint,
.meyvc-ui-kpi-card .meyvc-kpi-card__hint {
  font-size: 12px;
  color: #646970;
}

/* -------------------------------------------------------------------------
   Notices (WP notice with custom spacing + subtle shadow)
   ------------------------------------------------------------------------- */
.meyvc-ui-notice {
  margin: 0 0 20px 0;
  padding: 12px 16px;
  border-left: 4px solid #00a32a;
  background: #fff;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.meyvc-ui-notice--error {
  border-left-color: #d63638;
}

.meyvc-ui-notice--info {
  border-left-color: #2271b1;
}

.meyvc-ui-notice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* Legacy empty state (use .meyvc-empty + __icon, __title, __desc, __actions) */
.meyvc-ui-empty-state {
  background: #f6f7f7;
  border: var(--meyvc-border);
  box-shadow: var(--meyvc-shadow);
  padding: var(--meyvc-space-4) var(--meyvc-space-3);
  text-align: center;
}

.meyvc-ui-empty-state__icon {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--meyvc-space-2);
  color: #8c8f94;
  font-size: 48px;
  line-height: 1;
}

.meyvc-ui-empty-state__title {
  margin: 0 0 var(--meyvc-space-1) 0;
  font-size: 16px;
  font-weight: 600;
  color: #1d2327;
}

.meyvc-ui-empty-state__desc {
  margin: 0 0 var(--meyvc-space-2) 0;
  font-size: 13px;
  color: var(--meyvc-muted);
  line-height: 1.5;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.meyvc-ui-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--meyvc-space-1);
}

.meyvc-ui-empty-state__actions .button-primary {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* -------------------------------------------------------------------------
   Success toasts (fixed position, consistent)
   ------------------------------------------------------------------------- */
.meyvc-ui-toast-container {
  position: fixed;
  top: 32px;
  right: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

body.admin-bar .meyvc-ui-toast-container {
  top: 46px;
}

.meyvc-ui-toast {
  padding: 12px 18px;
  min-width: 280px;
  max-width: 400px;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-left: 4px solid #00a32a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #1d2327;
  pointer-events: auto;
  animation: meyvc-ui-toast-in 0.25s ease;
}

@keyframes meyvc-ui-toast-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.meyvc-ui-toast--error {
  border-left-color: #d63638;
}

.meyvc-ui-toast--info {
  border-left-color: #2271b1;
}

/* In-page toast placeholder (for server-rendered success messages that we style like toasts) */
.meyvc-ui-toast-placeholder {
  margin-bottom: 20px;
}

/* -------------------------------------------------------------------------
   Inline errors (consistent styling)
   ------------------------------------------------------------------------- */
.meyvc-ui-inline-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #d63638;
  line-height: 1.4;
}

.meyvc-ui-inline-error:empty {
  display: none;
}

/* Form field with error state */
.meyvc-ui-field--error input,
.meyvc-ui-field--error select,
.meyvc-ui-field--error textarea {
  border-color: #d63638;
}

/* -------------------------------------------------------------------------
   Buttons (extend WP .button with primary CTA emphasis)
   ------------------------------------------------------------------------- */
.meyvc-ui-btn-primary {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* -------------------------------------------------------------------------
   Content area: 8px grid spacing (8/16/24/32)
   ------------------------------------------------------------------------- */
.meyvc-ui-content > .notice {
  margin-bottom: 16px;
}

.meyvc-ui-content .meyvc-settings-section {
  margin-bottom: 32px;
}

.meyvc-ui-content .meyvc-settings-section h2 {
  margin-top: 24px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f1;
  font-size: 14px;
}

/* -------------------------------------------------------------------------
   Page wrapper (applies to wrap when using design system).
   Layout pages use full width; max-width only when not using .meyvc-admin-layout.
   ------------------------------------------------------------------------- */
.meyvc-ui-page {
  max-width: 1280px;
}

.meyvc-admin-layout.meyvc-ui-page {
  max-width: none;
  width: 100%;
}

.meyvc-ui-page .notice {
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Dashboard-specific: revenue highlight as KPI-style */
.meyvc-ui-page .meyvc-revenue-highlight {
  margin-bottom: 24px;
}

.meyvc-ui-page .meyvc-revenue-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 6px;
}

/* Stats grid aligned with KPI cards */
.meyvc-ui-page .meyvc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.meyvc-ui-page .meyvc-stat-card {
  background: #fff;
  border: 1px solid #c3c4c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  padding: 16px 20px;
}

.meyvc-ui-page .meyvc-feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.meyvc-ui-page .meyvc-feature-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  border-radius: 4px;
}

/* Lucide SVG icons (MEYVC_Icons::svg) */
.meyvc-ico {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Abandoned carts list — toolbar (enqueued via meyvc-admin-ui; legacy meyvc-admin.css is not loaded)
   ------------------------------------------------------------------------- */
.meyvc-abandoned-carts-list .meyvc-ac-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--meyvc-space-md);
  margin-bottom: var(--meyvc-space-lg);
  padding: var(--meyvc-space-md) var(--meyvc-space-lg);
  background: var(--meyvc-bg-subtle);
  border: var(--meyvc-border-light);
  border-radius: var(--meyvc-radius-md);
  box-shadow: var(--meyvc-shadow-sm);
}

.meyvc-abandoned-carts-list .meyvc-ac-list-toolbar__primary {
  flex: 1 1 auto;
  min-width: min(100%, 17.5rem);
}

.meyvc-abandoned-carts-list .meyvc-ac-list-toolbar__secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--meyvc-space-sm);
  flex: 1 1 auto;
  min-width: min(100%, 22rem);
}

.meyvc-abandoned-carts-list .meyvc-ac-list-filters {
  list-style: none;
  margin: 0;
  padding: var(--meyvc-space-xs);
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--meyvc-space-xs);
  background: var(--meyvc-bg);
  border: var(--meyvc-border-light);
  border-radius: var(--meyvc-radius-sm);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.meyvc-abandoned-carts-list .meyvc-ac-list-filters li {
  margin: 0;
}

.meyvc-abandoned-carts-list .meyvc-ac-list-filters .button {
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--meyvc-text);
  padding: 0.375rem 0.75rem;
  line-height: 1.35;
  font-size: var(--meyvc-text-sm);
  font-weight: 500;
  border-radius: calc(var(--meyvc-radius-sm) - 1px);
  text-decoration: none;
}

.meyvc-abandoned-carts-list .meyvc-ac-list-filters .button:hover,
.meyvc-abandoned-carts-list .meyvc-ac-list-filters .button:focus {
  background: var(--meyvc-bg-tabs);
  color: var(--meyvc-text);
  box-shadow: none;
}

.meyvc-abandoned-carts-list .meyvc-ac-list-filters .button.button-primary {
  background: var(--meyvc-primary);
  color: #fff;
}

.meyvc-abandoned-carts-list .meyvc-ac-list-filters .button.button-primary:hover,
.meyvc-abandoned-carts-list .meyvc-ac-list-filters .button.button-primary:focus {
  background: var(--meyvc-primary-hover);
  color: #fff;
}

.meyvc-abandoned-carts-list .meyvc-ac-segment-filter {
  margin: 0;
}

.meyvc-abandoned-carts-list .meyvc-ac-segment-filter select {
  min-width: 10rem;
  max-width: 100%;
  height: var(--meyvc-input-height);
  margin: 0;
}

.meyvc-abandoned-carts-list .meyvc-ac-list-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--meyvc-space-sm);
  margin: 0;
}

.meyvc-abandoned-carts-list .meyvc-ac-list-search input[type='search'] {
  min-width: 12rem;
  max-width: 100%;
  height: var(--meyvc-input-height);
  margin: 0;
  box-sizing: border-box;
}

.meyvc-abandoned-carts-list .meyvc-ac-list-search .button {
  height: var(--meyvc-input-height);
  line-height: calc(var(--meyvc-input-height) - 2px);
  margin: 0;
}

.meyvc-abandoned-carts-list .meyvc-ac-list-toolbar + .meyvc-ui-empty-state {
  margin-top: 0;
}

@media screen and (max-width: 782px) {
  .meyvc-abandoned-carts-list .meyvc-ac-list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .meyvc-abandoned-carts-list .meyvc-ac-list-toolbar__secondary {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }

  .meyvc-abandoned-carts-list .meyvc-ac-segment-filter select {
    width: 100%;
  }

  .meyvc-abandoned-carts-list .meyvc-ac-list-search {
    width: 100%;
  }

  .meyvc-abandoned-carts-list .meyvc-ac-list-search input[type='search'] {
    flex: 1 1 auto;
    min-width: 0;
  }

  .meyvc-abandoned-carts-list .meyvc-ac-list-search .button {
    width: 100%;
  }
}
