/* =====================================================================
   Enjaz module layer (v3)
   Modules (WhatsApp, PBX, network, campaign tracking, HR, requests,
   supervision, mobile screens …) keep THEIR OWN colours. This layer only
   aligns shape and depth with the restyle and adds the site's motifs.
   Scope: page content in the app shell, or a standalone page body.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Hero banners: own colours, the site's shape + "second square"
   --------------------------------------------------------------------- */
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(.hero, .wa-bg, .page-hero, .dashboard-header, .hero-box, .top-hero,
  [class$="-hero"], [class*="-hero "], .cc-header, .cc-head){
  border-radius:var(--ez-r-lg) !important;
  animation:none !important;
}
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(.hero, .wa-bg, .page-hero, [class$="-hero"], [class*="-hero "], .cc-header, .hero-box, .top-hero)
  :is(h1, h2, h3, .title, .hero-title){ font-weight:700 !important; letter-spacing:0 !important; }

/* ---------------------------------------------------------------------
   2. Cards / panels: the restyled radius and depth
   --------------------------------------------------------------------- */
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(
  .panel, .main-card, .wa-card, .dashboard-card, .router-card, .sec-card, .mc-card, .zk-stat,
  .stat, .network-stat, .mc-stat, .stat-card, .kpi, .kpi-card, .info-card, .data-card, .chart-card,
  .filter-card, .finance-card, .insight-card, .stat-box,
  [class$="-card"]:not(.sales-card):not(.card), [class*="-card "]:not(.sales-card):not(.card), [class$="-panel"], [class*="-panel "]){
  border-radius:var(--ez-r-md) !important;
  box-shadow:var(--ez-shadow-sm) !important;
  animation:none !important;
}
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(
  .panel, .main-card, .wa-card, .dashboard-card, .router-card, .sec-card, .mc-card, .stat-card, .kpi-card,
  [class$="-card"]:not(.sales-card):not(.card), [class*="-card "]:not(.sales-card):not(.card)):hover{
  transform:translateY(-1px) !important;
  box-shadow:var(--ez-shadow-md) !important;
}
/* white panels get the theme's hairline when the module gave none */
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(.panel, .main-card, .wa-card, .dashboard-card, .router-card, .sec-card, .mc-card){
  border-style:solid; border-width:1px; border-color:var(--ez-border);
}

/* Gradient tiles (coloured stat tiles) get the site's hatching and chevron overlay */
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(.zk-stat, .stat-box, .kpi-card, .finance-card.primary){
  position:relative; isolation:isolate; overflow:hidden;
}
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(.zk-stat, .stat-box)::after{
  content:""; position:absolute; z-index:-1; inset-inline-start:-20px; bottom:-16px; pointer-events:none;
  width:110px; aspect-ratio:520/270; background:#fff; opacity:.1;
  -webkit-mask:var(--ez-chevrons) center/contain no-repeat; mask:var(--ez-chevrons) center/contain no-repeat;
}

/* ---------------------------------------------------------------------
   3. Icon tiles, avatars
   --------------------------------------------------------------------- */
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(.wa-icon, .stat-icon, .kpi-icon, .card-icon, .counter-icon, .router-avatar, .icon-box, .icon-wrap, [class*="hero-icon"]){
  border-radius:var(--ez-r-sm) !important;
  box-shadow:none !important;
  animation:none !important;
}

/* ---------------------------------------------------------------------
   4. Pills, chips, module badges: the soft-tag shape, own colours
   --------------------------------------------------------------------- */
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(.pill, .chip, .tag, .badge-soft, .status-badge,
  [class$="-pill"], [class*="-pill "], [class*="-pill-"], [class$="-chip"], [class*="-chip "],
  [class$="-badge"]:not(.notification-badge):not(.wa-badge), [class*="-badge "], [class*="request-tag"]):not(.btn){
  border-radius:6px !important;
  box-shadow:none !important;
  font-weight:700 !important;
  line-height:1.5 !important;
}

/* ---------------------------------------------------------------------
   5. Module buttons (not using .btn): the restyled control shape
   --------------------------------------------------------------------- */
:is(body.enjaz-ui .main-content, body.enjaz-standalone) :is(button, a, input[type="submit"]):is([class*="-btn"], [class^="btn-"], [class*=" btn-"]):not(.btn):not([class*="btn-close"]):not(.close):not(.fp-fab):not(.support-float-btn){
  border-radius:var(--ez-r-xs) !important;
  box-shadow:none !important;
  transform:none !important;
  font-weight:700 !important;
}

/* ---------------------------------------------------------------------
   6. Standalone & mobile pages
   --------------------------------------------------------------------- */
body.enjaz-standalone{ font-family:var(--ez-font) !important; }
body.enjaz-standalone :is(h1,h2,h3,h4,h5,h6,p,span,div,a,button,input,select,textarea,label,td,th,small,b,strong):not(i):not([class*="fa"]):not([class*="icon"]){
  font-family:var(--ez-font) !important;
}
body.enjaz-standalone :is(.btn, button){ border-radius:var(--ez-r-xs); }
body.enjaz-standalone .card{ border-radius:var(--ez-r-md); }

/* ---------------------------------------------------------------------
   7. Home dashboard extras
   --------------------------------------------------------------------- */
body.enjaz-ui .main-content .main-card > h3{ font-weight:700 !important; }
body.enjaz-ui .main-content .main-card > h3::before{
  content:""; display:inline-block; width:18px; height:13px; margin-inline-end:.5rem; vertical-align:-1px;
  background:var(--ez-navy); opacity:.85;
  -webkit-mask:var(--ez-chevrons-tight) center/contain no-repeat; mask:var(--ez-chevrons-tight) center/contain no-repeat;
}
