/* --- 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}
}


/* === GOFY UI2026 responsive hardening (plugin only) === */
@media (max-width: 767px){
  .crm2026h-portal.ff-embed .crm2026h-main{padding:0 10px 74px !important}

  .crm2026h-card,
  .crm2026h-widget,
  .crm2026h-card-body,
  .crm2026h-card-top,
  .crm2026h-topbar,
  .crm2026h-user,
  .crm2026h-actions,
  .crm2026h-dash-actions,
  .crm2026h-nav,
  .fftop,
  .ffrow,
  .ffmoreitem{width:100%;max-width:100%}

  .crm2026h-card,
  .crm2026h-widget,
  .crm2026h-widget .crm2026h-widget-body{min-height:0 !important;height:auto !important}

  .crm2026h-card-top > *,
  .crm2026h-topbar > *,
  .crm2026h-user > *,
  .crm2026h-actions > *,
  .crm2026h-dash-actions > *,
  .fftop > *,
  .ffrow > *{min-width:0;max-width:100%}

  .crm2026h-btn,
  .crm2026h-btn-sm,
  .btn,
  .ffrow .btn,
  .crm2026h-actions a,
  .crm2026h-actions button,
  .crm2026h-actions input[type=submit],
  .crm2026h-card-top .crm2026h-dash-actions .crm2026h-btn{
    white-space:normal !important;
    overflow-wrap:anywhere;
    justify-content:center;
  }

  .crm2026h-actions,
  .crm2026h-dash-actions,
  .ffrow{display:flex;flex-wrap:wrap;gap:8px}

  .crm2026h-actions > *,
  .crm2026h-dash-actions > *,
  .ffrow > *{flex:1 1 100%}

  .crm2026h-card .widefat,
  .crm2026h-card table,
  .crm2026h-card .wp-list-table,
  .crm2026h-card .crm2026h-table{
    display:block;
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .crm2026h-card .widefat th,
  .crm2026h-card .widefat td,
  .crm2026h-card table th,
  .crm2026h-card table td{white-space:normal;overflow-wrap:anywhere}

  .crm2026h-nav-item{flex:1 1 calc(50% - 8px)}
  .crm2026h-pill,
  .crm2026h-badge,
  .ffmorelock{white-space:normal}

  .ffmore{padding:12px 12px 104px 12px}
  .ffmoreitem{align-items:flex-start;padding:12px;gap:10px}
  .ffmoreitem .l{align-items:flex-start;flex:1 1 auto}
  .ffmoreitem .t{white-space:normal;line-height:1.25}
  .ffmoreitem .r,
  .ffmorelock{margin-left:auto}

  .crm2026h-form-grid,
  .crm2026h-two-col,
  .crm2026h-split,
  .crm2026h-cols-2,
  .crm2026h-grid-2,
  .crm2026h-grid-3,
  .crm2026h-grid-4,
  .ffgrid2,
  .ffgrid3,
  .ffgrid4,
  .crm2026h-card form[style*="grid-template-columns:1fr 1fr"],
  .crm2026h-card form[style*="grid-template-columns: 1fr 1fr"],
  .crm2026h-card [style*="grid-template-columns:1fr 1fr"],
  .crm2026h-card [style*="grid-template-columns: 1fr 1fr"],
  .crm2026h-card [style*="grid-template-columns:repeat(2"],
  .crm2026h-card [style*="grid-template-columns: repeat(2"]{grid-template-columns:1fr !important}
}

@media (max-width: 390px){
  .crm2026h-portal{padding:10px;gap:10px}
  .crm2026h-sidebar,
  .crm2026h-card{padding:12px;border-radius:14px}
  .crm2026h-nav{gap:6px}
  .crm2026h-nav-item{flex-basis:100%;padding:10px}
  .crm2026h-brand-title{font-size:14px}
  .crm2026h-card h2,
  .crm2026h-card h3,
  .fftop h2,
  .ffmore h2{font-size:15px;line-height:1.22}
  .crm2026h-muted,
  .crm2026h-nav-label,
  .crm2026h-user,
  .ffmore .sub{font-size:12px}
  .crm2026h-btn,
  .crm2026h-btn-sm,
  .btn{padding:10px 12px;border-radius:12px;font-size:12px}
  .crm2026h-pill,
  .crm2026h-badge,
  .ffmorelock{font-size:11px;padding:6px 8px}
}

@media (max-width: 360px){
  .crm2026h-portal.ff-embed .crm2026h-main{padding:0 8px 72px !important}
  .crm2026h-portal,
  .crm2026h-sidebar,
  .crm2026h-card{padding:10px}
  .crm2026h-card h2,
  .crm2026h-card h3,
  .fftop h2,
  .ffmore h2{font-size:14px}
  .crm2026h-muted,
  .crm2026h-nav-label,
  .crm2026h-user,
  .ffmore .sub{font-size:11.5px}
  .crm2026h-btn,
  .crm2026h-btn-sm,
  .btn{font-size:11.5px;line-height:1.15}
  .ffmoreitem .ic{width:30px;height:30px;border-radius:10px}
}


/* GOFY Jobs UI cleanup */
.ffj-card, .ffinterview, .ffreprog-box { overflow:hidden; }
.ffj-card *, .ffinterview *, .ffreprog-box * { word-break:break-word; overflow-wrap:anywhere; }
.ffj-field, .ffj-note, .ffj-btn, .ffbadge { max-width:100%; }
.ffj-cta-row .ffj-btn { flex:1 1 220px; justify-content:center; }
