/* ===== PHERP Frontend Portal CSS — Production v4 (Enterprise) ===== */

/* ── Suppress all WordPress chrome ──────────────────────────── */
#wpadminbar{display:none!important}
html{margin-top:0!important;padding-top:0!important}
body.pherp-erp-shell,body.pherp-portal{
  margin:0!important;padding:0!important;
  background:#f0f4f8!important;
  font-family:'Segoe UI',system-ui,-apple-system,sans-serif!important;
}
body.pherp-erp-shell .wp-site-blocks,
body.pherp-erp-shell .wp-block-post-content,
body.pherp-erp-shell .is-layout-constrained,
body.pherp-erp-shell .has-global-padding,
body.pherp-erp-shell .entry-content{
  padding:0!important;margin:0!important;max-width:none!important;width:100%!important;
}

/* Hard reset for the plugin takeover template. This intentionally neutralizes
 * classic themes and block themes that wrap page content in a narrow max-width
 * container. The ERP itself owns the entire viewport. */
body.pherp-erp-shell,
body.pherp-erp-shell #page,
body.pherp-erp-shell #content,
body.pherp-erp-shell .site,
body.pherp-erp-shell .site-content,
body.pherp-erp-shell .site-main,
body.pherp-erp-shell main,
body.pherp-erp-shell .entry-content,
body.pherp-erp-shell .wp-site-blocks,
body.pherp-erp-shell .wp-block-post-content,
body.pherp-erp-shell .is-layout-constrained,
body.pherp-erp-shell .alignwide,
body.pherp-erp-shell .alignfull{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-left:0!important;
  padding-right:0!important;
}
body.pherp-erp-shell #page,
body.pherp-erp-shell .site,
body.pherp-erp-shell .site-content,
body.pherp-erp-shell .site-main{margin-top:0!important;margin-bottom:0!important}
body.pherp-portal .site-header,
body.pherp-portal .site-footer,
body.pherp-portal .wp-site-blocks>header,
body.pherp-portal .wp-site-blocks>footer,
body.pherp-portal .site-navigation,
body.pherp-portal .page-title,
body.pherp-portal h1.wp-block-post-title{
  display:none!important;
}

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
  /* Brand */
  --fe-navy:      #0b1f38;
  --fe-navy2:     #142844;
  --fe-teal:      #0d9488;
  --fe-teal2:     #0b8078;
  --fe-teal-pale: #f0fdfa;
  --fe-green:     #16a34a;
  --fe-red:       #dc2626;
  --fe-amber:     #d97706;
  --fe-blue:      #2563eb;
  --fe-purple:    #7c3aed;

  /* Layout */
  --fe-sidebar-w:   256px;
  --fe-sidebar-w-c: 64px;

  /* Surfaces */
  --fe-bg:           #f0f4f8;
  --fe-card-bg:      #ffffff;
  --fe-text:         #0f172a;
  --fe-text-soft:    #334155;
  --fe-muted:        #64748b;
  --fe-border:       #d1d9e0;
  --fe-border-light: #e8edf2;

  /* Geometry */
  --fe-radius:   10px;
  --fe-radius-lg:14px;

  /* Shadows */
  --fe-shadow:    0 1px 3px rgba(0,0,0,.08),0 0 0 1px rgba(0,0,0,.04);
  --fe-shadow-md: 0 4px 20px rgba(0,0,0,.10);
  --fe-shadow-lg: 0 8px 40px rgba(0,0,0,.14);
}

/* ── Reset ──────────────────────────────────────────────────── */
.pherp-portal *,.fe-app *{box-sizing:border-box}
.pherp-portal .site-content,.pherp-portal .entry-content,.pherp-portal .wp-block-post-content,.pherp-portal main.site-main{padding:0!important;margin:0!important;max-width:none!important;background:var(--fe-bg)}
.pherp-portal .site-header,.pherp-portal .site-footer,.pherp-portal .wp-site-blocks>header,.pherp-portal .wp-site-blocks>footer{display:none!important}
.pherp-portal .wp-site-blocks{padding:0!important}

/* ── App shell ──────────────────────────────────────────────── */
.fe-app{display:block;min-height:100vh;width:100%;background:var(--fe-bg);font-family:'Segoe UI',system-ui,-apple-system,sans-serif;color:var(--fe-text);font-size:14px;line-height:1.5;position:relative;overflow-x:hidden;}
.fe-main{
  margin-left:var(--fe-sidebar-w);
  width:calc(100% - var(--fe-sidebar-w));
  max-width:none!important;
  min-width:0;
  transition:margin-left .25s cubic-bezier(.4,0,.2,1);
  overflow-x:hidden;
  min-height:100vh;
}
/* ── Hard viewport layout contract ─────────────────────────── */
body.pherp-erp-shell .fe-app{
  position:relative!important;
  display:block!important;
  width:100vw!important;
  max-width:100vw!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  overflow-x:hidden!important;
}
body.pherp-erp-shell .fe-sidebar{
  left:0!important;
  right:auto!important;
  width:var(--fe-sidebar-w)!important;
}
body.pherp-erp-shell .fe-sidebar.fe-sidebar-collapsed{
  width:var(--fe-sidebar-w-c)!important;
}
body.pherp-erp-shell .fe-main{
  margin-left:var(--fe-sidebar-w)!important;
  width:calc(100vw - var(--fe-sidebar-w))!important;
  max-width:none!important;
}
body.pherp-erp-shell .fe-main.fe-main-expanded{
  margin-left:var(--fe-sidebar-w-c)!important;
  width:calc(100vw - var(--fe-sidebar-w-c))!important;
}

/* ── Topbar ──────────────────────────────────────────────── */
.fe-topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:0 28px;height:64px;
  background:#fff;
  border-bottom:1px solid var(--fe-border-light);
  position:sticky;top:0;z-index:50;
  gap:12px;
  box-shadow:0 1px 8px rgba(0,0,0,.06);
}
.fe-page-title{font-size:17px;font-weight:700;margin:0;color:var(--fe-navy);letter-spacing:-.2px}
.fe-branch-tag{font-size:13px;font-weight:600;color:#64748b;letter-spacing:0;margin-left:2px}
.fe-topbar-right{display:flex;align-items:center;gap:10px}
/* ── Notification bell ─────────────────────────────────────── */
.fe-notif-wrap{position:relative}
.fe-notif-btn{
  position:relative;display:flex;align-items:center;justify-content:center;
  width:36px;height:36px;border-radius:50%;border:1.5px solid var(--fe-border-light);
  background:#fff;color:#475569;cursor:pointer;transition:background .15s,color .15s,border-color .15s;
}
.fe-notif-btn:hover{background:var(--fe-teal-pale);color:var(--fe-teal);border-color:var(--fe-teal)}
.fe-notif-count{
  position:absolute;top:-4px;right:-4px;min-width:17px;height:17px;padding:0 4px;
  border-radius:9px;background:var(--fe-red);color:#fff;font-size:10px;font-weight:800;
  line-height:17px;text-align:center;box-shadow:0 0 0 2px #fff;
}
.fe-notif-dropdown{
  position:absolute;top:calc(100% + 10px);right:0;width:330px;max-width:88vw;
  background:#fff;border:1px solid var(--fe-border-light);border-radius:10px;
  box-shadow:var(--fe-shadow-md);z-index:120;overflow:hidden;
}
.fe-notif-dropdown-head{
  padding:12px 16px;font-size:13px;font-weight:800;color:var(--fe-navy);
  border-bottom:1px solid var(--fe-border-light);background:#f8fafc;
}
.fe-notif-list{max-height:360px;overflow-y:auto}
.fe-notif-item{
  display:flex;align-items:flex-start;gap:10px;padding:11px 16px;
  border-bottom:1px solid var(--fe-border-light);text-decoration:none;
  color:var(--fe-text);font-size:12.5px;line-height:1.45;transition:background .12s;
}
.fe-notif-item:last-child{border-bottom:none}
.fe-notif-item:hover{background:#f8fafc}
.fe-notif-icon{font-size:16px;line-height:1;flex-shrink:0;margin-top:1px}
.fe-notif-item.fe-notif-danger .fe-notif-text{color:var(--fe-red);font-weight:600}
.fe-notif-item.fe-notif-warn .fe-notif-text{color:#b45309;font-weight:600}
.fe-notif-empty{padding:22px 16px;text-align:center;color:var(--fe-muted);font-size:13px}
@media(max-width:480px){.fe-notif-dropdown{position:fixed;top:64px;right:8px;left:8px;width:auto;max-width:none}}
.fe-username{
  font-size:12.5px;color:var(--fe-muted);font-weight:600;
  background:#f8fafc;border:1px solid var(--fe-border-light);
  padding:5px 12px;border-radius:20px;
}

/* ── Cards ──────────────────────────────────────────────── */
.fe-card{
  background:var(--fe-card-bg);
  border-radius:var(--fe-radius-lg);
  box-shadow:var(--fe-shadow);
  margin:20px 24px 0;
  overflow:hidden;
  border:1px solid var(--fe-border-light);
}
.fe-card-header{
  padding:15px 20px;
  font-weight:700;font-size:13.5px;
  border-bottom:1px solid var(--fe-border-light);
  color:var(--fe-navy);
  background:linear-gradient(to right,#fafbfc,#f7f9fb);
  display:flex;align-items:center;justify-content:space-between;
}

/* ── KPI grid ─────────────────────────────────────────────── */
.fe-kpi-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px;padding:24px 24px 6px}
.fe-kpi-card{
  background:var(--fe-card-bg);
  border-radius:var(--fe-radius-lg);
  padding:20px 22px 18px;
  box-shadow:var(--fe-shadow);
  border:1px solid var(--fe-border-light);
  border-top:3px solid var(--fe-teal);
  position:relative;
  transition:box-shadow .18s,transform .18s;
}
.fe-kpi-card:hover{box-shadow:var(--fe-shadow-md);transform:translateY(-2px)}
.fe-kpi-card.loading{opacity:.45}
.fe-kpi-card.fe-kpi-warn{border-top-color:var(--fe-amber)}
.fe-kpi-card.fe-kpi-danger{border-top-color:var(--fe-red)}
.fe-kpi-label{
  font-size:10.5px;color:var(--fe-muted);
  text-transform:uppercase;letter-spacing:.07em;
  margin-bottom:8px;font-weight:700;
}
.fe-kpi-value{
  font-size:28px;font-weight:800;
  color:var(--fe-navy);line-height:1.1;
  font-variant-numeric:tabular-nums;
}
.fe-kpi-value.fe-warn{color:#92400e}
.fe-kpi-value.fe-danger{color:var(--fe-red)}
/* ── Tabs ────────────────────────────────────────────────── */
.fe-tabs{
  display:flex;padding:0 24px;gap:2px;
  border-bottom:2px solid var(--fe-border-light);
  background:#fff;
}
.fe-tab{
  background:none;border:none;
  border-bottom:3px solid transparent;
  margin-bottom:-2px;
  padding:14px 20px;
  font-size:13px;font-weight:600;
  color:var(--fe-muted);cursor:pointer;
  transition:all .16s;white-space:nowrap;
  font-family:inherit;
}
.fe-tab:hover{color:var(--fe-teal)}
.fe-tab.fe-tab-active{
  color:var(--fe-teal);
  border-bottom-color:var(--fe-teal);
  background:rgba(13,148,136,.04);
}

/* ── Toolbar ─────────────────────────────────────────────── */
.fe-toolbar{
  display:flex;align-items:center;gap:10px;
  padding:14px 24px;
  border-bottom:1px solid var(--fe-border-light);
  flex-wrap:wrap;background:#fafcfd;
}
/* ── Period pills (quick date-range presets, e.g. Sales History) ── */
.fe-period-pills{display:flex;flex-wrap:wrap;gap:6px;padding:0 24px}
.fe-period-pill{
  padding:6px 14px;border-radius:20px;border:1.5px solid var(--fe-border);
  background:#fff;color:var(--fe-navy);font-size:12.5px;font-weight:600;
  cursor:pointer;transition:all .15s ease;
}
.fe-period-pill:hover{border-color:var(--fe-teal);color:var(--fe-teal)}
.fe-period-pill-active{background:var(--fe-teal);border-color:var(--fe-teal);color:#fff}
/* ── Pagination bar (Sales History, and any future paginated list) ── */
.fe-pagination-bar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 20px;border-top:1px solid var(--fe-border-light);
  font-size:13px;color:var(--fe-muted);flex-wrap:wrap;
}
.fe-pagination-bar .fe-pagination-btns{display:flex;gap:6px}
.fe-pagination-bar button{
  padding:5px 12px;border-radius:6px;border:1px solid var(--fe-border);
  background:#fff;color:var(--fe-navy);font-size:13px;cursor:pointer;
}
.fe-pagination-bar button:disabled{opacity:.4;cursor:not-allowed}
.fe-pagination-bar button:not(:disabled):hover{border-color:var(--fe-teal);color:var(--fe-teal)}
.fe-loading-text{
  padding:32px;text-align:center;
  color:var(--fe-muted);font-size:14px;
  font-style:italic;
}
.fe-checkbox-label{
  display:flex;align-items:center;gap:6px;
  font-size:13.5px;color:var(--fe-text-soft);
  cursor:pointer;user-select:none;
}
.fe-checkbox-label input[type=checkbox]{width:15px;height:15px;cursor:pointer}
/* ── Sidebar ─────────────────────────────────────────────── */
.fe-sidebar{
  width:var(--fe-sidebar-w);
  background:var(--fe-navy);
  background:linear-gradient(180deg,var(--fe-navy2) 0%,#0a1528 100%);
  display:flex;flex-direction:column;
  position:fixed;top:0;left:0;bottom:0;
  z-index:200;
  overflow-y:auto;overflow-x:hidden;
  transition:width .25s cubic-bezier(.4,0,.2,1);
  box-shadow:3px 0 20px rgba(0,0,0,.22);
  scrollbar-width:none;
  flex-shrink:0;
}
.fe-sidebar::-webkit-scrollbar{display:none}
.fe-sidebar-brand{
  display:flex;align-items:center;gap:11px;
  padding:0 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
  color:#fff;font-weight:800;font-size:14.5px;
  min-height:64px;
  background:rgba(0,0,0,.18);
  letter-spacing:-.2px;
  flex-shrink:0;
  overflow:hidden;
}
.fe-sidebar-icon{font-size:26px;flex-shrink:0}
.fe-sidebar-name{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  line-height:1.3;font-size:14px;
  transition:opacity .2s,width .25s;
}
/* ── Toggle button: pill pinned to the brand row, right edge of sidebar ──
   Anchored to the fixed-height brand bar (not top:50% of the sidebar) so it
   never drifts into the nav-link list on tall/scrollable pages. */
.fe-sidebar-toggle{
  position:absolute;
  top:32px;
  right:-15px;
  transform:translateY(-50%);
  width:30px;height:30px;
  background:#fff;
  border:2px solid #cbd5e1;
  box-shadow:0 2px 10px rgba(0,0,0,.20);
  border-radius:50%;
  cursor:pointer;
  z-index:301; /* above sidebar z:200 */
  display:flex;align-items:center;justify-content:center;
  color:#475569;
  padding:0;
  line-height:1;
  /* SVG transition */
  transition:background .15s,border-color .15s,color .15s;
}
.fe-sidebar-toggle svg{
  display:block;
  flex-shrink:0;
  transition:transform .25s cubic-bezier(.4,0,.2,1);
}
.fe-sidebar-toggle:hover{
  background:var(--fe-teal);
  border-color:var(--fe-teal);
  color:#fff;
}
/* When sidebar is collapsed, rotate arrow 180° to point right → */
.fe-sidebar-collapsed .fe-sidebar-toggle{
  transform:translateY(-50%); /* keep vertical centering */
}
.fe-sidebar-collapsed .fe-sidebar-toggle svg{
  transform:rotate(180deg);
}
.fe-sidebar-collapsed{width:var(--fe-sidebar-w-c)!important}
.fe-sidebar-collapsed .fe-sidebar-name,.fe-sidebar-collapsed .fe-nav-label{display:none!important;opacity:0}
.fe-sidebar-collapsed .fe-sidebar-brand{padding:0 12px;justify-content:center}
.fe-main-expanded{margin-left:var(--fe-sidebar-w-c)!important;width:calc(100% - var(--fe-sidebar-w-c))!important}
.fe-nav-list{list-style:none;margin:0;padding:6px 10px;flex:1;display:flex;flex-direction:column;gap:2px}
.fe-nav-link{
  display:flex;align-items:center;gap:11px;
  padding:10px 12px;
  color:rgba(255,255,255,.68);
  text-decoration:none;font-size:13px;font-weight:500;
  border-radius:8px;
  transition:all .15s;
}
.fe-nav-link:hover{
  color:#fff;
  background:rgba(255,255,255,.09);
}
.fe-nav-link.fe-active{
  color:#fff;
  background:rgba(13,148,136,.28);
  box-shadow:inset 2px 0 0 var(--fe-teal);
}
.fe-nav-icon{font-size:16px;flex-shrink:0;width:22px;text-align:center;opacity:.85}
.fe-nav-label{white-space:nowrap}

/* Nav group headers */
.fe-nav-group-label{
  font-size:9.5px;font-weight:800;
  text-transform:uppercase;letter-spacing:.1em;
  color:rgba(255,255,255,.28);
  padding:14px 14px 4px;
  list-style:none;
}
.fe-sidebar-collapsed .fe-nav-group-label{display:none}

/* Sidebar footer (logged-in user) */
.fe-sidebar-footer{
  display:flex;align-items:center;gap:9px;
  padding:14px 16px;
  border-top:1px solid rgba(255,255,255,.08);
  margin-top:auto;
  color:rgba(255,255,255,.55);
  font-size:12.5px;
}
.fe-sidebar-user-icon{font-size:16px;flex-shrink:0}
.fe-sidebar-user-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fe-sidebar-collapsed .fe-sidebar-user-name{display:none}

/* Branch switcher (admin/owner/superadmin only) */
.fe-branch-switcher{
  display:flex;flex-direction:column;gap:4px;
  padding:12px 16px;
  border-top:1px solid rgba(255,255,255,.08);
  margin-top:8px;
}
/* The [hidden] attribute must always win over the class's display:flex above
   (same specificity as a plain class selector -- source order otherwise
   decides, and .fe-branch-switcher comes later). Without this override the
   switcher renders visibly-but-empty before JS populates + reveals it,
   which looks exactly like the page being stuck "loading". */
.fe-branch-switcher[hidden]{display:none!important}
.fe-branch-label{
  font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;
  color:rgba(255,255,255,.4);
}
.fe-branch-select{
  width:100%;
  padding:7px 10px;
  background:rgba(255,255,255,.08);
  border:1.5px solid rgba(255,255,255,.15);
  border-radius:6px;
  color:#fff;
  font-size:12.5px;
  font-weight:600;
  cursor:pointer;
  outline:none;
}
.fe-branch-select:focus{border-color:var(--fe-teal)}
.fe-branch-select option{color:#0f172a}
.fe-sidebar-collapsed .fe-branch-switcher{display:none}
.fe-field{display:flex;flex-direction:column;gap:5px;margin-bottom:14px;position:relative}
.fe-field label{font-size:12.5px;font-weight:700;color:var(--fe-text);text-transform:uppercase;letter-spacing:.04em}
/* ── Form inputs ─────────────────────────────────────────────── */
.fe-input{
  width:100%;padding:10px 13px;
  border:1.5px solid var(--fe-border);
  border-radius:8px;
  font-size:13.5px;
  background:#fff;color:var(--fe-text);
  outline:none;
  transition:border-color .16s,box-shadow .16s;
  font-family:inherit;
}
.fe-input:focus{
  border-color:var(--fe-teal);
  box-shadow:0 0 0 3px rgba(13,148,136,.14);
}
.fe-input::placeholder{color:#94a3b8}
.fe-input:disabled{background:#f8fafc;color:var(--fe-muted);cursor:not-allowed}
.fe-input-sm{padding:6px 10px;font-size:12.5px}
.fe-input-md{min-width:200px}
textarea.fe-input{resize:vertical;min-height:68px;line-height:1.5}
.fe-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 20px;padding:22px}
.fe-field-full{grid-column:1/-1}
.fe-subheader{
  font-size:10.5px;font-weight:800;
  color:var(--fe-teal);
  text-transform:uppercase;letter-spacing:.08em;
  padding:14px 0 6px;grid-column:1/-1;
  border-top:1.5px solid var(--fe-border-light);
  margin-top:8px;
}
.fe-req{color:var(--fe-red)}

/* ── Buttons ───────────────────────────────────────────────── */
.fe-btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:9px 18px;
  border-radius:8px;
  font-size:13.5px;font-weight:600;
  cursor:pointer;border:none;
  transition:all .15s;
  text-decoration:none;white-space:nowrap;line-height:1.2;
  font-family:inherit;
}
.fe-btn:disabled{opacity:.5;cursor:not-allowed;transform:none!important;box-shadow:none!important}
.fe-btn:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,0,0,.15)}
.fe-btn-primary{background:var(--fe-teal);color:#fff;box-shadow:0 1px 4px rgba(13,148,136,.25)}
.fe-btn-primary:hover:not(:disabled){background:var(--fe-teal2)}
.fe-btn-success{background:var(--fe-green);color:#fff;box-shadow:0 1px 4px rgba(22,163,74,.2)}
.fe-btn-success:hover:not(:disabled){background:#15803d}
.fe-btn-info{background:var(--fe-blue);color:#fff}
.fe-btn-info:hover:not(:disabled){background:#1d4ed8}
.fe-btn-danger{background:var(--fe-red);color:#fff;box-shadow:0 1px 4px rgba(220,38,38,.2)}
.fe-btn-danger:hover:not(:disabled){background:#b91c1c}
.fe-btn-outline{background:#fff;color:var(--fe-teal);border:1.5px solid var(--fe-teal)}
.fe-btn-outline:hover:not(:disabled){background:var(--fe-teal-pale)}
.fe-btn-ghost{background:transparent;color:var(--fe-muted);border:1.5px solid var(--fe-border)}
.fe-btn-ghost:hover:not(:disabled){background:var(--fe-bg);color:var(--fe-text)}
.fe-btn-sm{padding:6px 12px;font-size:12.5px}
.fe-btn-xs{padding:3px 8px;font-size:11.5px}
.fe-btn-full{width:100%;justify-content:center;margin-top:4px}
.fe-btn-icon{background:none;border:none;cursor:pointer;color:var(--fe-muted);padding:4px 8px;font-size:15px;border-radius:6px;transition:all .15s}
.fe-btn-icon:hover{color:var(--fe-red);background:#fee2e2}
.fe-btn-del{background:#fef2f2;color:#991b1b;border:1.5px solid #fca5a5}
.fe-btn-del:hover{background:#fee2e2}
.fe-alert{padding:10px 14px;border-radius:6px;font-size:13.5px;margin-bottom:12px;font-weight:500}
.fe-alert-success{background:#dcfce7;color:#14532d;border:1px solid #86efac}
.fe-alert-error{background:#fee2e2;color:#7f1d1d;border:1px solid #fca5a5}
.fe-alert-info{background:#dbeafe;color:#1e3a5f;border:1px solid #93c5fd}
.fe-alert-warning{background:#fef3c7;color:#78350f;border:1px solid #fcd34d}
.fe-detail-grid p{margin:0 0 10px;font-size:13.5px;line-height:1.5;color:var(--fe-text)}
.fe-detail-grid p strong{display:inline-block;min-width:110px;color:#64748b}
.fe-pw-wrap{position:relative}
.fe-pw-toggle{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:var(--fe-muted);font-size:15px;padding:2px}
.fe-spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:fe-spin .7s linear infinite;display:inline-block}
@keyframes fe-spin{to{transform:rotate(360deg)}}
/* ── Tables ───────────────────────────────────────────────── */
.fe-table{width:100%;border-collapse:collapse;font-size:13.5px}
.fe-table th{
  background:#f4f7fa;
  padding:11px 15px;
  text-align:left;font-weight:700;font-size:11px;
  color:var(--fe-text-soft);
  border-bottom:2px solid var(--fe-border);
  white-space:nowrap;
  text-transform:uppercase;letter-spacing:.05em;
}
.fe-table td{
  padding:12px 15px;
  border-bottom:1px solid var(--fe-border-light);
  vertical-align:middle;color:var(--fe-text);
  line-height:1.4;
}
.fe-table tbody tr:last-child td{border-bottom:none}
.fe-table tbody tr:hover td{background:#f7fbfb}
/* Stock Transfers list: keep From/To branch columns from ballooning to fill
   all leftover width (which forced 2-line wraps on long branch names) and
   give Date/Status/Actions their natural, compact widths instead. */
#trf-table-wrap table{table-layout:fixed}
#trf-table-wrap th:nth-child(1),#trf-table-wrap td:nth-child(1){width:13%}
#trf-table-wrap th:nth-child(2),#trf-table-wrap td:nth-child(2){width:25%}
#trf-table-wrap th:nth-child(3),#trf-table-wrap td:nth-child(3){width:25%}
#trf-table-wrap th:nth-child(4),#trf-table-wrap td:nth-child(4){width:13%;white-space:nowrap}
#trf-table-wrap th:nth-child(5),#trf-table-wrap td:nth-child(5){width:11%}
#trf-table-wrap th:nth-child(6),#trf-table-wrap td:nth-child(6){width:13%;white-space:nowrap}
#trf-table-wrap td:nth-child(2),#trf-table-wrap td:nth-child(3){
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.fe-table .col-currency{
  text-align:right;
  font-variant-numeric:tabular-nums;
  font-weight:700;
  color:var(--fe-navy);
}
.fe-table td strong{color:var(--fe-navy);font-weight:700}
.fe-table small{color:var(--fe-muted);font-size:12px}
.fe-table-wrap{overflow-x:auto}
/* ── Badges ───────────────────────────────────────────────── */
.fe-badge{
  display:inline-block;
  padding:3px 10px;
  border-radius:20px;
  font-size:11px;font-weight:700;
  letter-spacing:.04em;
  vertical-align:middle;
}
.fe-badge-green{background:#dcfce7;color:#14532d}
.fe-badge-red{background:#fee2e2;color:#7f1d1d}
.fe-badge-amber{background:#fef3c7;color:#78350f}
.fe-badge-blue{background:#dbeafe;color:#1e3a8a}
.fe-badge-gray{background:#f1f5f9;color:#475569}
.fe-badge-purple{background:#ede9fe;color:#4c1d95}
/* ── Modals ───────────────────────────────────────────────── */
.fe-modal-overlay{
  position:fixed;inset:0;
  background:rgba(7,16,32,.65);
  backdrop-filter:blur(3px);
  z-index:999;
  display:flex;align-items:center;justify-content:center;
  padding:16px;
  animation:fe-overlay-in .18s ease;
}
@keyframes fe-overlay-in{from{opacity:0}to{opacity:1}}
.fe-modal{
  background:#fff;
  border-radius:var(--fe-radius-lg);
  max-height:90vh;overflow-y:auto;
  box-shadow:var(--fe-shadow-lg);
  width:100%;max-width:660px;
  border:1px solid var(--fe-border-light);
  animation:fe-modal-in .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes fe-modal-in{from{opacity:0;transform:scale(.94)translateY(8px)}to{opacity:1;transform:none}}
.fe-modal-lg{max-width:900px}
.fe-modal-sm{max-width:460px}
.fe-modal-xl{max-width:1100px}
.fe-modal-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:17px 22px;
  border-bottom:1px solid var(--fe-border-light);
  background:linear-gradient(to right,#f8fafc,#f5f8fa);
}
.fe-modal-header h3{margin:0;font-size:16px;font-weight:800;color:var(--fe-navy)}
.fe-modal-close{
  background:none;border:none;font-size:20px;
  cursor:pointer;color:var(--fe-muted);
  padding:4px 8px;border-radius:6px;line-height:1;transition:.15s;
}
.fe-modal-close:hover{background:#fee2e2;color:var(--fe-red)}
.fe-modal-body{padding:22px}
/* Forms already carry their own 22px padding (used standalone inside
   .fe-card on Settings, etc). Nesting one inside .fe-modal-body, which ALSO
   pads 22px, was doubling the inset to 44px on every entry-form modal across
   Inventory, POS, Procurement, Patients, Staff, Debtors, Payouts, Layaways,
   Returns, Spoilage, Prescriptions, Payroll, Expenses and Transfers -- the
   single biggest visual "misaligned form" issue in the app. Zero it out in
   this context only so the modal's own padding is the sole inset. */
.fe-modal-body>.fe-form-grid,
.fe-modal-body>form.fe-form-grid{padding:0}
.fe-modal-footer{
  display:flex;justify-content:flex-end;gap:10px;
  padding:15px 22px;
  border-top:1px solid var(--fe-border-light);
  background:#f8fafc;
}
.fe-autocomplete-dropdown{position:absolute;top:100%;left:0;right:0;background:#fff;border:1.5px solid var(--fe-border);border-radius:6px;box-shadow:var(--fe-shadow-md);z-index:200;max-height:240px;overflow-y:auto}
.fe-dropdown-item{padding:9px 14px;cursor:pointer;font-size:13.5px;display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--fe-text);border-bottom:1px solid var(--fe-border-light)}
.fe-dropdown-item:last-child{border-bottom:none}
.fe-dropdown-item:hover{background:#f0fafa;color:var(--fe-teal)}
.fe-item-price{font-size:12px;color:var(--fe-muted);font-weight:600}
.fe-item-stock-low{color:var(--fe-red);font-size:11px;font-weight:700}
/* pherp-modal */
.pherp-modal{display:none;position:fixed;inset:0;z-index:1000;align-items:center;justify-content:center;padding:16px;overflow-y:auto}
.pherp-modal.pherp-modal-open{display:flex}
/* Defensive fallback: centering must work even if a modal is missing its
   .modal-overlay wrapper (root cause of the Settings/Users/Expenses forms
   rendering top-left instead of centered) -- .pherp-modal itself now also
   centers its .modal-box directly via flex, so future modals can't regress. */
.modal-overlay{position:absolute;inset:0;background:rgba(9,20,36,.6);display:flex;align-items:center;justify-content:center;padding:16px}
.modal-box{position:relative;background:#fff;border-radius:12px;max-height:92vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.3);width:90vw;max-width:700px;z-index:1;border:1px solid var(--fe-border-light)}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--fe-border-light);background:#f8fafc}
.modal-header h3{margin:0;font-size:16px;font-weight:800;color:var(--fe-navy)}
.modal-close{background:none;border:none;font-size:22px;cursor:pointer;color:var(--fe-muted);padding:4px 8px;border-radius:4px;line-height:1;transition:.15s}
.modal-close:hover{background:var(--fe-border-light);color:var(--fe-red)}
.modal-body{padding:20px}
/* Same double-padding fix as .fe-modal-body above, for the parallel
   .pherp-modal system used by Expenses, Users and the Settings branch
   modal -- .fe-form-grid's own 22px padding was stacking on top of this
   modal-body's 20px, pushing every field inward unevenly. */
.modal-body>.fe-form-grid,
.modal-body>form.fe-form-grid{padding:0}
.modal-footer{display:flex;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid var(--fe-border-light);background:#f8fafc}
.modal-sm .modal-box{max-width:460px}
.modal-lg .modal-box{max-width:700px}
.modal-xl .modal-box{max-width:980px}
/* === POS === */
.fe-pos-layout{display:flex;align-items:flex-start;padding:20px;gap:20px}
.fe-pos-cart-panel{flex:2;min-width:0}
.fe-pos-cart-panel .fe-card,.fe-pos-payment-panel .fe-card{margin:0}
.fe-pos-payment-panel{width:320px;flex-shrink:0;display:flex;flex-direction:column;gap:16px}
.fe-pos-totals{padding:12px 16px;border-top:1px solid var(--fe-border-light);background:#f8fafc}
.fe-pos-total-row{display:flex;justify-content:space-between;padding:5px 0;font-size:14px;color:var(--fe-text-soft)}
.fe-pos-grand-total{font-size:20px;font-weight:800;color:var(--fe-navy);border-top:2px solid var(--fe-border);padding-top:10px;margin-top:6px}
.fe-pos-change-row{display:flex;justify-content:space-between;padding:8px 12px;background:#f0fdf4;border-radius:6px;font-weight:700;color:var(--fe-green);margin-top:8px;font-size:16px;border:1px solid #86efac}
.fe-patient-badge{display:flex;align-items:center;gap:8px;padding:8px 12px;background:#f0fdf4;border-radius:6px;font-size:13.5px;border:1px solid #86efac;color:#14532d;font-weight:600}
.fe-recent-list{padding:0;max-height:220px;overflow-y:auto}
.fe-recent-item{display:flex;justify-content:space-between;padding:8px 14px;border-bottom:1px solid var(--fe-border-light);font-size:13px;color:var(--fe-text)}
.fe-recent-item:last-child{border-bottom:none}
.fe-recent-item:hover{background:#f8fafc}
.fe-quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:16px}
.fe-qa-btn{display:block;padding:10px 12px;background:#f0fafa;border-radius:8px;text-align:center;text-decoration:none;color:var(--fe-navy);font-size:13px;font-weight:700;transition:.15s;border:1.5px solid transparent}
.fe-qa-btn:hover{background:var(--fe-teal);color:#fff;border-color:var(--fe-teal)}
/* ═══════════════════════════════════════════════════════════════
   RECEIPT — screen + print
   ═══════════════════════════════════════════════════════════════ */
.fe-receipt{
  font-size:13px;line-height:1.7;
  font-family:'Courier New',Courier,monospace;
  color:#111;
  max-width:380px;
  margin:0 auto;
}
.fe-receipt-header{
  text-align:center;
  padding-bottom:12px;
  border-bottom:2px dashed #ccc;
  margin-bottom:12px;
}
.fe-receipt-header .rx-pharmacy-logo{
  max-height:56px;max-width:180px;
  object-fit:contain;
  margin:0 auto 6px;
  display:block;
}
.fe-receipt-header .rx-pharmacy-name{
  font-size:18px;font-weight:800;
  color:var(--fe-navy);
  letter-spacing:-.3px;
}
.fe-receipt-header .rx-pharmacy-address{
  font-size:11.5px;color:#555;
  line-height:1.5;
}
.fe-receipt-header .rx-pharmacy-phone{
  font-size:12px;color:#333;font-weight:600;
}
.fe-receipt-meta{
  display:flex;justify-content:space-between;
  font-size:12px;color:#555;
  padding:4px 0;
  border-bottom:1px dashed #ccc;
  margin-bottom:8px;
  gap:8px;
}
.fe-receipt-meta strong{color:#111}
.fe-receipt-divider{border:none;border-top:1px dashed #ccc;margin:10px 0}
.fe-receipt table{
  width:100%;border-collapse:collapse;
  margin:8px 0;font-size:12.5px;
}
.fe-receipt table thead th{
  font-size:11px;text-transform:uppercase;
  letter-spacing:.04em;color:#555;
  padding:4px 0;border-bottom:1px solid #ccc;
  text-align:left;font-weight:700;
}
.fe-receipt table thead th:last-child{text-align:right}
.fe-receipt table tbody td{
  padding:5px 0;
  border-bottom:1px dotted #eee;
  vertical-align:top;
}
.fe-receipt table tbody td:last-child{text-align:right;font-weight:600}
.fe-receipt-totals{
  margin-top:8px;
  border-top:2px dashed #ccc;
  padding-top:8px;
}
.fe-receipt-total-row{
  display:flex;justify-content:space-between;
  font-size:13px;padding:2px 0;
  color:#333;
}
.fe-receipt-total-row.grand{
  font-size:17px;font-weight:800;
  color:var(--fe-navy);
  padding:8px 0 4px;
  border-top:2px solid #ccc;
  margin-top:6px;
}
.fe-receipt-total-row.change{
  color:var(--fe-green);font-weight:700;
  font-size:14px;
}
.fe-receipt-footer{
  text-align:center;
  color:#666;font-size:11px;
  margin-top:14px;
  border-top:1px dashed #ccc;
  padding-top:10px;
  line-height:1.8;
}
.fe-receipt-footer .rx-thank-you{
  font-size:13px;font-weight:700;
  color:var(--fe-teal);
}
/* Print button */
.fe-receipt-print-btn{
  display:block;width:100%;
  margin-top:16px;
  padding:11px;
  background:var(--fe-navy);
  color:#fff;border:none;
  border-radius:8px;
  font-size:14px;font-weight:700;
  cursor:pointer;transition:.15s;
  font-family:inherit;
}
.fe-receipt-print-btn:hover{background:var(--fe-teal)}

@media print{
  /* On print: only show the receipt */
  body.pherp-erp-shell *:not(.fe-receipt-printable):not(.fe-receipt-printable *){
    visibility:hidden;
  }
  .fe-receipt-printable,.fe-receipt-printable *{
    visibility:visible;
  }
  .fe-receipt-printable{
    position:fixed;top:0;left:0;right:0;
    padding:20px;
  }
  .fe-receipt-print-btn{display:none!important}
}
/* ── Product import (Inventory) ───────────────────────────── */
.fe-import-help{font-size:12.5px;color:var(--fe-muted);line-height:1.6;margin:0 0 12px}
.fe-import-actions{margin-bottom:14px}
.fe-link{color:var(--fe-teal);font-size:13px;font-weight:600;text-decoration:none}
.fe-link:hover{text-decoration:underline}
.fe-import-dropzone{
  border:2px dashed var(--fe-border);border-radius:10px;padding:36px 20px;
  text-align:center;cursor:pointer;transition:border-color .15s,background .15s;background:#fafcff;
}
.fe-import-dropzone:hover,.fe-import-dropzone.fe-import-drag{border-color:var(--fe-teal);background:var(--fe-teal-pale)}
.fe-import-dropzone-icon{font-size:34px;line-height:1;margin-bottom:8px}
.fe-import-dropzone-text{font-size:14px;font-weight:600;color:var(--fe-navy)}
.fe-import-dropzone-hint{font-size:11.5px;color:var(--fe-muted);margin-top:4px}
.fe-import-summary{background:#f8fafc;border:1px solid var(--fe-border-light);border-radius:8px;padding:12px 16px;margin-bottom:14px;font-size:13px;line-height:1.9}
.fe-import-summary .fe-badge{margin:2px 3px 2px 0;display:inline-block}
.fe-import-error{color:var(--fe-red);font-size:13px;font-weight:600}
.fe-import-success{color:#166534;font-size:14px;font-weight:700}
.fe-import-error-list{margin:8px 0 0;padding-left:20px;font-size:12.5px;color:#b45309;max-height:180px;overflow-y:auto}
.fe-import-error-list li{margin-bottom:4px}
/* toast */
#fe-toast-container{position:fixed;bottom:24px;right:24px;z-index:9999;display:flex;flex-direction:column;gap:8px}
.fe-toast{padding:12px 18px;border-radius:8px;font-size:13.5px;font-weight:600;color:#fff;box-shadow:var(--fe-shadow-md);animation:fe-toast-in .3s ease;max-width:340px}
.fe-toast-success{background:var(--fe-green)}
.fe-toast-error{background:var(--fe-red)}
.fe-toast-info{background:var(--fe-blue)}
@keyframes fe-toast-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
/* utilities */
.fe-row{display:flex;align-items:flex-start;flex-wrap:wrap}
.fe-gap-lg{gap:20px}
.fe-warn{color:#92400e!important}
.fe-danger{color:var(--fe-red)!important}
.fe-success{color:var(--fe-green)!important}
.col-actions{white-space:nowrap}
.rep-output{padding:0 20px 20px}
.fe-card-footer{padding:14px 20px;border-top:1px solid var(--fe-border-light);display:flex;justify-content:flex-end;gap:10px}
/* KPI strip */
.fe-kpi-strip{display:flex;gap:12px;padding:0 0 16px;flex-wrap:wrap}
.fe-kpi-mini{display:flex;flex-direction:column;gap:2px;padding:10px 18px;background:#fff;border:1.5px solid var(--fe-border);border-radius:8px;min-width:120px}
.fe-kpi-mini.warn{border-color:var(--fe-amber);background:#fffbeb}
.fe-kpi-mini.danger{border-color:var(--fe-red);background:#fef2f2}
.fe-kpi-mini-label{font-size:11px;color:var(--fe-muted);font-weight:600;text-transform:uppercase;letter-spacing:.4px}
.fe-kpi-mini-val{font-size:22px;font-weight:800;color:var(--fe-navy)}
.fe-kpi-mini.warn .fe-kpi-mini-val{color:#92400e}
.fe-kpi-mini.danger .fe-kpi-mini-val{color:var(--fe-red)}
.fe-form-section-title{font-size:12px;font-weight:700;color:var(--fe-teal);text-transform:uppercase;letter-spacing:.6px;padding:8px 0 4px;border-bottom:1.5px solid var(--fe-border-light);margin:4px 0 2px}
/* btn aliases */
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border:none;border-radius:6px;font-size:14px;font-weight:600;cursor:pointer;transition:all .15s;text-decoration:none}
.btn-primary{background:var(--fe-teal);color:#fff}.btn-primary:hover{background:var(--fe-teal2)}
.btn-secondary{background:#f1f5f9;color:var(--fe-text);border:1.5px solid var(--fe-border)}.btn-secondary:hover{background:var(--fe-border-light)}
.btn-danger{background:var(--fe-red);color:#fff}.btn-danger:hover{background:#b91c1c}
.btn-success{background:var(--fe-green);color:#fff}
.btn-xs{padding:4px 10px;font-size:12px}
.btn-sm{padding:6px 12px;font-size:13px}
.form-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-group{display:flex;flex-direction:column;gap:5px}
.form-group label{font-size:12.5px;font-weight:700;color:var(--fe-text);text-transform:uppercase;letter-spacing:.04em}
.form-group input,.form-group select,.form-group textarea{padding:8px 12px;border:1.5px solid var(--fe-border);border-radius:6px;font-size:13.5px;outline:none;width:100%;background:#fff;color:var(--fe-text)}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{border-color:var(--fe-teal);box-shadow:0 0 0 3px rgba(14,165,160,.12)}
.req{color:var(--fe-red)}
.text-center{text-align:center}
/* User management */
.module-tabs{display:flex;gap:6px;padding:0 0 16px;border-bottom:2px solid var(--fe-border-light);margin-bottom:20px;flex-wrap:wrap}
.tab-btn{display:flex;align-items:center;gap:6px;padding:8px 18px;border:1.5px solid var(--fe-border);border-radius:6px;background:#fff;color:var(--fe-text-soft);font-size:13.5px;font-weight:600;cursor:pointer;transition:all .15s}
.tab-btn:hover{border-color:var(--fe-teal);color:var(--fe-teal)}
.tab-btn.active{border-color:var(--fe-teal);background:var(--fe-teal);color:#fff}
.tab-btn .tab-icon{font-size:16px}
.tab-pane{display:none}
.tab-pane.active{display:block}
.kpi-pill{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:20px;background:#e8f5e9;color:#1b5e20;font-size:13px;font-weight:600;border:1px solid #a7f3d0}
.kpi-pill.warn{background:#fff8e1;color:#e65100;border-color:#fde68a}
.kpi-pill.danger{background:#fce4ec;color:#b71c1c;border-color:#fca5a5}
.module-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.toolbar-left{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.toolbar-right{display:flex;align-items:center;gap:8px}
.search-input{padding:7px 12px;border:1.5px solid var(--fe-border);border-radius:6px;font-size:14px;min-width:200px;outline:none;background:#fff;color:var(--fe-text)}
.search-input:focus{border-color:var(--fe-teal)}
.info-text{font-size:13px;color:var(--fe-muted);font-style:italic}
.roles-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px}
.role-card{background:#fff;border:1.5px solid var(--fe-border);border-radius:10px;padding:18px;transition:box-shadow .18s}
.role-card:hover{box-shadow:var(--fe-shadow-md)}
.role-card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;gap:8px}
.role-card-name{font-size:15px;font-weight:800;color:var(--fe-navy)}
.role-badge{padding:3px 10px;border-radius:12px;font-size:11px;font-weight:700;letter-spacing:.5px}
.role-badge.system{background:#dbeafe;color:#1e3a8a}
.role-badge.custom{background:#ede9fe;color:#4c1d95}
.role-card-desc{font-size:13px;color:var(--fe-text-soft);margin-bottom:12px;line-height:1.5}
.role-card-mods{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:12px}
.mod-tag{padding:2px 8px;border-radius:12px;font-size:11px;background:#f1f5f9;color:#334155;font-weight:600}
.role-card-actions{display:flex;gap:8px}
.role-user-count{font-size:12px;color:var(--fe-muted);margin-left:auto}
.perms-heading{font-size:15px;font-weight:700;color:var(--fe-navy);margin:20px 0 4px}
.perms-sub{font-size:13px;color:var(--fe-muted);margin-bottom:12px}
.perms-table-wrap{overflow-x:auto;border:1.5px solid var(--fe-border);border-radius:8px}
.perms-table{width:100%;border-collapse:collapse}
.perms-table th,.perms-table td{padding:10px 14px;border-bottom:1px solid var(--fe-border-light);text-align:left;font-size:13px}
.perms-table th{background:#f1f5f9;font-weight:700;color:var(--fe-navy);font-size:12px;text-transform:uppercase}
.perms-table td.mod-col{font-weight:600;color:var(--fe-text);min-width:160px}
.perms-table tr:last-child td{border-bottom:none}
.perms-table tr:hover td{background:#f8fafc}
.perms-table input[type=checkbox]{width:16px;height:16px;accent-color:var(--fe-teal);cursor:pointer}
.all-col-check{accent-color:var(--fe-amber)}
.form-full{grid-column:1/-1}
.input-pw-wrap{position:relative;display:flex}
.input-pw-wrap input{flex:1;padding-right:40px}
.toggle-pw{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;font-size:16px;color:var(--fe-muted)}
.toggle-switch{display:inline-flex;align-items:center;cursor:pointer}
.toggle-switch input{opacity:0;width:0;height:0;position:absolute}
.slider{display:inline-block;width:44px;height:24px;background:#cbd5e1;border-radius:24px;position:relative;transition:background .2s}
.slider::before{content:'';position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;border-radius:50%;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.toggle-switch input:checked+.slider{background:var(--fe-teal)}
.toggle-switch input:checked+.slider::before{transform:translateX(20px)}
.badge-active{background:#dcfce7;color:#14532d;padding:2px 10px;border-radius:12px;font-size:11px;font-weight:700}
.badge-inactive{background:#fef9c3;color:#713f12;padding:2px 10px;border-radius:12px;font-size:11px;font-weight:700}
.badge-locked{background:#fee2e2;color:#7f1d1d;padding:2px 10px;border-radius:12px;font-size:11px;font-weight:700}
.fe-row-active{background:#eff6ff!important;outline:2px solid var(--fe-blue);outline-offset:-2px}
.pay-run-row:hover{background:#f0fdf4;cursor:pointer}
/* DB Management */
.db-mgmt-card{border-color:#fca5a5!important}
.db-mgmt-header{display:flex;align-items:flex-start;gap:14px;padding:20px 20px 0}
.db-mgmt-icon{font-size:32px;flex-shrink:0;line-height:1}
.db-mgmt-title{margin:0 0 4px;font-size:17px;font-weight:800;color:#991b1b}
.db-mgmt-sub{margin:0;font-size:13px;color:var(--fe-muted)}
.db-mgmt-section{padding:20px}
.db-mgmt-section+.db-mgmt-section{border-top:1px solid var(--fe-border-light)}
.db-mgmt-section-title{margin:0 0 4px;font-size:14px;font-weight:700;color:var(--fe-navy)}
.db-mgmt-section-sub{margin:0 0 14px;font-size:13px;color:var(--fe-muted)}
.db-purge-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:8px}
.db-purge-item{display:flex;align-items:center;gap:10px;padding:10px 14px;background:#fff8f8;border:1px solid #fecaca;border-radius:8px}
.db-purge-icon{font-size:20px;flex-shrink:0;width:28px;text-align:center}
.db-purge-info{flex:1;min-width:0}
.db-purge-info strong{font-size:13px;color:var(--fe-text);font-weight:700}
.db-purge-info p{margin:2px 0 0;font-size:12px;color:var(--fe-muted);line-height:1.4}
.db-purge-btn{background:#fff!important;border:1.5px solid #fca5a5!important;color:#991b1b!important;white-space:nowrap}
.db-purge-btn:hover{background:#fef2f2!important}
.db-danger-zone{background:#fff5f5;border-radius:0 0 8px 8px}
.db-danger-grid{display:flex;flex-direction:column;gap:0}
.db-danger-item{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap}
.db-danger-item p{margin:4px 0 0;font-size:13px;color:#7f1d1d;line-height:1.5}
.db-danger-item strong{font-size:14px;color:#991b1b;font-weight:700}
.db-danger-btn{background:#dc2626!important;color:#fff!important;border:none!important;white-space:nowrap;flex-shrink:0}
.db-danger-btn:hover{background:#b91c1c!important}
.db-factory-btn{background:#7f1d1d!important}
.db-factory-btn:hover{background:#6b1a1a!important}
.db-confirm-warning{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;background:#fff5f5;border:1.5px solid #fca5a5;border-radius:8px}
.db-confirm-icon{font-size:24px;flex-shrink:0}
.db-confirm-warning p{margin:0;font-size:14px;color:#7f1d1d;line-height:1.5;font-weight:500}
.db-confirm-execute{background:#dc2626!important;color:#fff!important;border:none!important}
.db-confirm-execute:disabled{opacity:.45;cursor:not-allowed}
/* === Additional production styles === */
.fe-kpi-value.fe-success{color:var(--fe-green)}
.fe-success{color:var(--fe-green)}
.fe-danger{color:var(--fe-red)}
.fe-warn{color:#92400e}
/* Debt balance display */
#debt-balance-display{font-weight:700;color:var(--fe-teal);font-size:15px}
/* Receipt inner styles */
.fe-receipt{font-family:'Courier New',monospace;font-size:13px;line-height:1.6;padding:8px}
.fe-receipt h4{text-align:center;font-size:15px;font-weight:800;margin:0 0 4px;font-family:inherit}
.fe-receipt .receipt-meta{text-align:center;color:#555;font-size:12px;margin:0 0 8px}
.fe-receipt table{width:100%;border-collapse:collapse;margin:8px 0}
.fe-receipt table th,.fe-receipt table td{padding:3px 4px;font-size:12px;border-bottom:1px dotted #ccc}
.fe-receipt .receipt-total{display:flex;justify-content:space-between;font-weight:700;font-size:14px;border-top:2px solid #000;margin-top:6px;padding-top:6px}
.fe-receipt .receipt-footer{text-align:center;font-size:11px;color:#777;margin-top:8px;border-top:1px dashed #ccc;padding-top:6px}
/* Payroll row active */
.fe-row-active{background:rgba(14,165,160,.08)!important;outline:2px solid var(--fe-teal);outline-offset:-2px}
.pay-run-row:hover{background:#f0fafa;cursor:pointer}
/* Proc view modal */
#proc-view-modal .fe-modal-body{max-height:60vh;overflow-y:auto}
/* Alert info style */
.fe-alert-info{background:#eff6ff;border:1px solid #bfdbfe;color:#1e40af;padding:10px 14px;border-radius:6px;font-size:13px}
/* fe-subheader */
.fe-subheader{font-weight:700;font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--fe-muted);padding:12px 0 6px;border-bottom:1px solid var(--fe-border-light);margin-bottom:12px}
/* Stock-info below autocomplete */
#spoil-stock-info{display:block;font-size:12px;color:var(--fe-muted);margin-top:4px}

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE — lp-* namespace (v6 simple)
   Single centered card, fully responsive.
   ═══════════════════════════════════════════════════════════════ */

.lp-root{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  min-height:100dvh;
  width:100%;
  height:auto;
  overflow-y:auto;
  padding:24px;
  box-sizing:border-box;
  background:linear-gradient(160deg,#042210 0%,#063a1e 55%,#0a4a20 100%);
  font-family:'Segoe UI',system-ui,-apple-system,sans-serif;
}
.lp-root [hidden]{display:none!important}

/* ── Overlay mode: login form floats above the (locked) dashboard/page ──
   The dashboard renders underneath, dimmed + blurred, so the user sees
   "the system" (dashboard) with the login form on top of it. */
.lp-root.lp-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(6,20,12,.55);
  backdrop-filter:blur(6px) saturate(85%);
  -webkit-backdrop-filter:blur(6px) saturate(85%);
}
/*
 * `overflow:hidden` on <body> alone does NOT reliably block touch-scroll
 * gestures on iOS Safari and many mobile/tablet browsers -- the locked
 * dashboard underneath the login overlay can still be finger-swiped into
 * view, exposing its frozen/half-loaded state (spinners, "..." placeholders)
 * below the fold. That is the real cause of the login page looking "messy"
 * on tablets/phones. Freezing <body> itself with position:fixed is the
 * standard cross-browser-safe scroll lock: it works even where overflow
 * alone fails, and html,body's own overflow:hidden is kept as a fallback
 * for browsers where fixed-body scroll can still leak through.
 */
html.pherp-locked, body.pherp-locked{overflow:hidden!important; height:100%!important}
body.pherp-locked{position:fixed!important; width:100%!important; top:0!important; left:0!important; right:0!important}
body.pherp-locked .fe-app{
  filter:blur(3px) saturate(70%) brightness(.94);
  pointer-events:none;
  user-select:none;
}
@media(prefers-reduced-motion:reduce){
  body.pherp-locked .fe-app{filter:blur(1.5px)}
}

.lp-card{
  width:100%;
  max-width:400px;
  max-height:100%;
  background:#fff;
  border-radius:16px;
  padding:40px 36px 32px;
  box-shadow:0 8px 40px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.04);
  animation:lp-slide-up .35s cubic-bezier(.22,1,.36,1) both;
  box-sizing:border-box;
  margin:auto;
}
@keyframes lp-slide-up{
  from{opacity:0;transform:translateY(20px)}
  to{opacity:1;transform:none}
}

.lp-header{
  text-align:center;
  margin-bottom:28px;
}
.lp-header__icon{
  font-size:44px;
  line-height:1;
  margin-bottom:12px;
  filter:drop-shadow(0 4px 12px rgba(13,148,136,.35));
}
.lp-header__title{
  font-size:clamp(18px,4vw,22px);
  font-weight:800;
  color:var(--fe-navy);
  margin:0 0 6px;
  letter-spacing:-.3px;
  line-height:1.25;
}
.lp-header__sub{
  font-size:13px;
  color:var(--fe-muted);
  margin:0;
  line-height:1.5;
}

/* alert */
.lp-alert{
  padding:11px 14px;
  border-radius:8px;
  font-size:13.5px;
  font-weight:500;
  margin-bottom:18px;
  border-left:4px solid transparent;
  display:flex;
  align-items:flex-start;
  gap:8px;
  line-height:1.4;
}
.lp-alert.lp-err{
  background:#fef2f2;
  color:#7f1d1d;
  border-color:#f87171;
}
.lp-alert.lp-ok{
  background:#f0fdf4;
  color:#14532d;
  border-color:#4ade80;
}

/* form fields */
.lp-form{
  display:flex;
  flex-direction:column;
  gap:0;
}
.lp-field{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin-bottom:18px;
}
.lp-label{
  font-size:11.5px;
  font-weight:700;
  color:var(--fe-text);
  text-transform:uppercase;
  letter-spacing:.07em;
}
.lp-req{color:var(--fe-red);margin-left:2px}

/* input */
.lp-input{
  width:100%;
  padding:11px 14px;
  border:1.5px solid var(--fe-border);
  border-radius:9px;
  font-size:14px;
  color:var(--fe-text);
  background:#fff;
  outline:none;
  font-family:inherit;
  transition:border-color .16s,box-shadow .16s,background .16s;
  box-sizing:border-box;
}
.lp-input:focus{
  border-color:#16a34a;
  box-shadow:0 0 0 3px rgba(22,163,74,.14);
  background:#f0fdf4;
}
.lp-input::placeholder{color:#b0bec5;font-size:13.5px}
.lp-input.lp-invalid{
  border-color:var(--fe-red);
  box-shadow:0 0 0 3px rgba(220,38,38,.11);
}

/* password eye */
.lp-pw-wrap{position:relative;display:flex;align-items:center}
.lp-pw-wrap .lp-input{padding-right:44px}
.lp-eye-btn{
  position:absolute;right:12px;
  top:50%;transform:translateY(-50%);
  background:none;border:none;
  cursor:pointer;color:var(--fe-muted);
  padding:4px;border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  transition:color .15s,background .15s;
}
.lp-eye-btn:hover{color:#16a34a;background:rgba(22,163,74,.08)}
.lp-eye-show,.lp-eye-hide{width:18px;height:18px}

/* field-level error */
.lp-field-err{
  font-size:12px;
  color:var(--fe-red);
  font-weight:500;
  line-height:1.4;
}

/* remember me */
.lp-remember{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  color:var(--fe-text-soft);
  cursor:pointer;
  user-select:none;
  margin-bottom:22px;
  line-height:1.4;
}
.lp-checkbox{
  width:17px;height:17px;
  accent-color:var(--fe-teal);
  cursor:pointer;flex-shrink:0;
  margin:0;
}
.lp-check-mark{display:none}

/* submit button */
.lp-submit-btn{
  width:100%;
  padding:13px 20px;
  background:linear-gradient(135deg,#16a34a 0%,#15803d 100%);
  color:#fff;
  border:none;
  border-radius:9px;
  font-size:15px;
  font-weight:700;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-family:inherit;
  letter-spacing:.01em;
  transition:opacity .18s,transform .15s,box-shadow .18s;
  box-shadow:0 4px 20px rgba(22,163,74,.35);
  margin-bottom:4px;
}
.lp-submit-btn:hover:not(:disabled){
  opacity:.92;
  transform:translateY(-1px);
  box-shadow:0 8px 28px rgba(22,163,74,.45);
}
.lp-submit-btn:active:not(:disabled){
  transform:translateY(0);
  box-shadow:0 2px 8px rgba(22,163,74,.3);
}
.lp-submit-btn:disabled{
  opacity:.5;cursor:not-allowed;transform:none;
}
.lp-submit-text{line-height:1}

/* spinner SVG */
.lp-submit-spinner{
  width:20px;height:20px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.lp-submit-spinner svg{
  width:20px;height:20px;
  animation:lp-spin .7s linear infinite;
}
@keyframes lp-spin{to{transform:rotate(360deg)}}

/* form footer */
.lp-footer{
  text-align:center;
  font-size:11.5px;
  color:var(--fe-muted);
  margin:20px 0 0;
  line-height:1.7;
}
.lp-footer strong{color:var(--fe-text-soft)}

/* ──────────────── RESPONSIVE ──────────────── */
@media(max-width:600px){
  .lp-root{padding:16px;align-items:flex-start}
  .lp-card{padding:28px 24px 20px;border-radius:12px;margin:16px auto}
  .lp-header{margin-bottom:20px}
  .lp-header__icon{font-size:36px;margin-bottom:8px}
  .lp-field{margin-bottom:14px}
  .lp-remember{margin-bottom:16px}
}
@media(max-width:360px){
  .lp-root{padding:10px}
  .lp-card{padding:20px 16px 16px}
  .lp-header{margin-bottom:16px}
  .lp-header__icon{font-size:30px;margin-bottom:6px}
  .lp-header__sub{font-size:12px}
  .lp-field{margin-bottom:12px}
  .lp-input{padding:9px 12px;font-size:13.5px}
  .lp-pw-wrap .lp-input{padding-right:40px}
  .lp-submit-btn{padding:11px 16px;font-size:14px}
  .lp-remember{margin-bottom:14px;font-size:12.5px}
  .lp-footer{margin-top:14px;font-size:11px}
}
/* Mini tablets in portrait (e.g. 7-8in, iPad mini-ish) — keep card modest, don't stretch full width */
@media(min-width:601px) and (max-width:820px){
  .lp-card{max-width:420px}
}
/* Short viewports (landscape phones, small tablets rotated) — the #1 "doesn't fit" case:
   shrink vertical rhythm so the whole card is visible without scrolling. */
@media(max-height:700px){
  .lp-root{align-items:flex-start;padding-top:16px;padding-bottom:16px}
  .lp-card{padding:22px 28px 18px}
  .lp-header{margin-bottom:14px}
  .lp-header__icon{font-size:28px;margin-bottom:4px}
  .lp-header__title{font-size:18px;margin-bottom:2px}
  .lp-header__sub{font-size:12px}
  .lp-field{margin-bottom:10px}
  .lp-input{padding:9px 12px}
  .lp-remember{margin-bottom:12px}
  .lp-footer{margin-top:10px}
}
@media(max-height:520px){
  .lp-card{padding:16px 22px 14px}
  .lp-header{margin-bottom:10px}
  .lp-header__icon{font-size:0;margin:0;height:0;overflow:hidden}
  .lp-header__title{font-size:16px}
  .lp-footer{display:none}
}

/* ERP media queries */
@media(max-width:768px){.fe-sidebar{width:var(--fe-sidebar-w-c)}.fe-sidebar-name,.fe-nav-label{display:none}.fe-main{margin-left:var(--fe-sidebar-w-c)}.fe-pos-layout{flex-direction:column}.fe-pos-payment-panel{width:100%}.fe-kpi-grid{grid-template-columns:1fr 1fr}.fe-form-grid{grid-template-columns:1fr}.form-grid-2{grid-template-columns:1fr}}
@media(max-width:480px){.fe-topbar{padding:0 12px}.fe-kpi-grid{grid-template-columns:1fr;padding:12px}.fe-card{margin:10px}}
@media print{.fe-sidebar,.fe-topbar,.fe-btn,.fe-modal-footer{display:none!important}.fe-main{margin-left:0!important}.fe-card{box-shadow:none;border:1px solid #ccc}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* ═══════════════════════════════════════════════════════════════
   ALFRED — floating AI assistant widget (present on every ERP page)
   ═══════════════════════════════════════════════════════════════ */
#alfred-widget{position:fixed;right:26px;bottom:26px;z-index:9500;font-family:'Segoe UI',system-ui,-apple-system,sans-serif}
#alfred-fab{
  width:58px;height:58px;border-radius:50%;border:none;cursor:pointer;
  background:linear-gradient(135deg,#0d9488 0%,#0b8078 100%);
  box-shadow:0 6px 24px rgba(13,148,136,.4);
  display:flex;align-items:center;justify-content:center;
  transition:transform .18s,box-shadow .18s;
}
#alfred-fab:hover{transform:translateY(-2px) scale(1.04);box-shadow:0 10px 30px rgba(13,148,136,.5)}
.alfred-fab-icon{font-size:28px;line-height:1}
#alfred-panel{
  position:absolute;right:0;bottom:74px;width:360px;max-width:calc(100vw - 40px);
  background:#fff;border-radius:14px;box-shadow:0 12px 48px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.04);
  display:flex;flex-direction:column;overflow:hidden;
  animation:alfred-in .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes alfred-in{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:none}}
#alfred-panel[hidden]{display:none!important}
.alfred-panel-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;background:linear-gradient(135deg,#0d9488,#0b1f38);color:#fff;
  font-weight:800;font-size:14px;
}
.alfred-panel-header small{font-weight:500;font-size:11px;opacity:.75;margin-left:6px}
#alfred-close-btn{background:rgba(255,255,255,.15);border:none;color:#fff;width:26px;height:26px;border-radius:50%;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center}
#alfred-close-btn:hover{background:rgba(255,255,255,.3)}
.alfred-messages{flex:1;max-height:360px;min-height:160px;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:10px;background:#f8fafc}
.alfred-msg{font-size:13px;line-height:1.55;padding:9px 13px;border-radius:12px;max-width:88%;white-space:pre-line}
.alfred-msg-assistant{background:#fff;color:#0f172a;align-self:flex-start;border:1px solid var(--fe-border-light);border-bottom-left-radius:3px}
.alfred-msg-user{background:var(--fe-teal);color:#fff;align-self:flex-end;border-bottom-right-radius:3px}
.alfred-msg-thinking{color:var(--fe-muted);font-style:italic}
.alfred-form{display:flex;gap:8px;padding:12px;border-top:1px solid var(--fe-border-light);background:#fff}
.alfred-form .fe-input{flex:1}
@media(max-width:480px){#alfred-widget{right:14px;bottom:14px}#alfred-panel{width:calc(100vw - 28px);right:-8px}}



/* ═══════════════════════════════════════════════════════════════
   PHARMACY ERP — CONFIRMED STANDALONE LOGIN PAGE
   Target: centered card / deep green background / compact loading state
   ═══════════════════════════════════════════════════════════════ */
.pherp-login-page{
  position:fixed;inset:0;z-index:2147483000;
  width:100vw;height:100vh;height:100dvh;min-height:100dvh;
  display:flex;align-items:center;justify-content:center;
  box-sizing:border-box;padding:24px 16px;overflow:auto;
  background:linear-gradient(135deg,#063b25 0%,#075b32 48%,#087342 100%);
  font-family:Segoe UI,system-ui,-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;
  color:#12251c;
  isolation:isolate;
}
.pherp-login-page *{box-sizing:border-box}
.pherp-login-card{
  width:min(100%,450px);
  background:#fff;border:1px solid rgba(255,255,255,.65);
  border-radius:18px;padding:30px 34px 27px;
  box-shadow:0 28px 70px rgba(0,0,0,.28);
}
.pherp-login-brand{display:flex;align-items:center;gap:12px;margin:0 0 28px}
.pherp-login-icon{
  position:relative;width:52px;height:52px;flex:0 0 52px;border-radius:14px;
  background:#087343;overflow:hidden;box-shadow:0 6px 16px rgba(8,115,67,.22)
}
.pherp-pill{position:absolute;width:12px;height:35px;border-radius:999px;transform:rotate(-45deg)}
.pherp-pill-a{left:15px;top:5px;background:#f8cf31}
.pherp-pill-b{left:25px;top:13px;background:#e31d4d}
.pherp-login-brand-name{font-size:19px;font-weight:800;line-height:1.15;color:#10241a;letter-spacing:-.02em}
.pherp-login-brand-sub{margin-top:4px;font-size:11px;color:#718078}
.pherp-login-heading h1{margin:0;color:#172b21;font-size:28px;font-weight:500;letter-spacing:-.035em;line-height:1.15}
.pherp-login-heading p{margin:7px 0 25px;color:#707d77;font-size:13px;line-height:1.45}
.pherp-login-form{display:flex;flex-direction:column;gap:15px}
.pherp-login-field label{display:block;margin:0 0 7px;font-size:12.5px;font-weight:700;color:#20342a}
.pherp-login-field input{
  display:block;width:100%;height:43px;padding:0 13px;
  border:1px solid #d6dfda;border-radius:9px;outline:none;
  background:#fff;color:#172a21;font-size:13.5px;
  box-shadow:inset 0 1px 2px rgba(0,0,0,.02);
  transition:border-color .15s,box-shadow .15s
}
.pherp-login-field input::placeholder{color:#a0aaa6}
.pherp-login-field input:focus{border-color:#0a8750;box-shadow:0 0 0 3px rgba(10,135,80,.10)}
.pherp-login-password{position:relative}
.pherp-login-password input{padding-right:47px}
.pherp-login-password button{
  position:absolute;right:4px;top:50%;transform:translateY(-50%);
  width:34px;height:34px;border:0;border-radius:7px;background:transparent;
  color:#68766f;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px
}
.pherp-login-password button:hover{background:#f1f5f3}
.pherp-login-remember{display:flex;align-items:center;gap:8px;margin:-1px 0 1px;font-size:12px;color:#66746e;cursor:pointer}
.pherp-login-remember input{width:16px;height:16px;margin:0;accent-color:#087343;cursor:pointer}
.pherp-login-submit{
  width:100%;height:45px;border:0;border-radius:9px;
  display:flex;align-items:center;justify-content:center;gap:9px;
  background:#087343;color:#fff;padding:0 16px;font-size:13.5px;font-weight:800;
  cursor:pointer;box-shadow:0 7px 15px rgba(8,115,67,.20);transition:background .15s,transform .1s
}
.pherp-login-submit:hover:not(:disabled){background:#076239;transform:translateY(-1px)}
.pherp-login-submit:disabled{opacity:.82;cursor:wait;transform:none}
.lp-submit-text{display:inline-flex;align-items:center;justify-content:center}
.lp-submit-spinner{
  display:inline-flex!important;align-items:center;justify-content:center;gap:9px;
  width:auto;margin:0;font-size:13px;font-weight:800;line-height:1;white-space:nowrap
}
.lp-submit-spinner[hidden]{display:none!important}
.lp-spinner-ring{
  width:20px;height:20px;display:inline-block;flex:0 0 20px;
  border:3px solid rgba(255,255,255,.40);border-top-color:#fff;border-radius:50%;
  animation:pherp-login-spin .75s linear infinite
}
@keyframes pherp-login-spin{to{transform:rotate(360deg)}}
.pherp-login-footer{text-align:center;margin-top:24px;color:#8a9691;font-size:10.5px;line-height:1.7}
.pherp-login-footer strong{font-weight:600;color:#65736d}
.lp-alert{padding:9px 11px;border-radius:8px;margin:-3px 0 1px;font-size:12px}
.lp-alert.lp-err{display:block;background:#fff0f0;color:#a32626;border:1px solid #f1caca}
.lp-alert.lp-ok{display:block;background:#effaf3;color:#176b3c;border:1px solid #ccebd7}
.lp-field-err{display:block;color:#b32929;font-size:10.5px;margin-top:5px}
.pherp-login-field input.lp-invalid{border-color:#d33}
@media(max-width:520px){
  .pherp-login-page{padding:16px 12px}
  .pherp-login-card{padding:26px 22px 22px;border-radius:16px}
  .pherp-login-brand{margin-bottom:24px}
  .pherp-login-heading h1{font-size:25px}
}

/* Lab result flags & panel tables */
.lab-flag{display:inline-block;min-width:20px;padding:1px 6px;border-radius:4px;font-size:11px;font-weight:700;text-align:center;line-height:1.5}
.lab-flag-h{background:#fee2e2;color:#991b1b}
.lab-flag-l{background:#dbeafe;color:#1e40af}
.lab-flag-a{background:#fef3c7;color:#92400e}
.lab-flag-n{background:#f1f5f9;color:#64748b}
.lab-panel-table{width:100%;border-collapse:collapse;font-size:13px}
.lab-panel-table th{font-size:11px;text-transform:uppercase;letter-spacing:.03em;color:#64748b;text-align:left;padding:4px 6px;border-bottom:1px solid #e2e8f0}
.lab-panel-table td{padding:4px 6px;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.lab-panel-table tr.lab-abn td{background:#fff7f7}
.lab-panel-table input.fe-input,.lab-panel-table select.fe-input{padding:4px 6px;font-size:13px;min-height:0}
.lab-changes{margin:0;padding-left:16px;font-size:12px}
.lab-changes li{margin:1px 0}
.lab-old{color:#94a3b8;text-decoration:line-through}

/* === Scan Services === */
.scan-lock-note{margin-bottom:10px;padding:8px 10px;background:#fff7e6;border:1px solid #f5d48a;border-radius:6px;font-size:13px}
.scan-rep-block{font-size:13px;line-height:1.55;color:#1e293b;white-space:normal}

/* ── Laboratory / Scan report cards ─────────────────────── */
.fe-diagnostic-cards{align-items:stretch}
.fe-report-card{flex:1;min-width:0;margin-top:0}
.fe-report-card .fe-card-header{gap:12px}
.fe-report-card-lab{border-top:3px solid #0ea5a0}
.fe-report-card-scan{border-top:3px solid #3b82f6}
.fe-report-card-link{font-size:11px;font-weight:700;color:var(--fe-teal);text-decoration:none;white-space:nowrap}
.fe-report-card-scan .fe-report-card-link{color:#2563eb}
.fe-report-card-link:hover{text-decoration:underline}
.fe-report-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0}
.fe-report-card-grid>div{padding:14px 16px;border-right:1px solid var(--fe-border-light);border-bottom:1px solid var(--fe-border-light)}
.fe-report-card-grid>div:nth-child(3n){border-right:0}
.fe-report-card-grid>div:nth-last-child(-n+3){border-bottom:0}
.fe-report-card-grid strong{display:block;font-size:19px;color:var(--fe-navy);line-height:1.2}
.fe-report-card-grid span{display:block;margin-top:4px;font-size:10px;color:var(--fe-muted);text-transform:uppercase;letter-spacing:.05em}
@media(max-width:900px){.fe-diagnostic-cards{flex-direction:column}.fe-report-card{width:auto!important}.fe-report-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.fe-report-card-grid>div:nth-child(3n){border-right:1px solid var(--fe-border-light)}.fe-report-card-grid>div:nth-child(2n){border-right:0}.fe-report-card-grid>div:nth-last-child(-n+3){border-bottom:1px solid var(--fe-border-light)}.fe-report-card-grid>div:nth-last-child(-n+2){border-bottom:0}}

/* Premium Lab / Scan report cards — 2.0.11 */
.fe-diagnostic-cards{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:stretch}
.fe-report-card{position:relative;overflow:hidden;border:1px solid #dbe5ee!important;border-top:0!important;border-radius:14px!important;background:#fff;box-shadow:0 8px 24px rgba(15,43,74,.07);transition:transform .18s ease,box-shadow .18s ease}
.fe-report-card:hover{transform:translateY(-2px);box-shadow:0 12px 30px rgba(15,43,74,.11)}
.fe-report-card:before{content:"";display:block;height:4px;background:linear-gradient(90deg,#0ea5a0,#14b8a6)}
.fe-report-card-scan:before{background:linear-gradient(90deg,#2563eb,#60a5fa)}
.fe-report-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 18px 14px}
.fe-report-card-title{display:flex;align-items:center;gap:11px;min-width:0}
.fe-report-card-title strong{display:block;color:#0f2b4a;font-size:15px;line-height:1.2}
.fe-report-card-title small{display:block;color:#7890a7;font-size:10px;margin-top:3px}
.fe-report-card-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:#e7f8f6;font-size:20px;flex:none}
.fe-report-card-scan .fe-report-card-icon{background:#eaf2ff}
.fe-report-card-link{padding:7px 10px;border:1px solid #cfe5e2;border-radius:8px;background:#f4fbfa;font-size:10px!important;font-weight:800!important;color:#087f7a!important;text-decoration:none!important}
.fe-report-card-scan .fe-report-card-link{border-color:#d5e3ff;background:#f4f7ff;color:#2563eb!important}
.fe-report-card-link:hover{background:#e8f7f5}
.fe-report-card-revenue{margin:0 18px 12px;padding:14px 16px;border-radius:11px;background:linear-gradient(135deg,#effaf8,#f8fffe);border:1px solid #d5eee9}
.fe-report-card-scan .fe-report-card-revenue{background:linear-gradient(135deg,#f1f6ff,#fbfdff);border-color:#dbe7fb}
.fe-report-card-revenue span{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.09em;font-weight:800;color:#628092}
.fe-report-card-revenue strong{display:block;margin-top:3px;font-size:25px;line-height:1.1;color:#087f7a;letter-spacing:-.02em}
.fe-report-card-scan .fe-report-card-revenue strong{color:#2563eb}
.fe-report-card-revenue small{display:block;margin-top:4px;color:#8aa0b2;font-size:9px}
.fe-report-card-grid{border-top:1px solid #edf2f6;grid-template-columns:repeat(4,minmax(0,1fr));}
.fe-report-card-grid>div{padding:12px 10px;border-right:1px solid #edf2f6;border-bottom:0!important;text-align:center}
.fe-report-card-grid>div:nth-child(4n){border-right:0}
.fe-report-card-grid strong{font-size:17px;color:#173b5d}
.fe-report-card-grid span{font-size:8px;letter-spacing:.06em}
@media(max-width:900px){.fe-diagnostic-cards{grid-template-columns:1fr!important}.fe-report-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.fe-report-card-grid>div:nth-child(4n){border-right:1px solid #edf2f6}.fe-report-card-grid>div:nth-child(3n){border-right:0}}
@media(max-width:520px){.fe-report-card-head{padding:14px}.fe-report-card-revenue{margin:0 14px 10px}.fe-report-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.fe-report-card-grid>div:nth-child(3n){border-right:1px solid #edf2f6}.fe-report-card-grid>div:nth-child(2n){border-right:0}}


/* === Diagnostic service report cards v2.0.12 === */
.fe-diagnostic-panel{position:relative;overflow:hidden;margin-bottom:18px;border:1px solid #d9e5ee;border-radius:16px;background:#fff;box-shadow:0 8px 28px rgba(15,43,74,.07)}
.fe-diagnostic-panel:before{content:"";display:block;height:5px;background:linear-gradient(90deg,#0b948e,#2dd4bf)}
.fe-diagnostic-panel-scan:before{background:linear-gradient(90deg,#2563eb,#60a5fa)}
.fe-diagnostic-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 20px 14px}
.fe-diagnostic-title{display:flex;align-items:center;gap:12px;min-width:0}
.fe-diagnostic-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:13px;background:#e8f8f6;font-size:24px;flex:none}
.fe-diagnostic-panel-scan .fe-diagnostic-icon{background:#eaf2ff}
.fe-diagnostic-title h3{margin:0;color:#102f4d;font-size:16px;line-height:1.25}
.fe-diagnostic-title p{margin:4px 0 0;color:#7890a7;font-size:11px}
.fe-diagnostic-actions{display:flex;align-items:center;gap:8px;flex:none}
.fe-live-dot{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:999px;background:#ecfdf5;color:#087f5b;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.fe-live-dot:before{content:"";width:6px;height:6px;border-radius:50%;background:#10b981}
.fe-diagnostic-revenue{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:0 20px 14px;padding:16px 18px;border:1px solid #cfeae5;border-radius:13px;background:linear-gradient(135deg,#effaf8 0%,#fbfffe 100%)}
.fe-diagnostic-panel-scan .fe-diagnostic-revenue{border-color:#d6e4fb;background:linear-gradient(135deg,#f1f6ff 0%,#fbfdff 100%)}
.fe-diagnostic-revenue span{display:block;color:#0f766e;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}
.fe-diagnostic-panel-scan .fe-diagnostic-revenue span{color:#2563eb}
.fe-diagnostic-revenue small{display:block;margin-top:4px;color:#7c92a5;font-size:10px}
.fe-diagnostic-revenue strong{color:#087f7a;font-size:28px;line-height:1;letter-spacing:-.03em;white-space:nowrap}
.fe-diagnostic-panel-scan .fe-diagnostic-revenue strong{color:#2563eb}
.fe-diagnostic-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));border-top:1px solid #edf2f6;border-bottom:1px solid #edf2f6}
.fe-diagnostic-metrics>div{padding:13px 12px;text-align:center;border-right:1px solid #edf2f6}
.fe-diagnostic-metrics>div:last-child{border-right:0}
.fe-diagnostic-metrics span{display:block;color:#71879a;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.055em}
.fe-diagnostic-metrics strong{display:block;margin-top:5px;color:#153b5d;font-size:19px;line-height:1.1}
.fe-diagnostic-metrics small{display:block;margin-top:4px;color:#9aabba;font-size:9px}
.fe-diagnostic-section-title{display:flex;justify-content:space-between;align-items:center;padding:14px 20px 8px;color:#173b5d;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.055em}
.fe-diagnostic-section-title span{color:#94a7b6;font-size:9px;font-weight:700;text-transform:none;letter-spacing:0}
.fe-diagnostic-table{padding:0 14px 14px}
.fe-diagnostic-table .fe-table-wrap{border:1px solid #edf2f6;border-radius:10px;overflow:hidden}
.fe-report-card-revenue strong{min-height:29px}
@media(max-width:900px){.fe-diagnostic-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.fe-diagnostic-metrics>div:nth-child(3n){border-right:0}.fe-diagnostic-metrics>div:nth-child(-n+3){border-bottom:1px solid #edf2f6}}
@media(max-width:620px){.fe-diagnostic-head{padding:15px}.fe-diagnostic-actions .fe-live-dot{display:none}.fe-diagnostic-revenue{margin:0 14px 12px;align-items:flex-start;flex-direction:column}.fe-diagnostic-revenue strong{font-size:25px}.fe-diagnostic-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.fe-diagnostic-metrics>div{border-bottom:1px solid #edf2f6!important}.fe-diagnostic-metrics>div:nth-child(2n){border-right:0}.fe-diagnostic-section-title{padding-left:14px;padding-right:14px}}

/* Report/Dashboard diagnostic cards: stronger revenue hierarchy and balanced metrics. */
.fe-report-card{min-height:100%;display:flex;flex-direction:column}
.fe-report-card-revenue{position:relative;overflow:hidden}
.fe-report-card-revenue:after{content:"";position:absolute;right:-20px;bottom:-30px;width:95px;height:95px;border-radius:50%;background:rgba(14,165,160,.07)}
.fe-report-card-scan .fe-report-card-revenue:after{background:rgba(37,99,235,.07)}
.fe-report-card-grid{margin-top:auto}
@media(max-width:900px){.fe-report-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:520px){.fe-report-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ============================================================
   PHERP 2.0.13 — Professional UI refinement layer
   ============================================================ */
.fe-app{--fe-focus:rgba(13,148,136,.18)}
.fe-main{background:linear-gradient(180deg,#f6f9fc 0,#f0f4f8 220px)}
.fe-topbar{backdrop-filter:saturate(140%) blur(10px);background:rgba(255,255,255,.94);box-shadow:0 1px 0 rgba(15,43,74,.05),0 6px 22px rgba(15,43,74,.05)}
.fe-page-title{font-size:18px;letter-spacing:-.35px}
.fe-branch-tag{padding:4px 9px;border-radius:999px;background:#eef7f6;color:#087f7a;font-size:11px;font-weight:700}
.fe-card{border-color:#e2e9f0;box-shadow:0 2px 10px rgba(15,43,74,.055),0 12px 30px rgba(15,43,74,.035);transition:box-shadow .18s ease,border-color .18s ease,transform .18s ease}
.fe-card:hover{border-color:#d7e2eb;box-shadow:0 5px 18px rgba(15,43,74,.08),0 16px 34px rgba(15,43,74,.04)}
.fe-card-header{min-height:52px;padding:14px 18px;background:linear-gradient(180deg,#fff,#f9fbfd);font-size:13px;letter-spacing:.01em}
.fe-kpi-grid{gap:14px;padding-top:20px}
/* Reports summary: keep all seven KPI cards on one desktop row. */
.fe-report-summary-kpis{grid-template-columns:repeat(7,minmax(0,1fr));gap:10px;padding-left:20px;padding-right:20px}
.fe-report-summary-kpis .fe-kpi-card{min-width:0;padding:15px 12px}
.fe-report-summary-kpis .fe-kpi-label{font-size:8.5px!important;letter-spacing:.055em!important;white-space:nowrap}
.fe-report-summary-kpis .fe-kpi-value{font-size:17px!important;letter-spacing:-.045em!important;white-space:nowrap}
@media(max-width:1050px) and (min-width:901px){.fe-report-summary-kpis{gap:8px;padding-left:16px;padding-right:16px}.fe-report-summary-kpis .fe-kpi-card{padding:14px 9px}.fe-report-summary-kpis .fe-kpi-value{font-size:15px!important}.fe-report-summary-kpis .fe-kpi-label{font-size:7.5px!important}}
.fe-kpi-card{position:relative;overflow:hidden;border-color:#e2e9f0;box-shadow:0 3px 14px rgba(15,43,74,.06);padding:18px 19px}
.fe-kpi-card:after{content:"";position:absolute;right:-22px;bottom:-28px;width:86px;height:86px;border-radius:50%;background:rgba(13,148,136,.055);pointer-events:none}
.fe-kpi-card:hover{transform:translateY(-3px);box-shadow:0 10px 26px rgba(15,43,74,.10)}
.fe-kpi-label{font-size:10px!important;font-weight:800!important;letter-spacing:.08em!important;text-transform:uppercase;color:#71849a!important}
.fe-kpi-value{font-size:25px!important;letter-spacing:-.04em;font-weight:800!important;color:#102d49!important;margin-top:7px}
.fe-sidebar{box-shadow:5px 0 24px rgba(5,18,35,.10);border-right:1px solid rgba(255,255,255,.06)}
.fe-sidebar-brand{border-bottom:1px solid rgba(255,255,255,.08)}
.fe-nav-list{padding:10px 9px;gap:3px}
.fe-nav-link{border-radius:9px;padding:10px 11px;transition:background .15s ease,color .15s ease,transform .15s ease}
.fe-nav-link:hover{transform:translateX(2px)}
.fe-nav-link.fe-active{box-shadow:inset 3px 0 0 #2dd4bf,0 4px 12px rgba(0,0,0,.10)}
.fe-nav-group-label{padding:14px 11px 5px;font-size:9px;letter-spacing:.12em;color:rgba(255,255,255,.42)}
.fe-btn{border-radius:8px;font-weight:700;letter-spacing:.01em;transition:all .16s ease}
.fe-btn:focus-visible,.fe-input:focus-visible,.fe-nav-link:focus-visible,.fe-notif-btn:focus-visible{outline:3px solid var(--fe-focus);outline-offset:2px}
.fe-input,.fe-select,.fe-textarea{border-color:#d7e1ea!important;background:#fff!important;box-shadow:0 1px 2px rgba(15,43,74,.025)}
.fe-input:hover,.fe-select:hover,.fe-textarea:hover{border-color:#bfcdd9!important}
.fe-table-wrap{border:1px solid #e3eaf1;border-radius:10px;background:#fff;overflow:auto;box-shadow:0 2px 8px rgba(15,43,74,.03)}
.fe-table{font-size:12.5px!important}
.fe-table th{background:#f6f9fc!important;color:#587089!important;font-size:10px!important;text-transform:uppercase;letter-spacing:.07em;border-bottom:1px solid #e1e8ef!important;white-space:nowrap}
.fe-table td{border-bottom:1px solid #edf1f5!important;color:#334e68}
.fe-table tbody tr:hover{background:#f8fbfd}
.fe-alert{border-radius:10px!important;box-shadow:0 2px 8px rgba(15,43,74,.04)}
.fe-tabs{background:#fff;border:1px solid #e1e8ef;border-radius:10px 10px 0 0;padding:4px 6px 0;box-shadow:0 2px 8px rgba(15,43,74,.03)}
.fe-tab-btn{border-radius:7px 7px 0 0!important;font-weight:700!important}
.fe-modal-overlay{backdrop-filter:blur(3px);background:rgba(8,24,42,.58)!important}
.fe-modal{border:1px solid rgba(255,255,255,.18);box-shadow:0 24px 70px rgba(5,18,35,.32)!important}
.fe-empty,.fe-loading-text{padding:28px 18px;text-align:center;color:#8193a5;font-size:12px}
.fe-diagnostic-cards{align-items:stretch}
.fe-diagnostic-cards>.fe-card{height:100%}
.fe-quick-actions{gap:8px!important;padding:14px!important}
.fe-qa-btn{border:1px solid #e0e8ef!important;border-radius:9px!important;background:#fbfcfe!important;transition:all .15s ease!important}
.fe-qa-btn:hover{background:#f0f8f7!important;border-color:#bfe2de!important;transform:translateY(-1px)}
@media(max-width:900px){.fe-topbar{padding:0 18px}.fe-card{margin-left:16px;margin-right:16px}.fe-kpi-grid{padding-left:16px;padding-right:16px}}
@media(max-width:600px){.fe-page-title{font-size:15px}.fe-username{display:none}.fe-topbar{height:58px}.fe-main{min-height:calc(100vh - 58px)}.fe-card{margin-top:14px;margin-left:12px;margin-right:12px}.fe-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px 12px 4px}.fe-kpi-card{padding:15px}.fe-kpi-value{font-size:21px!important}}
@media(prefers-reduced-motion:reduce){.fe-card,.fe-kpi-card,.fe-btn,.fe-nav-link{transition:none!important}}

/* ============================================================
   PHERP PROFESSIONAL UI LAYER v2.0.15
   Consistent enterprise surface across every module.
   ============================================================ */
.pherp-wrap { max-width: 1600px; margin: 0 auto; padding: 20px 24px 40px; }
.pherp-page-header { min-height: 72px; border: 1px solid rgba(255,255,255,.08); }
.pherp-page-header h1 { letter-spacing: -.25px; }
.pherp-page-header .pherp-header-actions .pherp-btn { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.pherp-card, .pherp-kpi-card { border: 1px solid rgba(15,43,74,.07); }
.pherp-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.pherp-card:hover { box-shadow: 0 8px 28px rgba(15,43,74,.12); border-color: rgba(10,173,173,.20); }
.pherp-card-header { min-height: 48px; }
.pherp-card-header h3 { letter-spacing: -.1px; }
.pherp-kpi-card { position:relative; overflow:hidden; }
.pherp-kpi-card:after { content:""; position:absolute; right:-24px; bottom:-30px; width:90px; height:90px; border-radius:50%; background:rgba(10,173,173,.045); pointer-events:none; }
.pherp-kpi-value { letter-spacing:-.5px; }
.pherp-table-wrap { overflow:auto; border:1px solid var(--erp-border); border-radius:10px; background:#fff; }
.pherp-table { min-width:640px; }
.pherp-table th { position:sticky; top:0; z-index:2; }
.pherp-table td { height:42px; }
.pherp-table tr:hover td { background:#f7fbfe; }
.pherp-btn { min-height:36px; box-shadow:0 1px 2px rgba(15,43,74,.05); }
.pherp-btn:focus-visible, .pherp-tab-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline:3px solid rgba(10,173,173,.22); outline-offset:1px; }
.pherp-form-group input,.pherp-form-group select,.pherp-form-group textarea { min-height:38px; box-sizing:border-box; }
.pherp-form-section-title { display:flex; align-items:center; gap:8px; }
.pherp-search-bar { background:#fff; padding:10px; border:1px solid var(--erp-border); border-radius:10px; box-shadow:0 2px 8px rgba(15,43,74,.05); }
.pherp-alert { border:1px solid rgba(15,43,74,.05); }
.pherp-tabs { background:#fff; border:1px solid var(--erp-border); border-radius:10px 10px 0 0; padding:0 8px; }
.pherp-tab-btn { min-height:44px; }
.pherp-modal { border:1px solid rgba(15,43,74,.12); }
@media (max-width:782px) {
  .pherp-wrap { padding:14px 12px 28px; }
  .pherp-page-header { flex-direction:column; align-items:flex-start; gap:14px; padding:18px; }
  .pherp-page-header .pherp-header-actions { width:100%; flex-wrap:wrap; }
  .pherp-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .pherp-kpi-card { padding:15px; }
  .pherp-kpi-value { font-size:22px; }
  .pherp-card-body { padding:15px; }
}
@media (max-width:480px) { .pherp-kpi-grid { grid-template-columns:1fr; } .pherp-btn { width:auto; } }
@media (prefers-reduced-motion:reduce) { *,*:before,*:after { transition:none !important; scroll-behavior:auto !important; } }

/* ── Global ERP shell normalization ───────────────────────── */
/* The WordPress/theme stylesheet may apply a large top margin to <main>.
 * ERP module pages all use .fe-main, so that theme spacing must never push
 * the actual application below an empty vertical region. Presentation only. */
body.pherp-erp-shell main.fe-main,
body.pherp-erp-shell .fe-main{
  margin-top:0!important;
  margin-block-start:0!important;
  padding-top:0!important;
}

/* Procurement polish v4.7.54 — financial values remain visually distinct from operational status. */
.proc-summary{padding:0 0 14px!important;grid-template-columns:repeat(3,minmax(0,1fr));}
.proc-summary .fe-kpi-card{margin:0!important;min-height:92px;}
.proc-tax-note{font-size:10px;color:#7a8b9a;margin-top:3px;white-space:nowrap;}
@media(max-width:720px){.proc-summary{grid-template-columns:1fr 1fr;} .proc-summary .fe-kpi-card:last-child{grid-column:1/-1;}}
@media(max-width:480px){.proc-summary{grid-template-columns:1fr;} .proc-summary .fe-kpi-card:last-child{grid-column:auto;}}

/* Dashboard quick-action refinement — existing workflows only. */
.fe-dashboard-actions-card{flex:1!important;width:auto!important;min-width:320px}
.fe-section-hint{font-size:10px;color:#8a9bad;font-weight:600;text-transform:uppercase;letter-spacing:.06em}
.fe-dashboard-actions-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important}
.fe-dashboard-actions-grid .fe-qa-btn{min-height:40px;display:flex;align-items:center;justify-content:flex-start;padding:9px 11px!important;box-sizing:border-box}
.fe-dashboard-actions-grid .fe-qa-primary{border-color:#b9ded9!important;background:#f0faf8!important;font-weight:800!important}
@media(max-width:900px){.fe-dashboard-actions-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.fe-dashboard-actions-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.fe-section-hint{display:none}}
@media(max-width:390px){.fe-dashboard-actions-grid{grid-template-columns:1fr}}

/* ── Enhanced Notifications & Alfred controls ───────────────────────── */
.fe-notif-dropdown-head{padding:11px 12px 8px}
.fe-notif-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.fe-notif-title-row strong{font-size:13px;color:var(--fe-navy)}
.fe-notif-updated{display:block;margin-top:2px;font-size:10px;color:var(--fe-muted);font-weight:500}
.fe-notif-refresh{width:28px;height:28px;border:1px solid var(--fe-border-light);border-radius:7px;background:#fff;color:var(--fe-teal);cursor:pointer;font-size:17px}
.fe-notif-refresh:hover{background:var(--fe-teal-pale)}
.fe-notif-summary{display:flex;gap:8px;align-items:center;margin:8px 0 7px;font-size:10px;color:var(--fe-muted)}
.fe-notif-summary-danger{color:var(--fe-red);font-weight:700}
.fe-notif-summary-warn{color:#b45309;font-weight:700}
.fe-notif-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px}
.fe-notif-filters{display:flex;gap:3px;overflow:auto}
.fe-notif-filter{border:0;background:transparent;border-radius:6px;padding:5px 7px;color:var(--fe-muted);font-size:10px;font-weight:700;cursor:pointer;white-space:nowrap}
.fe-notif-filter:hover,.fe-notif-filter.is-active{background:var(--fe-teal-pale);color:var(--fe-teal)}
.fe-notif-clear{border:0;background:transparent;color:var(--fe-teal);font-size:10px;font-weight:800;cursor:pointer;white-space:nowrap}
.fe-notif-clear:disabled{opacity:.4;cursor:default}
.fe-notif-item{padding:10px 10px 10px 12px;gap:7px}
.fe-notif-main{display:flex;align-items:flex-start;gap:9px;min-width:0;flex:1;text-decoration:none;color:inherit}
.fe-notif-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.fe-notif-text strong{font-size:9px;text-transform:uppercase;letter-spacing:.05em;color:var(--fe-muted)}
.fe-notif-text>span{display:block}
.fe-notif-dismiss{width:24px;height:24px;flex:0 0 24px;border:0;border-radius:6px;background:transparent;color:#94a3b8;cursor:pointer}
.fe-notif-dismiss:hover{background:#ecfdf5;color:var(--fe-teal)}
.fe-notif-error button{border:0;background:var(--fe-teal);color:#fff;border-radius:6px;padding:5px 8px;cursor:pointer}
.fe-notif-count{transition:transform .18s}
.fe-notif-btn:focus-visible,.fe-notif-filter:focus-visible,.fe-notif-clear:focus-visible,.fe-notif-dismiss:focus-visible,.fe-notif-refresh:focus-visible{outline:2px solid var(--fe-teal);outline-offset:2px}

/* Alfred */
#alfred-fab{position:relative}
.alfred-fab-pulse{position:absolute;right:7px;bottom:7px;width:8px;height:8px;border-radius:50%;background:#22c55e;border:2px solid #fff}
.alfred-panel-header{padding:11px 12px}
.alfred-brand{display:flex;align-items:center;gap:8px;min-width:0}
.alfred-brand-icon{font-size:22px}
.alfred-brand strong{display:block;font-size:14px;line-height:1.1}
.alfred-brand small{display:block;font-size:9px;opacity:.72;font-weight:500;margin-top:2px}
.alfred-brand em{font-style:normal;font-size:9px;font-weight:800;color:#bbf7d0;background:rgba(34,197,94,.16);padding:3px 6px;border-radius:10px;margin-left:4px}
.alfred-header-actions{display:flex;gap:3px}
.alfred-header-actions button{width:27px;height:27px;border:0;border-radius:7px;background:rgba(255,255,255,.12);color:#fff;cursor:pointer}
.alfred-header-actions button:hover{background:rgba(255,255,255,.25)}
.alfred-tools{display:flex;gap:5px;padding:8px 10px;border-bottom:1px solid var(--fe-border-light);background:#fff;overflow:auto;white-space:nowrap;scrollbar-width:thin}
.alfred-tools>span{font-size:9px;color:var(--fe-muted);font-weight:800;align-self:center;margin-right:2px}
.alfred-quick{border:1px solid var(--fe-border-light);background:#f8fafc;color:#334155;border-radius:14px;padding:5px 8px;font-size:9px;font-weight:700;cursor:pointer}
.alfred-quick:hover,.alfred-quick.is-selected{border-color:var(--fe-teal);background:var(--fe-teal-pale);color:var(--fe-teal)}
.alfred-welcome{margin:auto;max-width:250px;text-align:center;color:#64748b;display:flex;flex-direction:column;gap:6px;padding:20px}
.alfred-welcome-icon{font-size:32px}
.alfred-welcome strong{color:#0f172a;font-size:14px}
.alfred-welcome span{font-size:11px;line-height:1.5}
.alfred-msg{position:relative}
.alfred-msg-body{white-space:pre-line}
.alfred-msg-actions{display:flex;justify-content:flex-end;margin-top:4px}
.alfred-copy{border:0;background:transparent;color:#64748b;font-size:9px;padding:2px 4px;cursor:pointer}
.alfred-copy:hover{color:var(--fe-teal)}
.alfred-msg-error{border-color:#fecaca!important;background:#fff7f7!important}
.alfred-retry{border:0;background:var(--fe-teal);color:#fff;border-radius:6px;padding:5px 8px;font-size:10px;margin-top:7px;cursor:pointer}
.alfred-dots{display:inline-flex;gap:3px;vertical-align:middle}
.alfred-dots i{width:5px;height:5px;border-radius:50%;background:#94a3b8;animation:alfred-dot 1s infinite}
.alfred-dots i:nth-child(2){animation-delay:.15s}.alfred-dots i:nth-child(3){animation-delay:.3s}
@keyframes alfred-dot{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-2px)}}
#alfred-send-btn.is-loading{opacity:.65}
.alfred-footer-hint{text-align:center;padding:5px 8px;color:#94a3b8;background:#fff;border-top:1px solid var(--fe-border-light);font-size:9px}
@media(max-width:480px){
  #alfred-panel{max-height:calc(100vh - 100px)}
  .alfred-messages{max-height:calc(100vh - 300px)}
}

/* === Customer / Supplier account view + statement (4.7.93) === */
.fe-modal.acct-box{max-width:1020px;width:96vw}
.acct-info{font-size:12px;color:#64748b;margin:0 0 10px}
.acct-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:10px}
.acct-kpi{border:1px solid #e2e8f0;border-radius:8px;padding:10px 12px;background:#fff}
.acct-kpi-l{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#64748b}
.acct-kpi-v{font-size:20px;font-weight:700;margin:2px 0}
.acct-kpi-m{font-size:11px;color:#94a3b8}
.acct-bad{color:#b91c1c}.acct-ok{color:#15803d}
.acct-aging{display:flex;flex-wrap:wrap;gap:0;border:1px solid #e2e8f0;border-radius:8px;overflow:hidden;margin-bottom:12px;background:#f8fafc}
.acct-aging span{flex:1 1 130px;padding:8px 12px;font-size:13px;border-right:1px solid #e2e8f0}
.acct-aging span:last-child{border-right:0}
.acct-aging b{display:block;font-size:11px;color:#64748b;font-weight:600;margin-bottom:2px}
.acct-tabs{display:flex;gap:4px;border-bottom:1px solid #e2e8f0;margin-bottom:10px;flex-wrap:wrap}
.acct-tab{background:none;border:0;border-bottom:3px solid transparent;padding:8px 14px;font-size:13px;font-weight:600;color:#64748b;cursor:pointer}
.acct-tab-on{color:#0f766e;border-bottom-color:#0f766e}
.acct-filter{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:8px;font-size:13px}
.acct-filter label{display:flex;gap:6px;align-items:center}
.acct-scroll{max-height:380px;overflow:auto}
.acct-row-sum td{background:#f7fafd}
.acct-pay{border:1px solid #bbf7d0;background:#f0fdf4;border-radius:8px;padding:10px 12px;margin-bottom:12px}
.acct-pay-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-top:8px}
.acct-pay-row label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:#475569}
a.pat-account-link,a.supplier-account-link{color:inherit;text-decoration:none;border-bottom:1px dotted #94a3b8}
a.pat-account-link:hover,a.supplier-account-link:hover{color:#0f766e}
