/**
 * CampLink Redesign - Modern Dashboard System
 * Based on SKILL.md specs
 */

/* ===============================
   TIPOGRAFÍA PREMIUM — WORDPRESS
   Plus Jakarta Sans (todo el sistema)
   =============================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Aplicación global */
html,
body,
button,
input,
textarea,
select {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
}

/* Base */
body {
  font-size: 15px;
  line-height: 1.65;
  color: #1f2937;
  background-color: #f9fafb;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Títulos */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #1C1917;
}

/* Párrafos */
p {
  font-weight: 400;
}

/* Texto secundario */
small,
.label,
.help-text,
.wp-block-post-date {
  font-size: 13px;
  color: #6b7280;
}

/* Formularios */
input,
textarea,
select {
  font-size: 14px;
}

/* Botones */
button,
input[type="submit"],
.wp-block-button__link {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Tablas */
table th {
  font-weight: 600;
}

table td {
  font-weight: 400;
}

/* WordPress Theme Adjustments */
.wp-block-post-title {
  display: none;
}

/* Quita el "bajón" del contenido en Twenty Twenty-Five */
body.page main.wp-block-group.wp-block-group-is-layout-constrained {
  margin-top: 0 !important;
}

/* Quita padding superior del contenedor interno */
body.page .wp-block-group.alignfull.wp-block-group-is-layout-constrained {
  padding-top: 0 !important;
  margin-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ACF Field Hiding */
.acf-field[data-name="active_day"],
.acf-field[data-name="days"],
.acf-field[data-name="campers"] {
  display: none !important;
}

:root {
  /* ── ALM Design Tokens (canonical --alm-* names) ── */
  --alm-primary:       #FB923C;
  --alm-primary-dark:  #FB923C;
  --alm-primary-light: #FFF7ED;
  --alm-primary-mid:   #FFEDD5;

  --alm-surface:   #FFFFFF;
  --alm-surface-2: #FAFAF9;

  --alm-border:   #E7E5E4;
  --alm-border-2: #D6D3D1;

  --alm-text:   #1C1917;
  --alm-text-2: #44403C;
  --alm-text-3: #78716C;

  --alm-success: #16A34A;
  --alm-danger:  #DC2626;
  --alm-info:    #1D4ED8;
  --alm-warning: #D97706;

  --alm-scan-bg: #1C1917;

  --alm-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --alm-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --alm-shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --alm-shadow-lg: 0 8px 32px rgba(0,0,0,0.10);

  --alm-radius-xs: 6px;
  --alm-radius-sm: 10px;
  --alm-radius-md: 14px;
  --alm-radius-lg: 20px;

  /* Primary Amber / Honey */
  --primary-dark: #FB923C;
  /* Sidebar background, primary actions */
  --primary: #FB923C;
  /* Active states, hover backgrounds */
  --primary-light: #FFF7ED;
  /* Accents, badges, success indicators */
  --primary-subtle: #FFEDD5;
  /* Light backgrounds, card highlights */

  /* Surfaces */
  --surface: #FAFBFC;
  /* Main content background */
  --surface-card: #FFFFFF;
  /* Card backgrounds */
  --surface-elevated: #F5F7FA;
  /* Elevated sections, alternating rows */

  /* Text */
  --text-primary: #1A1D21;
  /* Main text */
  --text-secondary: #5F6B7A;
  /* Subtitles, descriptions */
  --text-muted: #9CA3AF;
  /* Placeholders, disabled text */

  /* Borders */
  --border: #E5E7EB;
  /* Card borders, dividers */
  --border-light: #F3F4F6;
  /* Subtle separators */

  /* Semantic Colors */
  --danger: #EF4444;
  /* Errors, delete actions, incomplete */
  --warning: #F59E0B;
  /* Warnings, pending states */
  --info: #3B82F6;
  /* Information, links */

  /* Status Backgrounds */
  --status-complete-bg: #F0FDF4;
  --status-complete-bg-hover: #DCFCE7;
  --status-complete-border: #BBF7D0;
  --status-incomplete-bg: #FEF2F2;
  --status-incomplete-bg-hover: #FEE2E2;
  --status-incomplete-border: #FECACA;

  /* Typography */
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Scale */
  --text-xs: 0.75rem;
  /* 12px - labels, badges */
  --text-sm: 0.8125rem;
  /* 13px - secondary text */
  --text-base: 0.875rem;
  /* 14px - body text */
  --text-md: 1rem;
  /* 16px - card titles */
  --text-lg: 1.25rem;
  /* 20px - section headers */
  --text-xl: 1.5rem;
  /* 24px - page titles */
  --text-2xl: 1.875rem;
  /* 30px - dashboard hero numbers */

  /* Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Spacing */
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.10);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

html,
body {
  overflow-x: hidden;
}

.plugin-wrapper img,
.plugin-wrapper video,
.plugin-wrapper iframe {
  max-width: 100%;
  height: auto;
}

.plugin-wrapper {
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.cl-flex {
  display: flex;
}

.cl-flex-wrap {
  flex-wrap: wrap;
}

/* =========================================
   Sidebar — ALM Sports Light
   ========================================= */
.plugin-sidebar {
  width: 260px;
  background: #FFFFFF;
  color: #374151;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease, transform 0.25s ease;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 1px 0 0 #E5E7EB, 4px 0 16px rgba(0,0,0,0.06);
}

.plugin-sidebar.collapsed {
  width: 72px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Brand ─────────────────────────────────────────── */
.alm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
}

.alm-brand-icon {
  width: 38px;
  height: 38px;
  background: #FB923C;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #FFFFFF;
}

.alm-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.alm-brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #111827;
  line-height: 1.2;
  white-space: nowrap;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.alm-brand-name strong {
  color: #FB923C;
  font-weight: 800;
}

.alm-brand-day {
  font-size: 11px;
  color: #9CA3AF;
  font-weight: 500;
  white-space: nowrap;
}

/* ─── Navigation ────────────────────────────────────── */
.alm-nav {
  flex: 1;
  padding: 10px 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.cl-nav-group {
  margin-bottom: 2px;
}

.cl-nav-group--bare {
  padding-top: 6px;
}

.cl-nav-label {
  padding: 14px 10px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9CA3AF;
  font-weight: 700;
  user-select: none;
}

/* Nav items */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 1px 0;
  border-radius: 8px;
  color: #6B7280;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.13s ease, color 0.13s ease;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.sidebar-nav-item:hover {
  background: #F9FAFB;
  color: #111827;
}

.sidebar-nav-item.active {
  background: rgba(251,146,60,0.12);
  color: #F97316;
  font-weight: 600;
}

/* Orange left-accent on active */
.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  background: #FB923C;
  border-radius: 0 3px 3px 0;
}

.sidebar-nav-item svg,
.sidebar-nav-item i {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Collapsed tooltips */
.plugin-sidebar.collapsed .sidebar-nav-label { display: none; }

.plugin-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 10px;
}

.plugin-sidebar.collapsed .sidebar-nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #1F2937;
  color: #F9FAFB;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 10000;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  border: 1px solid #E5E7EB;
}

.plugin-sidebar.collapsed .sidebar-nav-item:hover::after { opacity: 1; }
.plugin-sidebar.collapsed .cl-nav-label { display: none; }

/* ─── Bottom Section ─────────────────────────────────── */
.alm-sidebar-bottom {
  flex-shrink: 0;
  padding: 8px;
  border-top: 1px solid #F3F4F6;
}

.alm-sys-items {
  margin-bottom: 2px;
}

.alm-sys-item {
  font-size: 13px !important;
  color: #9CA3AF !important;
}

.alm-sys-item:hover {
  color: #374151 !important;
  background: #F9FAFB !important;
}

.alm-sys-item.active {
  color: #F97316 !important;
  background: rgba(251,146,60,0.12) !important;
}

/* User block */
.alm-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #F9FAFB;
  margin-top: 4px;
}

.alm-su-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FB923C;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}

.alm-su-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alm-su-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.alm-su-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.alm-su-role {
  font-size: 11px;
  color: #9CA3AF;
}

.alm-su-logout {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  border-radius: 6px;
  transition: all 0.13s ease;
  flex-shrink: 0;
}

.alm-su-logout:hover {
  color: #EF4444;
  background: rgba(239,68,68,0.08);
}

.alm-su-logout i,
.alm-su-logout svg {
  width: 15px;
  height: 15px;
}


/* =========================================
   Header Bar — Redesigned
   ========================================= */
.plugin-header {
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  height: 58px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 9998;
  transition: left 0.25s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.plugin-wrapper.sidebar-collapsed .plugin-header {
  left: 72px;
}

.plugin-main-content {
  position: fixed;
  top: 58px;
  left: 260px;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #F9FAFB;
  padding: var(--space-8);
  transition: left 0.25s ease;
  margin: 0;
  max-width: unset;
  min-height: unset;
}

.plugin-wrapper.sidebar-collapsed .plugin-main-content {
  left: 72px;
}

/* Force header visible */
#cl-plugin-header { display: flex !important; }

/* Suppress WP theme headers */
header:not(.plugin-header):not(#cl-plugin-header),
.site-header, #masthead, header.tc-header {
  display: none !important;
}

/* ─── Header Left ─────────────────────────────────── */
.pheader-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.pheader-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pheader-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.pheader-mode-chip i,
.pheader-mode-chip svg { width: 11px; height: 11px; }

.pheader-mode--global { background: #1E293B; color: #94A3B8; }
.pheader-mode--camp   { background: #EFF6FF; color: #1D4ED8; }
.pheader-mode--state  { background: #F5F3FF; color: #7C3AED; }
.pheader-mode--branch { background: #F0FDF4; color: #16A34A; }

.pheader-path {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* ─── Header Right ────────────────────────────────── */
.pheader-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Quick action cluster — grouped pill container */
.pheader-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 3px;
}

.pheader-qa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  text-decoration: none;
  transition: all 0.13s ease;
  white-space: nowrap;
}

.pheader-qa:hover {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pheader-qa.active {
  background: #FB923C;
  color: #0F172A;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(251,146,60,0.35);
}

.pheader-qa i,
.pheader-qa svg { width: 15px; height: 15px; flex-shrink: 0; }

.pheader-qa-label { /* shown/hidden by breakpoint */ }

/* Vertical separator */
.pheader-sep {
  width: 1px;
  height: 26px;
  background: #E5E7EB;
  margin: 0 2px;
}

/* User section */
.pheader-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pheader-avatar {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #FB923C;
  color: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(251,146,60,0.3);
}

.pheader-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pheader-user-info {
  display: flex;
  flex-direction: column;
}

.pheader-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  white-space: nowrap;
}

.pheader-user-role {
  font-size: 11px;
  color: #9CA3AF;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

/* Logout */
.pheader-logout {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  border-radius: 8px;
  transition: all 0.13s ease;
  margin-left: 2px;
}

.pheader-logout:hover {
  color: #EF4444;
  background: #FEF2F2;
}

.pheader-logout i,
.pheader-logout svg { width: 17px; height: 17px; }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #F3F4F6;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.13s ease;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover {
  background: #E5E7EB;
  color: #111827;
}

.mobile-menu-toggle i,
.mobile-menu-toggle svg { width: 20px; height: 20px; }


/* =========================================
   View Toggle
   ========================================= */
.view-toggle {
  display: inline-flex;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-secondary);
  background: var(--surface-card);
}

.view-toggle-btn.active {
  background: var(--surface-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.view-toggle-btn svg,
.view-toggle-btn i {
  width: 18px;
  height: 18px;
}

/* =========================================
   Status Indicators (Rows & Badges)
   ========================================= */

/* === COMPLETED ROW — soft green background === */
.modern-table tbody tr.status-complete {
  background: var(--status-complete-bg);
  /* #F0FDF4 */
}

.modern-table tbody tr.status-complete:hover {
  background: var(--status-complete-bg-hover);
  /* #DCFCE7 */
}

/* Green left border indicator */
.modern-table tbody tr.status-complete td:first-child {
  box-shadow: inset 4px 0 0 0 var(--primary-light);
}

/* === INCOMPLETE ROW — soft red background === */
.modern-table tbody tr.status-incomplete {
  background: var(--status-incomplete-bg);
  /* #FEF2F2 */
}

.modern-table tbody tr.status-incomplete:hover {
  background: var(--status-incomplete-bg-hover);
  /* #FEE2E2 */
}

/* Red left border indicator */
.modern-table tbody tr.status-incomplete td:first-child {
  box-shadow: inset 4px 0 0 0 var(--danger);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1.5;
}

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

.badge-danger {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-warning {
  background: #FFEDD5;
  color: #9A3412;
}

.badge-info {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-neutral {
  background: #F3F4F6;
  color: #4B5563;
}

/* =========================================
   Stat Cards
   ========================================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon.green {
  background: #FFEDD5;
  color: #FB923C;
}

.stat-card-icon.blue {
  background: #EFF6FF;
  color: #3B82F6;
}

.stat-card-icon.amber {
  background: #FFF7ED;
  color: #F59E0B;
}

.stat-card-icon.red {
  background: #FEF2F2;
  color: #EF4444;
}

.stat-card-content {
  flex: 1;
}

.stat-card-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-1);
}

.stat-card-number {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card-trend {
  font-size: var(--text-xs);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-card-trend.up {
  color: var(--primary);
}

.stat-card-trend.down {
  color: var(--danger);
}

/* =========================================
   Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  font-family: var(--font-primary);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.5;
}

.btn svg,
.btn i {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-md);
}

.cl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  font-family: var(--font-primary);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.5;
}

.cl-btn-primary {
  background: var(--primary);
  color: white;
  border-color: transparent;
}

.cl-btn-primary:hover {
  background: var(--primary-dark);
}

.cl-btn-secondary {
  background: white;
  color: var(--text-primary);
  border-color: var(--border);
}

.cl-btn-secondary:hover {
  background: var(--surface-elevated);
  border-color: var(--text-muted);
}

.cl-btn-success {
  background: var(--primary-light);
  color: white;
  border-color: transparent;
}

.cl-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.cl-btn-ghost:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.cl-btn-icon {
  padding: var(--space-2);
  width: 36px;
  height: 36px;
  color: var(--text-muted);
}

.cl-btn-icon:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.cl-btn-icon.active {
  background: var(--surface-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.cl-btn-icon svg,
.cl-btn-icon i {
  width: 18px;
  height: 18px;
}

/* =========================================
   Modern Table Base Styles
   ========================================= */
.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.modern-table thead th {
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.modern-table tbody td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

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

.modern-table tbody tr {
  transition: background var(--transition-fast);
}

/* Table action buttons */
.table-actions {
  display: flex;
  gap: var(--space-2);
}

.table-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.table-action-btn svg,
.table-action-btn i {
  width: 16px;
  height: 16px;
}

.table-action-btn:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

.table-action-btn.danger:hover {
  background: #FEF2F2;
  color: var(--danger);
}

.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =========================================
   Gallery/Bingo Card Base Styles
   ========================================= */
.dashboard-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
}

.gallery-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Top accent bar — controlled by status classes */
.gallery-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

/* Default hover for cards without status */
.gallery-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.gallery-card:hover::before {
  opacity: 1;
}

/* Card Icon Container */
.gallery-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card-icon svg,
.gallery-card-icon i {
  width: 24px;
  height: 24px;
}

/* Card Text */
.gallery-card-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}

.gallery-card-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  line-height: 1;
}

.gallery-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.gallery-card-status {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* === FULL SCREEN MODE === */
.view-section.cl-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 2147483647 !important;
  /* Max z-index to override everything */
  background: var(--surface) !important;
  padding: var(--space-6) !important;
  overflow-y: auto !important;
  margin: 0 !important;
}

.view-section.cl-fullscreen .cl-gallery-body {
  max-width: 1600px;
  margin: 0 auto;
}

/* Floating exit button for fullscreen */
.cl-fullscreen-exit {
  display: none;
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 100000;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.view-section.cl-fullscreen .cl-fullscreen-exit {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Card hover actions (edit, delete, etc.) */
.gallery-card-actions {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.gallery-card:hover .gallery-card-actions {
  opacity: 1;
}

/* Fade-in animation for cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-card {
  animation: fadeInUp 0.4s ease both;
}

.gallery-card:nth-child(1) {
  animation-delay: 0.03s;
}

.gallery-card:nth-child(2) {
  animation-delay: 0.06s;
}

.gallery-card:nth-child(3) {
  animation-delay: 0.09s;
}

.gallery-card:nth-child(4) {
  animation-delay: 0.12s;
}

.gallery-card:nth-child(5) {
  animation-delay: 0.15s;
}

.gallery-card:nth-child(6) {
  animation-delay: 0.18s;
}

.gallery-card:nth-child(7) {
  animation-delay: 0.21s;
}

.gallery-card:nth-child(8) {
  animation-delay: 0.24s;
}

.gallery-card:nth-child(9) {
  animation-delay: 0.27s;
}

.gallery-card:nth-child(10) {
  animation-delay: 0.30s;
}

/* === STATUS CARDS === */
/* === COMPLETED CARD — soft green === */
.gallery-card.status-complete {
  background: var(--status-complete-bg);
  /* #F0FDF4 */
  border-color: var(--status-complete-border);
  /* #BBF7D0 */
}

/* Green top accent bar always visible on complete cards */
.gallery-card.status-complete::before {
  background: var(--primary-light);
  opacity: 1;
}

.gallery-card.status-complete:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px rgba(251, 146, 60, 0.15);
  transform: translateY(-2px);
}

/* Green icon container */
.gallery-card.status-complete .gallery-card-icon {
  background: #DCFCE7;
  color: #166534;
}

/* === INCOMPLETE CARD — soft red === */
.gallery-card.status-incomplete {
  background: var(--status-incomplete-bg);
  /* #FEF2F2 */
  border-color: var(--status-incomplete-border);
  /* #FECACA */
}

/* Red top accent bar always visible on incomplete cards */
.gallery-card.status-incomplete::before {
  background: var(--danger);
  opacity: 1;
}

.gallery-card.status-incomplete:hover {
  border-color: var(--danger);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.12);
  transform: translateY(-2px);
}

/* Red icon container */
.gallery-card.status-incomplete .gallery-card-icon,
.gallery-card .gallery-card-icon.icon-incomplete {
  background: #FEE2E2;
  color: #991B1B;
}

/* =========================================
   Search / Filter Bar
   ========================================= */
.search-filter-bar,
.cl-search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input-wrapper svg,
.search-input-wrapper i,
.cl-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease;
}

.search-input,
.cl-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-10);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-primary);
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
  line-height: 1.5;
}

.search-input:focus,
.cl-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.15);
}

.search-input::placeholder,
.cl-search-input::placeholder {
  color: var(--text-muted);
}

.search-input:not(:placeholder-shown)~.cl-search-icon,
.cl-search-input:not(:placeholder-shown)~.cl-search-icon {
  opacity: 0;
}

/* =========================================
   Hide WordPress Default Elements
   ========================================= */
.wrap>h1:first-of-type,
.wrap>h2:first-of-type,
.wp-heading-inline {
  display: none !important;
}

/* Hide WordPress admin notices inside the plugin area */
.plugin-wrapper .notice,
.plugin-wrapper .updated,
.plugin-wrapper .error,
.plugin-wrapper .update-nag {
  display: none !important;
}

/* Hide screen options and help tabs */
#screen-meta,
#screen-meta-links {
  display: none !important;
}

/* Force full-width layout (override Twenty Twenty-Five centering) */
.wp-site-blocks {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.wp-block-post-content {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Override theme container constraints */
.entry-content,
.site-main,
.wp-block-group__inner-container {
  max-width: none !important;
}

/* Override WordPress default body styles inside plugin */
.plugin-wrapper {
  margin: 0 !important;
  padding: 0 !important;
}

/* Force cl-container to full width */
.cl-container {
  max-width: 100% !important;
  margin: 0 !important;
  padding: var(--space-6) !important;
  width: 100% !important;
}

/* Reset box-sizing for plugin area */
.plugin-wrapper *,
.plugin-wrapper *::before,
.plugin-wrapper *::after,
.cl-container *,
.cl-container *::before,
.cl-container *::after {
  box-sizing: border-box;
}

/* =========================================
   Main Layout Structure
   ========================================= */
.plugin-wrapper {
  font-family: var(--font-primary);
  color: var(--text-primary);
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.plugin-main-content {
  position: fixed;
  top: 58px;
  left: 260px;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #F9FAFB;
  padding: var(--space-8);
  transition: left 0.25s ease;
  margin: 0;
  flex: unset;
  max-width: unset;
  min-height: unset;
}

.plugin-wrapper.sidebar-collapsed .plugin-main-content {
  left: 72px;
}

/* Page Header with View Toggle */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.page-header-left {
  display: flex;
  flex-direction: column;
}

.page-header-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.page-header-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* =========================================
   Responsive Behavior
   ========================================= */
@media (min-width: 1025px) {
  .plugin-main-content {
    padding: var(--space-6);
  }

  .mobile-menu-toggle {
    display: none;
  }
}

@media (max-width: 1024px) {
  .plugin-sidebar {
    transform: translateX(-100%);
    width: 260px;
    top: 0;
  }

  .plugin-sidebar.mobile-open {
    transform: translateX(0);
  }

  .plugin-main-content {
    left: 0 !important;
    padding: var(--space-4);
    transition: left var(--transition-base);
  }

  .plugin-wrapper:has(.plugin-sidebar.mobile-open) .plugin-main-content {
    /* Instead of forcing margin, we can slightly push the content or just let the backdrop cover it. 
       Most mobile sidebars use an overlay (backdrop). We'll keep margin 0 but rely on the backdrop. */
  }

  .plugin-header {
    left: 0;
    padding: 0 var(--space-4);
    transition: padding var(--transition-base), left var(--transition-base);
  }

  .mobile-menu-toggle {
    display: inline-flex;
  }

  .dashboard-gallery {
    gap: var(--space-3);
  }

  .stats-row {
    gap: var(--space-3);
  }

  .search-filter-bar,
  .cl-search-bar {
    padding: var(--space-3);
  }

  .page-header {
    margin-bottom: var(--space-5);
  }
}

@media (max-width: 768px) {
  .plugin-main-content {
    padding: calc(52px + var(--space-3)) var(--space-3) var(--space-3) var(--space-3);
  }

  .plugin-header {
    padding: 0 var(--space-3);
    height: 52px;
  }

  .header-action-label {
    display: none;
  }

  .header-action-btn {
    padding: var(--space-2);
    width: 38px;
    height: 38px;
    justify-content: center;
  }

  .header-user-info {
    display: none;
  }

  .header-avatar {
    width: 34px;
    height: 34px;
    font-size: var(--text-sm);
  }

  .header-actions {
    gap: var(--space-1);
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .stat-card {
    padding: var(--space-3);
  }

  .stat-card-number {
    font-size: var(--text-lg);
  }

  .page-header {
    margin-bottom: var(--space-4);
  }

  .page-header-title {
    font-size: var(--text-lg);
  }

  .dashboard-gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-3);
  }

  .gallery-card {
    padding: var(--space-4);
  }

  .gallery-card-value {
    font-size: var(--text-xl);
  }

  .gallery-card-icon {
    width: 40px;
    height: 40px;
  }

  .gallery-card-icon svg,
  .gallery-card-icon i {
    width: 20px;
    height: 20px;
  }

  .table-responsive-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
  }

  .table-responsive-wrapper .modern-table {
    border: none;
    border-radius: 0;
    min-width: 600px;
  }



  .search-filter-bar,
  .cl-search-bar {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .search-input-wrapper {
    width: 100%;
    flex: none;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .badge {
    font-size: 0.65rem;
    padding: 1px 6px;
  }

  .plugin-wrapper input[type="text"],
  .plugin-wrapper input[type="email"],
  .plugin-wrapper input[type="number"],
  .plugin-wrapper input[type="password"],
  .plugin-wrapper input[type="search"],
  .plugin-wrapper input[type="url"],
  .plugin-wrapper select,
  .plugin-wrapper textarea {
    width: 100%;
    font-size: 16px;
  }

  .form-group {
    flex-direction: column;
    gap: var(--space-2);
  }

  .form-group label {
    width: 100%;
  }

  .plugin-modal {
    width: calc(100% - 20px) !important;
    max-width: 100%;
    margin: 10px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  .dashboard-gallery {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .page-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .gallery-card {
    padding: var(--space-4);
  }

  .gallery-card-actions {
    opacity: 1;
  }

  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

@media (max-width: 480px) {
  .plugin-main-content {
    padding: 10px;
    top: 48px;
  }

  .plugin-header {
    padding: 0 10px;
    height: 48px;
  }

  .header-action-btn {
    width: 34px;
    height: 34px;
  }

  .header-action-btn svg,
  .header-action-btn i {
    width: 16px;
    height: 16px;
  }

  .header-avatar {
    width: 30px;
    height: 30px;
    font-size: var(--text-xs);
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .stat-card {
    padding: var(--space-3);
    gap: var(--space-3);
  }

  .stat-card-icon {
    width: 36px;
    height: 36px;
  }

  .stat-card-label {
    font-size: var(--text-xs);
  }

  .stat-card-number {
    font-size: var(--text-md);
  }

  .dashboard-gallery {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .gallery-card {
    padding: var(--space-3);
    gap: var(--space-2);
  }

  .gallery-card-title {
    font-size: var(--text-sm);
  }

  .gallery-card-value {
    font-size: var(--text-lg);
  }

  .gallery-card-icon {
    width: 36px;
    height: 36px;
  }

  .gallery-card-icon svg,
  .gallery-card-icon i {
    width: 18px;
    height: 18px;
  }

  .gallery-card-actions {
    top: var(--space-2);
    right: var(--space-2);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .page-header-title {
    font-size: var(--text-md);
  }

  .page-header-subtitle {
    font-size: var(--text-xs);
  }

  .page-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .view-toggle-btn {
    width: 32px;
    height: 28px;
  }

  .modern-table thead th {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  .modern-table tbody td {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }

  .table-action-btn {
    width: 28px;
    height: 28px;
  }

  .table-action-btn svg,
  .table-action-btn i {
    width: 14px;
    height: 14px;
  }

  .search-filter-bar,
  .cl-search-bar {
    padding: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .search-input,
  .cl-search-input {
    padding: 6px 8px 6px 36px;
    font-size: var(--text-sm);
  }

  .btn {
    padding: 6px var(--space-3);
    font-size: var(--text-sm);
  }

  .btn-sm {
    padding: 4px var(--space-2);
    font-size: var(--text-xs);
  }
}

@media (max-width: 360px) {
  .dashboard-gallery {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .stats-row {
    gap: var(--space-2);
  }

  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

.plugin-header {
  top: 0 !important;
}

body:not(.admin-bar) .plugin-header {
  top: 0 !important;
}

/* =========================================
   ACF Form Overrides (Camper Registration)
   ========================================= */

/* Wrapper for the ACF form */
.cl-acf-form-wrapper {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--border);
}

/* Hide NFC UID field when registering a camper */
.cl-acf-form-wrapper .acf-field-69a6e9712f8d4 {
  display: none !important;
}

/* Tabs Container */
.acf-tab-wrap {
  background: transparent !important;
  border-bottom: 2px solid var(--border-light) !important;
  margin-bottom: var(--space-6) !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
}

.acf-tab-group {
  border-bottom: none !important;
  margin-bottom: -2px !important;
  display: flex !important;
  gap: var(--space-4) !important;
  flex-wrap: wrap !important;
  background: transparent !important;
  border: none !important;
}

.acf-tab-group li {
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

.acf-tab-group li a {
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-primary) !important;
  font-weight: var(--font-medium) !important;
  font-size: var(--text-base) !important;
  padding: var(--space-3) var(--space-1) !important;
  border-bottom: 2px solid transparent !important;
  transition: all var(--transition-fast) !important;
  text-decoration: none !important;
}

.acf-tab-group li.active a,
.acf-tab-group li a:hover {
  background: transparent !important;
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

/* Hide default ACF tab title inside content */
.acf-field-tab .acf-label {
  display: none !important;
}

/* Inputs & Textareas */
.acf-field input[type="text"],
.acf-field input[type="email"],
.acf-field input[type="number"],
.acf-field input[type="password"],
.acf-field input[type="search"],
.acf-field input[type="url"],
.acf-field input[type="date"],
.acf-field select,
.acf-field textarea {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-3) var(--space-4) !important;
  font-size: var(--text-base) !important;
  font-family: var(--font-primary) !important;
  color: var(--text-primary) !important;
  background: var(--surface) !important;
  transition: all var(--transition-fast) !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: 44px !important;
}

.acf-field input:focus,
.acf-field select:focus,
.acf-field textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.15) !important;
  outline: none !important;
}

/* Field Labels */
.acf-label label {
  font-family: var(--font-primary) !important;
  font-weight: var(--font-medium) !important;
  font-size: var(--text-sm) !important;
  color: var(--text-secondary) !important;
  margin-bottom: var(--space-2) !important;
}

/* Cleanup default WP/ACF borders */
.acf-fields.-left>.acf-field:before {
  display: none !important;
}

/* Readonly fields styling */
.cl-readonly input,
.cl-readonly select,
.cl-readonly textarea {
  background-color: var(--surface-elevated) !important;
  color: var(--text-muted) !important;
  pointer-events: none !important;
  border-color: var(--border-light) !important;
}

/* Submit Button */
.acf-form-submit .cl-btn {
  width: auto !important;
  min-width: 200px !important;
  justify-content: center !important;
}

/* Responsive Grid Adjustment */
@media (min-width: 768px) {
  .acf-fields.-top {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-4) !important;
    border: none !important;
    background: transparent !important;
  }

  .acf-field {
    width: 100% !important;
    border-top: none !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Full width fields */
  .acf-field[data-width="100"],
  .acf-field-textarea,
  .acf-field-wysiwyg,
  .acf-field-repeater,
  .acf-field-tab {
    grid-column: 1 / -1 !important;
  }
}

/* =========================================
   ACF Repeater Table Styling
   ========================================= */

/* Scrollable wrapper for mobile */
.cl-acf-form-wrapper .acf-repeater {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* --- Table structure --- */
.cl-acf-form-wrapper .acf-repeater .acf-table {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: visible !important;
  background: var(--surface-card) !important;
  width: 100% !important;
  min-width: 700px !important;
  table-layout: auto !important;
}

/* Restore proper table-cell display on repeater cells
   (prevents the global display:block rule from collapsing columns) */
.cl-acf-form-wrapper .acf-repeater .acf-table thead th.acf-field {
  display: table-cell !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-table tbody td.acf-field {
  display: table-cell !important;
  vertical-align: middle !important;
}

/* --- Header --- */
.cl-acf-form-wrapper .acf-repeater .acf-table thead th {
  background: var(--surface-elevated) !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-primary) !important;
  font-weight: var(--font-semibold) !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--border) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  white-space: nowrap !important;
}

/* --- Per-column min-widths by data-name --- */
.cl-acf-form-wrapper .acf-repeater td[data-name="name"],
.cl-acf-form-wrapper .acf-repeater th[data-name="name"] {
  min-width: 160px !important;
}

.cl-acf-form-wrapper .acf-repeater td[data-name="email"],
.cl-acf-form-wrapper .acf-repeater th[data-name="email"] {
  min-width: 180px !important;
}

.cl-acf-form-wrapper .acf-repeater td[data-name="phone"],
.cl-acf-form-wrapper .acf-repeater th[data-name="phone"] {
  min-width: 140px !important;
}

.cl-acf-form-wrapper .acf-repeater td[data-name="relation"],
.cl-acf-form-wrapper .acf-repeater th[data-name="relation"] {
  min-width: 130px !important;
}

.cl-acf-form-wrapper .acf-repeater td[data-name="id_number"],
.cl-acf-form-wrapper .acf-repeater th[data-name="id_number"] {
  min-width: 130px !important;
}

/* Compact boolean / toggle columns */
.cl-acf-form-wrapper .acf-repeater td[data-name="whatsapp"],
.cl-acf-form-wrapper .acf-repeater th[data-name="whatsapp"],
.cl-acf-form-wrapper .acf-repeater td[data-name="is_primary"],
.cl-acf-form-wrapper .acf-repeater th[data-name="is_primary"] {
  min-width: 70px !important;
  text-align: center !important;
}

/* --- Body cells --- */
.cl-acf-form-wrapper .acf-repeater .acf-table tbody td {
  padding: 8px 14px !important;
  border-bottom: 1px solid var(--border-light) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  background: var(--surface-card) !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-table tbody tr:last-child td {
  border-bottom: none !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-table tbody tr:hover td {
  background: rgba(0, 0, 0, 0.015) !important;
}

/* --- Text inputs inside repeater cells --- */
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="text"],
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="email"],
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="number"],
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="tel"],
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="url"],
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="search"],
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="password"],
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="date"],
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input select {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 7px 12px !important;
  font-size: 0.875rem !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast) !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input textarea {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  min-height: 38px !important;
  padding: 7px 12px !important;
  font-size: 0.875rem !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast) !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input:focus,
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input select:focus,
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.12) !important;
  outline: none !important;
}

/* --- Checkboxes / true-false inside repeater cells --- */
.cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  accent-color: var(--primary) !important;
  border-radius: 4px !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

/* Center the checkbox within its cell */
.cl-acf-form-wrapper .acf-repeater .acf-table td.acf-field-true-false .acf-input,
.cl-acf-form-wrapper .acf-repeater .acf-table td[data-name="whatsapp"] .acf-input,
.cl-acf-form-wrapper .acf-repeater .acf-table td[data-name="is_primary"] .acf-input {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 38px !important;
}

/* Hide redundant labels inside repeater cells (header already shows them) */
.cl-acf-form-wrapper .acf-repeater.-table td.acf-field .acf-label {
  display: none !important;
}

/* --- Row handle columns (order + remove) --- */
.cl-acf-form-wrapper .acf-repeater .acf-row-handle {
  display: table-cell !important;
  vertical-align: middle !important;
  text-align: center !important;
  width: 44px !important;
  min-width: 44px !important;
  background: var(--surface-elevated) !important;
  border-right: 1px solid var(--border-light) !important;
  padding: 6px !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-row-handle.remove {
  background: var(--surface-card) !important;
  border-right: none !important;
  border-left: 1px solid var(--border-light) !important;
}

/* Stack icons vertically inside the handle cell */
.cl-acf-form-wrapper .acf-repeater .acf-row-handle .acf-icon {
  display: flex !important;
  margin: 3px auto !important;
}

/* --- Icons (add / remove / duplicate / order) --- */
.cl-acf-form-wrapper .acf-repeater .acf-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  margin: 3px !important;
  padding: 0 !important;
  background: var(--surface-card) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  vertical-align: middle !important;
  line-height: 1 !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-icon:hover {
  background: var(--surface-elevated) !important;
  color: var(--text-primary) !important;
  border-color: var(--primary-light, var(--border)) !important;
  transform: scale(1.05) !important;
}

/* =========================================
   Modals (Fixed & Responsive)
   ========================================= */
.cl-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  /* Above sidebar (9999) and header (9998) */
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  /* Centering logic handled via flex helper below */
}

/* Force flex centering when JS sets display: block */
.cl-modal[style*="display: block"],
.cl-modal.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.cl-modal-dialog {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  /* Default desktop width */
  margin: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  animation: cl-modal-in 0.2s ease-out;
}

@keyframes cl-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cl-modal-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cl-modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0;
}

.cl-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.cl-modal-close:hover {
  background: var(--surface-elevated);
  color: var(--danger);
}

.cl-modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

/* Mobile / Tablet Adjustments */
@media (max-width: 768px) {
  .cl-modal {
    padding: 10px;
  }

  .cl-modal-dialog {
    max-width: 100%;
    width: 100%;
    margin: auto;
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 20px);
  }

  .cl-modal-header {
    padding: var(--space-3) var(--space-4);
  }

  .cl-modal-body {
    padding: var(--space-4);
  }
}

.cl-acf-form-wrapper .acf-repeater .acf-icon.-plus:hover {
  color: var(--primary) !important;
  border-color: var(--primary-light) !important;
  background: var(--primary-subtle) !important;
}

/* --- Add-row button --- */
.cl-acf-form-wrapper .acf-repeater .acf-actions {
  text-align: right !important;
  padding: var(--space-4) 0 var(--space-2) !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: var(--surface-card) !important;
  color: var(--primary) !important;
  border: 1px solid var(--border) !important;
  padding: 8px 20px !important;
  border-radius: var(--radius-md) !important;
  font-family: var(--font-primary) !important;
  font-size: 0.875rem !important;
  font-weight: var(--font-medium) !important;
  text-decoration: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  cursor: pointer !important;
  height: 38px !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
}

.cl-acf-form-wrapper .acf-repeater .acf-button:hover {
  background: var(--primary-subtle) !important;
  border-color: var(--primary-light) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

/* =========================================
   ACF Repeater — Mobile Card Layout
   ========================================= */
@media (max-width: 767px) {

  /* Remove the fixed min-width so the table doesn't force scroll */
  .cl-acf-form-wrapper .acf-repeater .acf-table {
    min-width: 0 !important;
    display: block !important;
    border: none !important;
  }

  /* Hide the header row — labels will appear inside each cell */
  .cl-acf-form-wrapper .acf-repeater .acf-table thead {
    display: none !important;
  }

  /* Make tbody a block container */
  .cl-acf-form-wrapper .acf-repeater .acf-table tbody {
    display: block !important;
  }

  /* Each row becomes a card */
  .cl-acf-form-wrapper .acf-repeater .acf-table tbody tr.acf-row {
    display: block !important;
    background: var(--surface-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 12px !important;
    margin-bottom: 12px !important;
    position: relative !important;
  }

  /* Each cell becomes a stacked block */
  .cl-acf-form-wrapper .acf-repeater .acf-table tbody td.acf-field {
    display: block !important;
    width: 100% !important;
    padding: 6px 0 !important;
    border: none !important;
    text-align: left !important;
    min-width: 0 !important;
  }

  /* Show labels inside cells on mobile (they're normally hidden in table mode) */
  .cl-acf-form-wrapper .acf-repeater.-table td.acf-field .acf-label {
    display: block !important;
    margin-bottom: 4px !important;
  }

  .cl-acf-form-wrapper .acf-repeater.-table td.acf-field .acf-label label {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
  }

  /* Inputs fill full width */
  .cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input input,
  .cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input select,
  .cl-acf-form-wrapper .acf-repeater .acf-table td .acf-input textarea {
    width: 100% !important;
  }

  /* Boolean fields: inline layout (label + checkbox side by side) */
  .cl-acf-form-wrapper .acf-repeater .acf-table td.acf-field-true-false,
  .cl-acf-form-wrapper .acf-repeater .acf-table td[data-name="whatsapp"],
  .cl-acf-form-wrapper .acf-repeater .acf-table td[data-name="is_primary"] {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .cl-acf-form-wrapper .acf-repeater .acf-table td.acf-field-true-false .acf-label,
  .cl-acf-form-wrapper .acf-repeater .acf-table td[data-name="whatsapp"] .acf-label,
  .cl-acf-form-wrapper .acf-repeater .acf-table td[data-name="is_primary"] .acf-label {
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  .cl-acf-form-wrapper .acf-repeater .acf-table td.acf-field-true-false .acf-input,
  .cl-acf-form-wrapper .acf-repeater .acf-table td[data-name="whatsapp"] .acf-input,
  .cl-acf-form-wrapper .acf-repeater .acf-table td[data-name="is_primary"] .acf-input {
    min-height: auto !important;
    justify-content: flex-start !important;
  }

  /* Row handles: horizontal bar at bottom of card */
  .cl-acf-form-wrapper .acf-repeater .acf-row-handle {
    display: none !important;
  }

  .cl-acf-form-wrapper .acf-repeater .acf-row-handle.remove {
    display: flex !important;
    width: 100% !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    padding: 8px 0 0 !important;
    margin-top: 8px !important;
    border-top: 1px solid var(--border-light) !important;
    border-left: none !important;
    background: transparent !important;
  }

  .cl-acf-form-wrapper .acf-repeater .acf-row-handle.remove .acf-icon {
    display: inline-flex !important;
    margin: 0 !important;
  }
}

/* =========================================
   Fix for ACF Label/Input Collision
   ========================================= */

/* CRITICAL: ACF hidden fields must ALWAYS be hidden.
   ACF uses .acf-hidden (without !important) to toggle tab content.
   Without this rule, any display:block!important elsewhere wins. */
.cl-acf-form-wrapper .acf-hidden,
.cl-acf-form-wrapper [hidden] {
  display: none !important;
}

/* Force labels to be above inputs */
.cl-acf-form-wrapper .acf-field:not(.acf-field-tab) .acf-label {
  display: block !important;
  width: 100% !important;
  margin-bottom: var(--space-2) !important;
  float: none !important;
}

.cl-acf-form-wrapper .acf-field:not(.acf-field-tab) .acf-label label {
  display: block !important;
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

/* Ensure input container clears the label */
.cl-acf-form-wrapper .acf-field:not(.acf-field-tab) .acf-input {
  display: block !important;
  width: 100% !important;
  float: none !important;
  clear: both !important;
}

/* Specific fix for checkbox/radio labels (e.g., true_false) usually needing flex/inline */
.cl-acf-form-wrapper .acf-field-true-false .acf-label,
.cl-acf-form-wrapper .acf-field-checkbox .acf-label,
.cl-acf-form-wrapper .acf-field-radio .acf-label {
  margin-bottom: var(--space-2) !important;
}

/* Reset any flex behavior on the field wrapper itself that might align items in row */
/* IMPORTANT: Exclude hidden fields (tabs) and repeater table cells (td/th.acf-field) */
.cl-acf-form-wrapper .acf-field:not(.acf-field-tab):not(.acf-hidden):not([style*="display: none"]):not(td):not(th) {
  display: block !important;
  flex-direction: column !important;
}

/* Hide ACF tab-field blocks entirely inside the form body.
   The tab navigation lives in .acf-tab-wrap (separate element),
   so these field wrappers are only structural — showing them
   causes duplicate tab names as underlined text links. */
.cl-acf-form-wrapper .acf-field.acf-field-tab {
  display: none !important;
}

/* Fix Tab Layout to wrap and fill width */
.cl-acf-form-wrapper .acf-tab-wrap {
  display: block !important;
  width: 100% !important;
  clear: both !important;
  margin-bottom: var(--space-6) !important;
}

.cl-acf-form-wrapper ul.acf-tab-group {
  display: flex !important;
  width: 100% !important;
  gap: var(--space-2) !important;
  flex-wrap: wrap !important;
  border-bottom: 2px solid var(--border-light) !important;
}

.cl-acf-form-wrapper ul.acf-tab-group li {
  flex: 1 1 auto !important;
  min-width: 120px !important;
  margin: 0 !important;
}

.cl-acf-form-wrapper ul.acf-tab-group li a {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  padding: var(--space-3) var(--space-2) !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

/* Sticky Header */
.page-header {
  position: sticky;
  top: 0;
  z-index: 99;
  /* background-color: var(--bg-body, #F3F4F6); REMOVED per user feedback */
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-base);
  background: transparent;
  /* Ensure transparent if not scrolled */
}

/* =========================================
   Dashboard Shared — Alert Stat Cards
   ========================================= */

.cl-alert-acc-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  padding: 1rem;
}

.cl-alert-stat {
  border-radius: 12px;
  border: 1.5px solid;
  padding: .875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: box-shadow .15s;
}

.cl-alert-stat:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, .07);
}

.cl-alert-stat--ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.cl-alert-stat--warn {
  background: #fff7ed;
  border-color: #fed7aa;
}

.cl-alert-stat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.cl-alert-stat-name {
  font-size: .85rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.cl-alert-stat-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.cl-alert-stat--ok .cl-alert-stat-icon {
  color: #22c55e;
}

.cl-alert-stat--warn .cl-alert-stat-icon {
  color: #d97706;
}

.cl-alert-stat-bar {
  height: 6px;
  border-radius: 999px;
  margin: 0;
}

.cl-alert-stat-bar .cl-progress-bar {
  border-radius: 999px;
}

.cl-alert-stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.cl-alert-stat-counts {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
}

.cl-alert-stat-miss {
  font-size: .75rem;
  font-weight: 600;
  color: #d97706;
  background: #ffedd5;
  border-radius: 999px;
  padding: 1px 8px;
}

.cl-alert-stat-ok-lbl {
  font-size: .75rem;
  font-weight: 600;
  color: #22c55e;
  background: #dcfce7;
  border-radius: 999px;
  padding: 1px 8px;
}

/* =========================================
   Dashboard Shared — Filter select (home)
   ========================================= */
.cl-filter-select {
  height: 38px;
  padding: 0 .75rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: .875rem;
  background: #fff;
  outline: none;
  cursor: pointer;
  min-width: 140px;
  transition: border-color .15s, box-shadow .15s;
}

.cl-filter-select:focus {
  border-color: var(--primary, #FB923C);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, .1);
}

/* Home search bar: align group select */
.cl-search-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.cl-search-bar .search-input-wrapper {
  flex: 1;
  min-width: 180px;
}

@media (max-width: 640px) {
  .cl-alert-acc-inner {
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }

  .cl-search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .cl-search-bar .search-input-wrapper {
    min-width: unset;
  }

  .cl-filter-select {
    min-width: unset;
  }
}

/* ==========================================================
   UI ENHANCEMENTS v3 — Modern SaaS Refinements
   Targets: .clx-* (admin-suite), .cl-* (dashboard), sidebar
   ========================================================== */

/* ---- KPI Card: Icon container ---- */
.clx-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 14px;
}
.clx-kpi-icon svg,
.clx-kpi-icon i { width: 22px; height: 22px; }
.clx-kpi-icon.blue   { background: #EFF6FF; color: #2563EB; }
.clx-kpi-icon.green  { background: #F0FDF4; color: #16A34A; }
.clx-kpi-icon.red    { background: #FEF2F2; color: #DC2626; }
.clx-kpi-icon.amber  { background: #FFF7ED; color: #D97706; }
.clx-kpi-icon.indigo { background: #EEF2FF; color: #4F46E5; }
.clx-kpi-icon.teal   { background: #F0FDFA; color: #0D9488; }
.clx-kpi-icon.slate  { background: #F8FAFC; color: #475569; }

/* ---- KPI card: hover lift & better number ---- */
.clx-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease !important;
}
.clx-card:hover {
  box-shadow: 0 8px 28px rgba(15,39,71,0.11) !important;
  transform: translateY(-1px);
}
.clx-kpi-value {
  font-feature-settings: "tnum" !important;
  font-variant-numeric: tabular-nums !important;
  line-height: 1.1 !important;
}
/* Status-colored values */
.clx-card.kpi-danger  .clx-kpi-value { color: #DC2626 !important; }
.clx-card.kpi-success .clx-kpi-value { color: #16A34A !important; }
.clx-card.kpi-warning .clx-kpi-value { color: #D97706 !important; }

/* ---- Tabs: Stripe/Linear underline style ---- */
.clx-tabs {
  border-bottom: 2px solid var(--clx-border, #e4eaf3) !important;
  padding-bottom: 0 !important;
  margin-bottom: 28px !important;
  gap: 0 !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
.clx-tabs::-webkit-scrollbar { height: 3px; }
.clx-tabs::-webkit-scrollbar-thumb {
  background: var(--clx-border, #e4eaf3);
  border-radius: 2px;
}
.clx-tab {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--clx-muted, #6b7a90) !important;
  padding: 10px 18px !important;
  margin-bottom: -2px !important;
  border-bottom: 2px solid transparent !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}
.clx-tab:hover {
  color: var(--clx-text, #0f2747) !important;
  border-bottom-color: rgba(251,146,60,0.4) !important;
  background: transparent !important;
}
.clx-tab.is-active {
  color: var(--clx-text, #0f2747) !important;
  border-bottom-color: var(--clx-green, #FB923C) !important;
  background: transparent !important;
}

/* ---- Table: hover, sortable, scrollbar ---- */
.clx-table tbody tr { transition: background 0.12s ease; }
.clx-table tbody tr:hover { background: #f5f8ff !important; }
.clx-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 28px !important;
}
.clx-table th.sortable::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 10'%3E%3Cpath d='M3 0L6 4H0L3 0Z' fill='%236b7a90' opacity='.45'/%3E%3Cpath d='M3 10L0 6H6L3 10Z' fill='%236b7a90' opacity='.45'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
.clx-table th.sortable.asc::after,
.clx-table th.sortable.desc::after { opacity: 1; }
.clx-table th.sortable:hover { background: #f0f5ff !important; }
/* Scrollbar for table wrapper */
.clx-table-wrap::-webkit-scrollbar { height: 6px; }
.clx-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}
.clx-table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.clx-table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- Method pill inside table ---- */
.clx-pill {
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  transition: all 0.12s ease !important;
}
.clx-pill[data-method="paypal"],
.clx-table td .clx-pill:not(:empty) { background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }

/* ---- Section head improvements ---- */
.clx-section-head { gap: 14px !important; }
.clx-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px !important;
}
/* Icon badge for section titles */
.clx-section-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-subtle, #FFEDD5);
  color: var(--primary, #FB923C);
}
.clx-section-icon svg,
.clx-section-icon i { width: 18px; height: 18px; }
.clx-section-copy {
  line-height: 1.7 !important;
  font-size: 13.5px !important;
}

/* ---- Admin cards: hover & icon ---- */
.clx-admin-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease !important;
  gap: 12px !important;
}
.clx-admin-card:hover {
  transform: translateY(-2px) !important;
  border-color: var(--primary, #FB923C) !important;
  box-shadow: 0 10px 28px rgba(251,146,60,0.13) !important;
}
.clx-admin-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-subtle, #FFEDD5);
  color: var(--primary-dark, #F97316);
  font-size: 24px !important;
}
.clx-admin-card-icon svg,
.clx-admin-card-icon i { width: 22px; height: 22px; }
.clx-admin-card h3 { font-size: 17px !important; }

/* ---- Mini grid: card hover ---- */
.clx-mini-card {
  transition: box-shadow 0.15s ease, border-color 0.15s ease !important;
}
.clx-mini-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08) !important;
  border-color: var(--primary, #FB923C) !important;
}

/* ---- List items: hover background ---- */
.clx-list-item {
  border-radius: 8px;
  padding-left: 10px !important;
  padding-right: 10px !important;
  margin-left: -10px;
  margin-right: -10px;
  transition: background 0.12s ease;
}
.clx-list-item:hover { background: #f5f8ff !important; }

/* ---- State & branch cards hover ---- */
.clx-state-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}
.clx-state-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 28px rgba(15,39,71,0.11) !important;
}
.clx-branch-row {
  transition: all 0.15s ease !important;
}
.clx-branch-row:hover {
  background: #f5f8ff !important;
  border-color: var(--primary, #FB923C) !important;
}
.clx-state-kpi {
  transition: border-color 0.15s ease !important;
}
.clx-state-kpi:hover { border-color: var(--primary, #FB923C) !important; }

/* ---- Empty state improvement ---- */
.clx-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 48px 24px !important;
  color: var(--clx-muted, #6b7a90) !important;
  font-style: normal !important;
  font-size: 14px !important;
}

/* ---- Smooth shell transition ---- */
.clx-shell {
  transition: none !important;
}

/* ---- Dashboard card grid ---- */
.clx-dashboard-card {
  transition: all 0.2s ease !important;
}
.clx-dashboard-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 28px rgba(15,39,71,0.10) !important;
}
.clx-chart-wrapper {
  transition: box-shadow 0.2s ease !important;
}
.clx-chart-wrapper:hover {
  box-shadow: 0 8px 24px rgba(15,39,71,0.08) !important;
}

/* ---- Banner border-radius refinements ---- */
.clx-banner    { border-radius: 20px !important; }
.clx-ops-banner { border-radius: 20px !important; }
.clx-context-saas { border-radius: 20px !important; }

/* ---- Token hover ---- */
.clx-token {
  transition: box-shadow 0.15s ease, transform 0.12s ease !important;
}
.clx-token:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  transform: translateY(-1px);
}

/* ---- Branch pick cards ---- */
.clx-branch-pick .clx-card:hover {
  transform: translateY(-2px) !important;
  border-color: var(--primary, #FB923C) !important;
  box-shadow: 0 12px 28px rgba(251,146,60,0.12) !important;
}

/* ---- PDF link ---- */
.clx-pdf {
  transition: all 0.15s ease !important;
}
.clx-pdf:hover {
  background: #dbeafe !important;
  border-color: #60a5fa !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px);
}

/* ---- Quick actions ---- */
.clx-quick .clx-btn { transition: all 0.15s ease !important; }
.clx-quick .clx-btn:hover { transform: translateY(-1px); }

/* ---- Focus states for accessibility ---- */
.clx-btn:focus-visible { outline: 2px solid var(--primary, #FB923C); outline-offset: 2px; }
.clx-filters input:focus,
.clx-filters select:focus {
  outline: none !important;
  border-color: var(--primary, #FB923C) !important;
  box-shadow: 0 0 0 3px rgba(251,146,60,0.15) !important;
}

/* ---- Page switch hover ---- */
.clx-page-switch a {
  transition: all 0.15s ease !important;
  font-size: 13px !important;
}
.clx-page-switch a:hover:not(.is-live) {
  border-color: var(--primary, #FB923C) !important;
  color: var(--primary-dark, #F97316) !important;
}

/* ---- Sidebar: blur backdrop on mobile ---- */
.sidebar-backdrop { backdrop-filter: blur(2px); }

/* ---- Header: glassy effect ---- */
.plugin-header {
  backdrop-filter: blur(8px) !important;
  background: rgba(255,255,255,0.97) !important;
}

/* ---- Activity cards improvement ---- */
.cl-act-card:hover {
  box-shadow: 0 8px 24px rgba(251,146,60,0.18) !important;
}

/* ---- Responsive enhancements for clx-* ---- */
@media (max-width: 1180px) {
  .clx-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .clx-three { grid-template-columns: 1fr 1fr !important; }
  .clx-two { grid-template-columns: 1fr !important; }
  .clx-admin-card-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 767px) {
  .clx-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .clx-three { grid-template-columns: 1fr !important; }
  .clx-admin-card-grid { grid-template-columns: 1fr !important; }
  .clx-mini-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .clx-section-head {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .clx-filter-actions {
    width: 100% !important;
    flex-direction: row !important;
  }
  .clx-filter-actions .clx-btn {
    flex: 1;
    justify-content: center !important;
  }
  .clx-title { font-size: 28px !important; }
  .clx-kpi-value { font-size: 26px !important; }
  .clx-table th, .clx-table td { padding: 10px 12px !important; }
  .clx-tabs { flex-wrap: nowrap !important; }
}

@media (max-width: 480px) {
  .clx-grid { grid-template-columns: 1fr !important; }
  .clx-mini-grid { grid-template-columns: 1fr 1fr !important; }
  .clx-shell { padding: 14px !important; border-radius: 16px !important; }
  .clx-kpi-value { font-size: 22px !important; }
  .clx-title { font-size: 24px !important; }
  .clx-filters { grid-template-columns: 1fr !important; }
  .clx-head { flex-direction: column !important; gap: 12px !important; }
  .clx-badges { justify-content: flex-start !important; }
}

/* ---- WP Admin backend improvements ---- */
.camplink-admin-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}
.camplink-admin-kpi {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 22px;
  transition: box-shadow 0.2s ease;
}
.camplink-admin-kpi:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.camplink-admin-kpi .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 8px;
}
.camplink-admin-kpi .value {
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.camplink-admin-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}
.camplink-admin-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.camplink-admin-table-wrap thead th {
  background: #f9fafb;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.camplink-admin-table-wrap tbody td {
  padding: 12px 14px;
  font-size: 14px;
  color: #111827;
  border-bottom: 1px solid #f3f4f6;
}
.camplink-admin-table-wrap tbody tr:last-child td { border-bottom: none; }
.camplink-admin-table-wrap tbody tr:hover { background: #f9fafb; }
.camplink-admin-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 16px 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.camplink-admin-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.camplink-admin-form input[type="date"],
.camplink-admin-form input[type="number"],
.camplink-admin-form select {
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  color: #111827;
  background: #fafafa;
  transition: border-color 0.15s;
}
.camplink-admin-form input:focus,
.camplink-admin-form select:focus {
  border-color: #FB923C;
  box-shadow: 0 0 0 3px rgba(251,146,60,0.15);
  outline: none;
}
.camplink-admin-form .button {
  height: 38px;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
.camplink-scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin: 8px 0 16px;
}
}

/* =========================================
   Mobile App View — appview-mobile
   ========================================= */

/* 1. Ocultar elementos que huelen a web */
body.appview-mobile .site-header,
body.appview-mobile header:not(.mobile-app-header),
body.appview-mobile .site-footer,
body.appview-mobile footer:not(.mobile-control-center),
body.appview-mobile .breadcrumbs,
body.appview-mobile .breadcrumb,
body.appview-mobile .page-title,
body.appview-mobile .entry-header,
body.appview-mobile #wpadminbar {
  display: none !important;
}

/* 2. Fondo tipo app */
body.appview-mobile {
  background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
  padding-top: 0;
  padding-bottom: 0;
}

body.appview-mobile .site,
body.appview-mobile .site-main,
body.appview-mobile .elementor-location-single,
body.appview-mobile .elementor-location-header,
body.appview-mobile .elementor {
  background: transparent !important;
}

body.appview-mobile .app-screen,
body.appview-mobile .elementor-section-wrap,
body.appview-mobile main {
  padding-left: 14px;
  padding-right: 14px;
}

/* 3. Header tipo app nativo */
body.appview-mobile .mobile-app-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

body.appview-mobile .mobile-app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

body.appview-mobile .mobile-app-header__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1;
}

body.appview-mobile .mobile-app-header__title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-top: 2px;
}

body.appview-mobile .mobile-app-header__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a;
}

/* 4. Dock de navegación premium */
body.appview-mobile .mobile-control-center {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 99999;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}

body.appview-mobile .mc-item {
  min-height: 58px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #dbeafe;
  background: transparent;
  transition: transform 0.18s ease, background 0.18s ease;
}

body.appview-mobile .mc-item:active {
  transform: scale(0.93);
}

body.appview-mobile .mc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

body.appview-mobile .mc-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

body.appview-mobile .mc-main {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

body.appview-mobile .mc-main .mc-icon svg,
body.appview-mobile .mc-main .mc-label {
  color: #fff;
}

/* 5. Tarjetas estilo app */
body.appview-mobile .elementor-widget-container,
body.appview-mobile .app-card,
body.appview-mobile .dashboard-card,
body.appview-mobile .card {
  border-radius: 22px;
}

body.appview-mobile .dashboard-card,
body.appview-mobile .card {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

/* 6. Botones e inputs táctiles */
body.appview-mobile button,
body.appview-mobile .button,
body.appview-mobile .elementor-button,
body.appview-mobile input[type="submit"] {
  min-height: 48px;
  border-radius: 16px;
  font-weight: 700;
  box-shadow: none;
}

body.appview-mobile input,
body.appview-mobile select,
body.appview-mobile textarea {
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
}

/* 7. Padding inferior para que el dock no tape el contenido */
body.appview-mobile main,
body.appview-mobile .site-main,
body.appview-mobile .elementor,
body.appview-mobile .elementor-section-wrap,
body.appview-mobile .dialog-widget-content {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 120px) !important;
}

/* ==========================================================
   PREMIUM iOS v2 — Full System Upgrade
   Font: Plus Jakarta Sans · Tokens: --alm-*
   ========================================================== */

/* ── Global font override ── */
.plugin-wrapper,
.plugin-wrapper *,
.cl-app-shell,
.cl-app-shell * {
  font-family: var(--alm-font) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Main content background — stone-50 ── */
.plugin-main-content {
  background: var(--alm-surface-2) !important;
}

/* ── Sidebar refinements ── */
.plugin-sidebar {
  background: #FFFFFF !important;
  border-right: 1px solid #E5E7EB !important;
  box-shadow: 2px 0 12px rgba(0,0,0,0.05) !important;
}

.alm-brand-icon {
  background: #FB923C !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(251,146,60,0.30) !important;
}

.sidebar-nav-item {
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.sidebar-nav-item.active {
  background: rgba(251,146,60,0.12) !important;
  color: #F97316 !important;
  font-weight: 600 !important;
}

.sidebar-nav-item.active::before {
  background: #FB923C !important;
  width: 3px !important;
  border-radius: 0 3px 3px 0 !important;
}

/* ── Header refinements ── */
.plugin-header {
  background: rgba(255,255,255,0.97) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--alm-border) !important;
  box-shadow: 0 1px 0 var(--alm-border), 0 2px 8px rgba(0,0,0,0.03) !important;
}

/* ── Amber accent cards — left border ── */
.cl-card,
.clx-card,
.clx-admin-card,
.clx-state-card,
.stat-card,
.gallery-card,
.camplink-admin-kpi {
  position: relative !important;
  overflow: hidden !important;
}

/* Left amber accent stripe on ALL plugin cards */
.cl-card::after,
.clx-card::after,
.stat-card::after,
.camplink-admin-kpi::after {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 4px !important;
  background: var(--alm-primary) !important;
  border-radius: 0 2px 2px 0 !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

.cl-card:hover::after,
.clx-card:hover::after,
.stat-card:hover::after,
.camplink-admin-kpi:hover::after {
  opacity: 1 !important;
}

/* ── Cards: premium shadows & radii ── */
.cl-card {
  border-radius: var(--alm-radius-sm) !important;
  box-shadow: var(--alm-shadow-sm) !important;
  border: 1px solid var(--alm-border) !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}

.cl-card:hover {
  box-shadow: var(--alm-shadow-md) !important;
  transform: translateY(-1px) !important;
}

.stat-card {
  border-radius: var(--alm-radius-sm) !important;
  box-shadow: var(--alm-shadow-sm) !important;
  border: 1px solid var(--alm-border) !important;
  transition: box-shadow 0.2s ease, transform 0.15s ease !important;
}

.stat-card:hover {
  box-shadow: var(--alm-shadow-md) !important;
  transform: translateY(-2px) !important;
}

/* ── Gallery cards ── */
.gallery-card {
  border-radius: 16px !important;
  border: 1px solid var(--alm-border) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease !important;
}

.gallery-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.09) !important;
  transform: translateY(-3px) !important;
  border-color: rgba(251,146,60,0.4) !important;
}

/* ── Buttons ── */
.btn-primary,
.cl-btn-primary {
  background: var(--alm-primary) !important;
  color: #1C1917 !important;
  border-radius: 12px !important;
  border: none !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(251,146,60,0.35) !important;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease !important;
}

.btn-primary:hover,
.cl-btn-primary:hover {
  background: var(--alm-primary-dark) !important;
  box-shadow: 0 4px 14px rgba(251,146,60,0.4) !important;
  transform: translateY(-1px) !important;
}

.btn-primary:active,
.cl-btn-primary:active {
  transform: translateY(0) !important;
}

.btn-secondary,
.cl-btn-secondary {
  border-radius: 12px !important;
  border: 1.5px solid var(--alm-border) !important;
  background: #fff !important;
  color: var(--alm-text-2) !important;
  font-weight: 500 !important;
  transition: border-color 0.15s ease, background 0.15s ease !important;
}

.btn-secondary:hover,
.cl-btn-secondary:hover {
  border-color: var(--alm-border-2) !important;
  background: var(--alm-surface-2) !important;
}

.btn-danger,
.cl-btn-danger {
  border-radius: 12px !important;
  transition: background 0.15s ease, transform 0.1s ease !important;
}

/* ── Inputs ── */
.plugin-wrapper input[type="text"],
.plugin-wrapper input[type="email"],
.plugin-wrapper input[type="number"],
.plugin-wrapper input[type="password"],
.plugin-wrapper input[type="search"],
.plugin-wrapper input[type="url"],
.plugin-wrapper input[type="date"],
.plugin-wrapper select,
.plugin-wrapper textarea,
.cl-input,
.cl-select,
.cl-textarea,
.search-input,
.cl-search-input,
.cl-filter-select {
  border: 1.5px solid var(--alm-border) !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: var(--alm-text) !important;
  font-family: var(--alm-font) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.plugin-wrapper input:focus,
.plugin-wrapper select:focus,
.plugin-wrapper textarea:focus,
.cl-input:focus,
.cl-select:focus,
.cl-textarea:focus,
.search-input:focus,
.cl-search-input:focus,
.cl-filter-select:focus {
  border-color: var(--alm-primary) !important;
  box-shadow: 0 0 0 3px rgba(251,146,60,0.14) !important;
  outline: none !important;
}

/* ── Tables ── */
.modern-table {
  border-radius: 14px !important;
  border: 1px solid var(--alm-border) !important;
  overflow: hidden !important;
}

.modern-table thead th {
  background: var(--alm-surface-2) !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: var(--alm-text-3) !important;
  font-weight: 700 !important;
  border-bottom: 1px solid var(--alm-border) !important;
  padding: 12px 16px !important;
}

.modern-table tbody td {
  padding: 13px 16px !important;
  font-size: 13.5px !important;
  color: var(--alm-text) !important;
  border-bottom: 1px solid #F5F5F4 !important;
}

.modern-table tbody tr:hover td {
  background: #FFF7ED !important;
}

.clx-table thead th {
  background: var(--alm-surface-2) !important;
  color: var(--alm-text-3) !important;
}

.clx-table tbody tr:hover {
  background: #FFF7ED !important;
}

/* ── Badges ── */
.badge,
.cl-badge {
  font-family: var(--alm-font) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  letter-spacing: 0.02em !important;
  border-radius: 6px !important;
  padding: 3px 8px !important;
}

/* ── Alerts ── */
.cl-alert {
  border-radius: 12px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  border-width: 1px !important;
}

.cl-alert-info    { background: #EFF6FF !important; color: #1D4ED8 !important; border-color: #BFDBFE !important; }
.cl-alert-success { background: #F0FDF4 !important; color: #16A34A !important; border-color: #BBF7D0 !important; }
.cl-alert-danger  { background: #FEF2F2 !important; color: #DC2626 !important; border-color: #FECACA !important; }
.cl-alert-warning { background: #FFF7ED !important; color: #D97706 !important; border-color: #FED7AA !important; }

/* ── Page headers ── */
.page-header-title {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: var(--alm-text) !important;
  letter-spacing: -0.03em !important;
}

.page-header-subtitle {
  font-size: 13.5px !important;
  color: var(--alm-text-3) !important;
  font-weight: 400 !important;
}

/* ── Tabs ── */
.cl-tab,
.clx-tab {
  font-family: var(--alm-font) !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}

.cl-tab.active,
.clx-tab.is-active {
  background: var(--alm-primary-mid) !important;
  color: #9A3412 !important;
  border-color: var(--alm-primary-mid) !important;
}

/* ── Modals ── */
.cl-modal-dialog {
  border-radius: 20px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.16) !important;
  border: 1px solid var(--alm-border) !important;
}

.cl-modal-header {
  border-bottom: 1px solid var(--alm-border) !important;
}

.cl-modal-title {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: var(--alm-text) !important;
}

/* ── Stat card numbers ── */
.stat-card-number,
.clx-kpi-value {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: var(--alm-text) !important;
  letter-spacing: -0.03em !important;
  font-variant-numeric: tabular-nums !important;
}

.stat-card-label,
.clx-kpi-label {
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  color: var(--alm-text-3) !important;
  font-weight: 700 !important;
}

/* ── Empty states ── */
.cl-empty-state,
.clx-empty {
  color: var(--alm-text-3) !important;
  font-size: 13.5px !important;
  font-style: normal !important;
}

/* ── Action quick buttons in header ── */
.pheader-qa {
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  transition: all 0.12s ease !important;
}

.pheader-qa.active {
  background: var(--alm-primary) !important;
  color: #1C1917 !important;
  box-shadow: 0 1px 4px rgba(251,146,60,0.4) !important;
}

/* ── User avatar ring ── */
.pheader-avatar {
  border: 2px solid rgba(251,146,60,0.35) !important;
  box-shadow: 0 0 0 2px rgba(251,146,60,0.1) !important;
}

/* ── Scan iframe/shortcode areas ── */
.clqs-wrap {
  border-radius: 18px !important;
  box-shadow: var(--alm-shadow-md) !important;
  overflow: hidden !important;
  font-family: var(--alm-font) !important;
}

/* ── Scanner corner borders ── */
.clqs-corner {
  border-color: var(--alm-primary) !important;
}

/* ── Scan line animation ── */
.clqs-scan-line {
  background: linear-gradient(90deg, transparent, var(--alm-primary), transparent) !important;
}

/* ── Scroll bar system-wide (thin, amber thumb) ── */
.plugin-main-content::-webkit-scrollbar,
.alm-nav::-webkit-scrollbar {
  width: 4px;
}
.plugin-main-content::-webkit-scrollbar-track,
.alm-nav::-webkit-scrollbar-track {
  background: transparent;
}
.plugin-main-content::-webkit-scrollbar-thumb,
.alm-nav::-webkit-scrollbar-thumb {
  background: rgba(251,146,60,0.3);
  border-radius: 4px;
}
.plugin-main-content::-webkit-scrollbar-thumb:hover,
.alm-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(251,146,60,0.55);
}

/* ── Smooth fade-in for page content ── */
.plugin-main-content > * {
  animation: almFadeIn 0.28s ease both;
}

@keyframes almFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mode chips (header context) ── */
.pheader-mode-chip {
  border-radius: 999px !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
}

/* ── Focus ring global (accessibility) ── */
.plugin-wrapper *:focus-visible {
  outline: 2px solid var(--alm-primary);
  outline-offset: 2px;
}

/* ── Admin KPI cards ── */
.camplink-admin-kpi {
  border-radius: 14px !important;
  border: 1px solid var(--alm-border) !important;
  padding: 20px 22px !important;
  box-shadow: var(--alm-shadow-sm) !important;
  transition: box-shadow 0.2s ease, transform 0.15s ease !important;
}

.camplink-admin-kpi:hover {
  box-shadow: var(--alm-shadow-md) !important;
  transform: translateY(-2px) !important;
}

.camplink-admin-kpi .label,
.camplink-admin-kpi .cl-label {
  font-size: 10.5px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--alm-text-3) !important;
  font-weight: 700 !important;
}

.camplink-admin-kpi .value,
.camplink-admin-kpi .cl-value {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: var(--alm-text) !important;
  letter-spacing: -0.03em !important;
}

/* ── Admin table wrap ── */
.camplink-admin-table-wrap {
  border-radius: 14px !important;
  border: 1px solid var(--alm-border) !important;
  box-shadow: var(--alm-shadow-sm) !important;
}

.camplink-admin-table-wrap thead th {
  background: var(--alm-surface-2) !important;
  font-size: 10.5px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--alm-text-3) !important;
  font-weight: 700 !important;
}

.camplink-admin-table-wrap tbody tr:hover {
  background: #FFF7ED !important;
}

/* ── Form filter bar ── */
.camplink-admin-form {
  border-radius: 14px !important;
  border: 1px solid var(--alm-border) !important;
  background: #fff !important;
  box-shadow: var(--alm-shadow-sm) !important;
}

/* ── List items (recent scans, etc.) ── */
.cl-list-item {
  border-radius: 10px !important;
  border: 1px solid var(--alm-border) !important;
  background: var(--alm-surface-2) !important;
  transition: background 0.12s ease, border-color 0.12s ease !important;
}

.cl-list-item:hover {
  background: var(--alm-primary-light) !important;
  border-color: rgba(251,146,60,0.3) !important;
}

/* ── Section titles (premium weight) ── */
.clx-section-title,
.cl-card-title,
.page-header-title {
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
}

/* ── Progress bars ── */
.cl-progress-bar {
  height: 6px !important;
  border-radius: 999px !important;
  background: var(--alm-primary) !important;
}

/* ── Session banner ── */
.cl-session-banner {
  border-radius: 14px !important;
  border-color: rgba(251,146,60,0.4) !important;
  background: linear-gradient(135deg, #fff 0%, #FFF7ED 100%) !important;
}

/* ── Mobile: bottom padding for scan screens ── */
@media (max-width: 768px) {
  .clqs-wrap {
    border-radius: 16px !important;
    margin: 0 4px !important;
  }

  .stat-card-number,
  .clx-kpi-value {
    font-size: 24px !important;
  }
}

/* ── Micro-interaction: scale on click ── */
.btn-primary:active,
.cl-btn-primary:active,
.clqs-btn:active {
  transform: scale(0.97) !important;
  transition: transform 0.08s ease !important;
}
