/* --- Global button color normalization (UI only) --- */
.crm2026h-btn.crm2026h-btn-green{background:#22c55e;color:#fff}
.crm2026h-btn.crm2026h-btn-green:hover{filter:brightness(0.95)}
.crm2026h-btn.crm2026h-btn-red{background:#ef4444;color:#fff;border-color:transparent}
.crm2026h-btn.crm2026h-btn-red:hover{filter:brightness(0.95)}
/* Prefix X only where explicitly requested (close/cancel), not for every red button (e.g., delete) */
.crm2026h-btn.crm2026h-btn-red.crm2026h-x::before{content:"✕ ";font-weight:800}

.crm2026h-wrap .crm2026h-btn,
.crm2026h-wrap button,
.crm2026h-wrap a,
.crm2026h-wrap input[type=submit]{opacity:1}

.crm2026h-wrap input[type=file]::file-selector-button{background:#e2e8f0;border:1px solid rgba(15,23,42,.12);color:#0f172a;border-radius:12px;padding:10px 12px;cursor:pointer}

.crm2026h-wrap .ffset-btn.primary{background:#22c55e !important;color:#fff !important;border-color:transparent !important;opacity:1 !important}
.crm2026h-wrap .ffset-btn{background:#ef4444 !important;color:#fff !important;border-color:transparent !important;opacity:1 !important}
.crm2026h-wrap .ffset-btn.crm2026h-x::before{content:"✕ ";font-weight:800}

.crm2026h-wrap .ffap-btn2.primary{background:#22c55e !important;color:#fff !important;border-color:transparent !important;opacity:1 !important}
.crm2026h-wrap .ffap-btn2.ghost{background:#ef4444 !important;color:#fff !important;border-color:transparent !important;opacity:1 !important}
.crm2026h-wrap .ffap-btn2.ghost.crm2026h-x::before,
.crm2026h-wrap .ffap-btn2.ghost[data-close="1"]::before{content:"✕ ";font-weight:800}
/*
 * CRM2026H Mobile Responsive Patch
 * Base plugin: v0.9.1.1.24
 * Goal: keep desktop identical, only improve phone/tablet layout.
 */

@media (max-width: 900px){
  /* Stop the 100vw breakout on phones (prevents horizontal shift) */
  .crm2026h-fullwidth{
    width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
    overflow-x:hidden !important;
  }

  /* Layout: stack sidebar on top */
  .crm2026h-portal{
    flex-direction:column;
    gap:12px;
    padding:12px;
    border-radius:14px;
    min-height:auto;
  }
  .crm2026h-sidebar{
    width:100% !important;
    padding:12px;
    border-radius:16px;
  }

  /* Make the nav wrap nicely */
  .crm2026h-nav{
    flex-direction:row;
    flex-wrap:wrap;
    gap:8px;
  }
  .crm2026h-nav-item{
    flex:1 1 calc(50% - 8px);
    justify-content:flex-start;
    padding:10px 12px;
  }
  .crm2026h-nav-label{font-size:13px}

  /* Topbar: stack */
  .crm2026h-topbar{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    margin:0 0 10px;
  }
  .crm2026h-search input{
    width:100% !important;
    max-width:100% !important;
  }
  .crm2026h-user{
    justify-content:space-between;
  }

  /* Cards: ensure no overflow */
  .crm2026h-card{padding:14px;border-radius:16px}
  .crm2026h-card-top{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }

  /* Buttons: never cut text on mobile */
  .crm2026h-btn,
  .crm2026h-btn-sm,
  button,
  input[type=button],
  input[type=submit],
  a.crm2026h-btn{
    white-space:normal !important;
    word-break:break-word;
    height:auto !important;
    line-height:1.15;
  }

  /* Dashboard grid: absolute widgets become stacked blocks */
  .crm2026h-grid{
    min-height:0 !important;
  }
  .crm2026h-widget{
    position:relative !important;
    left:auto !important;
    top:auto !important;
    right:auto !important;
    bottom:auto !important;
    width:100% !important;
    height:auto !important;
    transform:none !important;
    margin:0 0 12px 0 !important;
  }
  .crm2026h-widget .crm2026h-widget-body{
    max-height:none !important;
  }

  /* Dashboard action buttons: wrap */
  .crm2026h-dash-actions{justify-content:flex-start !important}
  .crm2026h-dashboard .crm2026h-dash-search{
    min-width:0;
    width:100%;
    max-width:100%;
  }

  /* Tables: allow horizontal scroll instead of breaking layout */
  .crm2026h-card table.widefat,
  .crm2026h-card .widefat{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  /* Kanban: horizontal swipe for columns */
  .crm2026h-kanban{
    display:flex !important;
    gap:12px;
    overflow-x:auto;
    overflow-y:hidden;
    padding-bottom:10px;
    -webkit-overflow-scrolling:touch;
  }
  .crm2026h-kanban-col{
    min-width:260px;
    flex:0 0 260px;
  }

  /* Forms that use grid on desktop should stack on phone (Pipeline / PV settings etc.) */
  form[style*="display:grid"][style*="grid-template-columns"]{
    grid-template-columns: 1fr !important;
  }
  .crm2026h-card-top{flex-direction:column;align-items:stretch !important;gap:10px}
  .fftop{flex-direction:column;align-items:stretch}
  .ffrow{width:100%}
  .ffrow .btn{flex:1 1 100%}

  /* Small typography tweaks */
  .crm2026h-brand-title{font-size:15px}
  .crm2026h-card h2,.crm2026h-card h3{font-size:16px}
}
