/* ============================================================
   KOREVRA CRM+ — v5: production-grade
   Backend · multi-user · email · telephony · RBAC · workflow · SLA · PWA · mobile
============================================================ */

/* ============================================================
   PRESENCE
============================================================ */
.presence-bar{
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  background: rgba(91,193,120,.08);
  border: 1px solid rgba(91,193,120,.3);
  border-radius: 16px;
  margin-left: 8px;
}
.presence-av{
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-fill), var(--teal-deep));
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono);
  font-size: 9px;
  font-weight: 700;
  border: 1.5px solid var(--navy-deep);
  margin-left: -6px;
  position: relative;
}
.presence-av:first-child{ margin-left: 0; }
.presence-av .dot{
  position: absolute;
  bottom: -1px; right: -1px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--good);
  border: 1px solid var(--navy-deep);
}
.presence-count{
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--good);
  margin-left: 6px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Cursor for "someone else is here" */
.live-cursor{
  position: absolute;
  width: 16px; height: 16px;
  pointer-events: none;
  z-index: 1000;
  transition: top .3s ease-out, left .3s ease-out;
}
.live-cursor::before{
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  background: var(--teal-light);
  clip-path: polygon(0 0, 100% 50%, 50% 60%, 60% 100%);
}
.live-cursor-label{
  position: absolute;
  left: 14px; top: 12px;
  background: var(--teal-light);
  color: var(--navy-deep);
  font-family: var(--ff-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .04em;
}

/* ============================================================
   ROLE / READ-ONLY BANNER
============================================================ */
.role-banner{
  background: linear-gradient(135deg, rgba(229,161,74,.18), rgba(229,161,74,.06));
  border: 1px solid rgba(229,161,74,.5);
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--warn);
  letter-spacing: .04em;
}
.role-banner.read-only{
  background: linear-gradient(135deg, rgba(111,166,224,.15), rgba(111,166,224,.05));
  border-color: rgba(111,166,224,.5);
  color: var(--info);
}
.role-banner b{
  color: var(--cream);
}
.role-banner .ic{
  font-size: 14px;
  font-weight: 700;
}
.role-banner .role-banner-action{
  margin-left: auto;
  font-family: var(--ff-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
}
.role-banner .role-banner-action:hover{ opacity: .8; }

.is-disabled-by-role{
  /* `opacity:.35` dimmed the fill and the ink together, so the gold primary
     button measured 1.08 and the ghost 2.76. Mute with explicit colours in the
     same hues instead — 4.98 slate label, 4.75 brass fill — and let the 🔒
     badge, not-allowed cursor and title carry the "restricted" state. */
  opacity: 1;
  color: #96A4B7;
  border-color: rgba(244,237,223,.14);
  pointer-events: none;
  cursor: not-allowed !important;
  position: relative;
}
.btn-primary.is-disabled-by-role{
  background: #9A8449; border-color: #9A8449; /* desaturated gold; --navy-deep ink 4.75 */
  color: var(--navy-deep);
}
.is-disabled-by-role::after{
  content: "🔒";
  position: absolute;
  top: -4px; right: -4px;
  font-size: 12px;
  filter: grayscale(1);
  opacity: .8;
}

/* ============================================================
   SLA COUNTDOWN
============================================================ */
.sla-badge{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 2px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .08em;
  font-weight: 600;
  text-transform: uppercase;
}
.sla-badge.ok{ background: rgba(91,193,120,.12); color: var(--good); border: 1px solid rgba(91,193,120,.4); }
.sla-badge.warn{ background: rgba(229,161,74,.15); color: var(--warn); border: 1px solid rgba(229,161,74,.4); }
.sla-badge.urgent{
  background: rgba(229,89,79,.18); color: var(--bad-ink); border: 1px solid rgba(229,89,79,.5);
  animation: sla-pulse 1.2s ease-in-out infinite;
}
.sla-badge.breached{
  background: var(--bad); color: var(--cream); border: 1px solid var(--bad);
}
@keyframes sla-pulse{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(229,89,79,.5); }
  50%{ box-shadow: 0 0 0 6px rgba(229,89,79,0); }
}
.sla-badge .clock{
  display: inline-block;
  animation: sla-tick 1s steps(2) infinite;
}
@keyframes sla-tick{
  50%{ opacity: .4; }
}
.sla-progress{
  height: 4px;
  background: rgba(244,237,223,.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
  position: relative;
}
.sla-progress-fill{
  height: 100%;
  border-radius: 2px;
  transition: width 1s linear, background .3s;
}
.sla-progress-fill.ok{ background: var(--good); }
.sla-progress-fill.warn{ background: var(--warn); }
.sla-progress-fill.urgent{ background: var(--bad); }
.sla-progress-fill.breached{ background: var(--bad); }

/* ============================================================
   EMAIL COMPOSER
============================================================ */
.email-thread{
  display: flex; flex-direction: column; gap: 10px;
}
.email-msg{
  background: var(--navy-deep);
  border: 1px solid var(--rule-cream);
  border-radius: 4px;
  padding: 14px 16px;
}
.email-msg.sent{
  border-left: 3px solid var(--gold);
  background: linear-gradient(180deg, rgba(212,168,67,.06), rgba(212,168,67,.01));
}
.email-msg.received{
  border-left: 3px solid var(--teal-light);
}
.email-head{
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--rule-cream);
}
.email-from-line{
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--cream); opacity: .85;
}
.email-from-line b{ color: var(--gold-soft); font-weight: 500; }
.email-time{
  font-family: var(--ff-mono);
  font-size: 9.5px;
  color: var(--cream); opacity: .68;
  letter-spacing: .04em;
  white-space: nowrap;
}
.email-subject{
  font-family: var(--ff-serif);
  font-size: 15px;
  color: var(--cream);
  font-weight: 500;
  margin-bottom: 6px;
}
.email-body{
  font-family: var(--ff-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--cream);
  opacity: .92;
  white-space: pre-wrap;
}
.email-tags{
  display: flex; gap: 4px; margin-top: 10px;
  font-family: var(--ff-mono);
}
.email-status-pill{
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--ff-mono);
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.email-status-pill.sent{ background: rgba(91,193,120,.12); color: var(--good); }
.email-status-pill.opened{ background: rgba(212,168,67,.15); color: var(--gold); }
.email-status-pill.clicked{ background: rgba(111,166,224,.12); color: var(--info); }
.email-status-pill.replied{ background: rgba(43,177,177,.12); color: var(--teal-light); }
.email-status-pill.bounced{ background: rgba(229,89,79,.12); color: var(--bad-ink); }

.email-connect{
  background: linear-gradient(180deg, rgba(212,168,67,.06), rgba(212,168,67,.01));
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}
.email-connect.connected{
  background: linear-gradient(180deg, rgba(91,193,120,.08), rgba(91,193,120,.02));
  border: 1px solid rgba(91,193,120,.4);
}
.email-connect-ic{
  font-size: 28px;
  margin-bottom: 8px;
}
.email-connect-title{
  font-family: var(--ff-serif);
  font-size: 17px;
  color: var(--cream);
  font-weight: 500;
  margin-bottom: 6px;
}
.email-connect-desc{
  font-family: var(--ff-sans);
  font-size: 13px;
  color: var(--cream); opacity: .8;
  line-height: 1.5;
  margin-bottom: 14px;
}
.email-connect-btn{
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cream); color: var(--navy-deep);
  padding: 10px 18px;
  border-radius: 4px;
  border: 0;
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.email-connect-btn:hover{ background: var(--paper); }

/* OAuth simulated screen */
.oauth-shell{
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 28px 32px;
  border-radius: 6px;
  max-width: 440px;
  margin: 0 auto;
}
.oauth-logo{
  font-size: 22px;
  margin-bottom: 18px;
}
.oauth-h{
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 400;
}
.oauth-p{
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 18px;
}
.oauth-account{
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 10px;
}
.oauth-account:hover{ background: #f6f6f6; }
.oauth-account-av{
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285F4, #34A853);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-serif);
  font-size: 13px;
  font-weight: 600;
}
.oauth-account-info{ flex: 1; }
.oauth-account-name{ font-size: 13px; color: var(--ink); font-weight: 500; }
.oauth-account-email{ font-size: 11px; color: var(--ink-soft); }
.oauth-scopes{
  background: #f6f6f6;
  padding: 14px;
  border-radius: 4px;
  margin: 18px 0;
}
.oauth-scope{
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.oauth-scope:last-child{ margin-bottom: 0; }
.oauth-scope-ic{ color: #34A853; font-weight: 700; }
.oauth-btn-row{
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px;
}
.oauth-btn{
  padding: 9px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid #ddd;
  cursor: pointer;
}
.oauth-btn.cancel{ background: white; color: var(--ink-soft); }
.oauth-btn.allow{ background: #1A73E8; color: white; border-color: #1A73E8; font-weight: 500; }

/* ============================================================
   TELEPHONY / CALL DRAWER
============================================================ */
.call-drawer{
  position: fixed;
  bottom: 24px; right: 24px;
  width: 360px;
  background: linear-gradient(180deg, var(--navy-mid), var(--navy-deep));
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
  z-index: 75;
  overflow: hidden;
  animation: call-in .3s cubic-bezier(.2,.7,.2,1);
}
@keyframes call-in{
  from{ transform: translateY(20px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}
.call-banner{
  background: linear-gradient(135deg, var(--good), #7BD49B);
  color: var(--navy-deep);
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.call-banner.connecting{
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
}
.call-state{
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .18em;
  font-weight: 700;
}
.call-state .pulse{
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--navy-deep);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-red 1.4s ease-in-out infinite;
}
.call-timer{
  font-family: var(--ff-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
}
.call-body{
  padding: 18px;
}
.call-customer{
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.call-customer-av{
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-fill), var(--teal-deep));
  color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-serif);
  font-size: 18px;
  font-weight: 500;
  border: 2px solid var(--gold);
}
.call-name{
  font-family: var(--ff-serif);
  font-size: 17px;
  color: var(--cream);
  font-weight: 500;
}
.call-num{
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--gold-soft);
  margin-top: 2px;
  letter-spacing: .04em;
}
.call-transcript{
  background: var(--navy-deep);
  border: 1px solid var(--rule-cream);
  border-radius: 3px;
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
  font-family: var(--ff-sans);
  font-size: 12px;
  line-height: 1.55;
  color: var(--cream);
}
.call-transcript-row{
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--rule-cream);
}
.call-transcript-row:last-child{ border: 0; }
.call-transcript-speaker{
  font-family: var(--ff-mono);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: .12em;
  padding-top: 3px;
}
.call-transcript-speaker.cust{ color: var(--teal-light); }
.call-transcript-text{
  color: var(--cream);
  opacity: .95;
}
.call-transcript-trans{
  font-style: italic;
  color: var(--cream); opacity: .66;
  font-size: 10.5px;
  margin-top: 2px;
}
.call-controls{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.call-ctl{
  background: rgba(244,237,223,.06);
  border: 1px solid var(--rule-cream);
  color: var(--cream);
  padding: 10px 0;
  border-radius: 3px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s;
}
.call-ctl:hover{ border-color: var(--gold); color: var(--gold); }
.call-ctl.active{ background: var(--gold); color: var(--navy-deep); border-color: var(--gold); }
.call-ctl.danger{ background: var(--bad); color: var(--cream); border-color: var(--bad-ink); font-weight: 700; }
.call-ctl.danger:hover{ background: #DE3F35; }

.tel-btn{
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(91,193,120,.15);
  border: 1px solid rgba(91,193,120,.4);
  color: var(--good-ink);   /* --good on its own .15 tint measured 4.00 */
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  margin-left: 6px;
  vertical-align: middle;
  transition: all .15s;
}
.tel-btn:hover{ background: var(--good); color: var(--navy-deep); }

/* ============================================================
   WORKFLOW EXECUTION LOG
============================================================ */
.wf-log{
  background: var(--navy-deep);
  border: 1px solid var(--rule-cream);
  border-radius: 4px;
  overflow: hidden;
}
.wf-log-row{
  display: grid;
  grid-template-columns: 110px 32px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px dashed var(--rule-cream);
  font-size: 12.5px;
}
.wf-log-row:last-child{ border: 0; }
.wf-log-time{
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--gold-soft);
  letter-spacing: .04em;
}
.wf-log-ic{
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: rgba(212,168,67,.12);
  color: var(--gold);
  border: 1px solid var(--rule);
}
.wf-log-text{
  font-family: var(--ff-sans);
  color: var(--cream);
  line-height: 1.45;
}
.wf-log-text b{ color: var(--gold-soft); font-weight: 500; }
.wf-log-text em{ color: var(--gold); font-style: italic; }

/* ============================================================
   PWA INSTALL + OFFLINE
============================================================ */
.pwa-install{
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--navy-mid);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-pop);
  z-index: 65;
  max-width: 380px;
  display: none;
  animation: call-in .35s ease;
}
.pwa-install.show{ display: flex; }
.pwa-install-ic{
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--navy-deep);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-serif);
  font-size: 20px;
  font-weight: 800;
}
.pwa-install-text{
  font-family: var(--ff-sans);
  font-size: 12.5px;
  color: var(--cream);
  line-height: 1.4;
}
.pwa-install-text b{ color: var(--gold); }
.pwa-install button{
  flex-shrink: 0;
  background: var(--gold);
  color: var(--navy-deep);
  border: 0;
  padding: 8px 14px;
  border-radius: 3px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}
.pwa-install button.dismiss{
  background: transparent;
  border: 1px solid var(--rule-cream);
  color: var(--cream); opacity: .7;
}

.offline-indicator{
  position: fixed;
  top: var(--topbar-h);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--warn), #F5B36C);
  color: var(--navy-deep);
  padding: 8px 18px;
  border-radius: 0 0 4px 4px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .08em;
  font-weight: 600;
  z-index: 50;
  display: none;
}
.offline-indicator.show{ display: block; animation: audit-in .3s ease; }
.offline-indicator .dot{
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--bad);
  border-radius: 50%;
  margin-right: 6px;
  animation: blink 1s infinite;
}

/* ============================================================
   MOBILE NAV
============================================================ */
.hamburger-btn{
  display: none;
  background: transparent;
  border: 1px solid var(--rule-cream);
  color: var(--cream);
  width: 36px; height: 36px;
  border-radius: 3px;
  align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-bottom-nav{
  display: none;
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--navy-deep);
  border-top: 1px solid var(--rule);
  padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 25;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.mobile-bottom-nav-item{
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  color: var(--cream); opacity: .65;
  cursor: pointer;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mobile-bottom-nav-item.active{
  color: var(--gold);
  opacity: 1;
}
.mobile-bottom-nav-item .ic{
  font-size: 18px;
  height: 20px;
  display: flex; align-items: center; justify-content: center;
}
.mobile-bottom-nav-item .ic.plus{
  background: var(--gold);
  color: var(--navy-deep);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  margin-top: -14px;
  box-shadow: 0 -4px 16px -4px rgba(212,168,67,.5);
}

@media (max-width: 900px){
  .hamburger-btn{ display: inline-flex; }
  .mobile-bottom-nav{ display: grid; }
  .canvas{ padding-bottom: 80px; }
  .sidebar{
    position: fixed;
    top: var(--topbar-h);
    bottom: 0; left: 0;
    width: 260px !important;
    z-index: 35;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.2,.7,.2,1);
    background: var(--navy-deep);
    border-right: 1px solid var(--rule);
    box-shadow: 8px 0 30px -10px rgba(0,0,0,.6);
  }
  .sidebar.open{ transform: translateX(0); }
  .app{ grid-template-columns: 0 1fr; }
  .sidebar .nav-text,
  .sidebar .nav-badge,
  .sidebar .nav-tag,
  .sidebar .nav-section-label{
    display: inline-block !important;
  }
  .sidebar .nav-item{
    justify-content: flex-start !important;
    padding: 10px 16px !important;
  }
  .sidebar-foot{ display: block !important; }
  /* Mobile backdrop */
  .mobile-backdrop{
    position: fixed; inset: 0;
    background: rgba(8,27,51,.6);
    backdrop-filter: blur(4px);
    z-index: 34;
    display: none;
  }
  .mobile-backdrop.show{ display: block; }
}

/* ============================================================
   TENANT BANNER (when switching)
============================================================ */
.tenant-switch-banner{
  position: fixed;
  top: var(--topbar-h);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--navy-deep);
  padding: 10px 20px;
  border-radius: 0 0 6px 6px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .08em;
  font-weight: 700;
  z-index: 60;
  animation: tenant-banner-anim 3s ease forwards;
}
@keyframes tenant-banner-anim{
  0%{ transform: translate(-50%, -20px); opacity: 0; }
  10%, 80%{ transform: translate(-50%, 0); opacity: 1; }
  100%{ transform: translate(-50%, -20px); opacity: 0; pointer-events: none; }
}

/* ============================================================
   LIVE EDIT INDICATOR (when another user edits same record)
============================================================ */
.live-edit-pill{
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(43,177,177,.15);
  border: 1px solid rgba(43,177,177,.4);
  color: var(--teal-light);
  padding: 3px 8px;
  border-radius: 16px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.live-edit-pill .av{
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--navy-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px;
  font-weight: 700;
}

/* ============================================================
   WORKFLOW DESIGNER ENHANCED
============================================================ */
.wf-rule{
  background: var(--navy-deep);
  border: 1px solid var(--rule-cream);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .15s;
}
.wf-rule:hover{ border-color: var(--gold); }
.wf-rule.active{
  border-color: var(--good);
  background: linear-gradient(180deg, rgba(91,193,120,.08), rgba(91,193,120,.02));
}
.wf-rule-head{
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px;
}
.wf-rule-name{
  font-family: var(--ff-serif);
  font-size: 14px;
  color: var(--cream);
  font-weight: 500;
}
.wf-rule-stats{
  display: flex; gap: 14px;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--cream); opacity: .65;
  letter-spacing: .04em;
}
.wf-rule-stats b{ color: var(--gold); }

/* ============================================================
   TOPBAR TWEAKS for hamburger
============================================================ */
.topbar-l{
  padding-left: 8px;
}
