/* ====== Modal + toast + dropdown styles ====== */
.wf-mask {
  position: fixed; inset: 0; background: rgba(10,10,10,0.55);
  z-index: 50; display: none; align-items: flex-start; justify-content: center;
  padding: 8vh 20px 20px;
  overflow-y: auto;
}
.wf-mask.open { display: flex; }
.wf-modal {
  width: min(640px, 100%);
  background: #fff; border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  border: 1px solid var(--wf-line);
  overflow: hidden;
  animation: wfPop 160ms ease-out;
}
.wf-modal.lg { width: min(840px, 100%); }
@keyframes wfPop { from{transform:translateY(12px);opacity:0} to{transform:none;opacity:1} }
.wf-mh {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--wf-line);
  background: #FAFAFB;
}
.wf-mh h2 {
  font-family: "Bebas Neue", sans-serif; font-weight: 400;
  font-size: 24px; letter-spacing: 0.02em; text-transform: uppercase;
  margin: 0;
}
.wf-mh .sub { font-size: 11px; color: var(--wf-ink-3); margin-top: 2px; }
.wf-mx {
  background: transparent; border: 0; color: var(--wf-ink-3);
  width: 28px; height: 28px; border-radius: 4px; font-size: 16px;
}
.wf-mx:hover { background: var(--wf-line-soft); color: var(--wf-ink); }
.wf-mb { padding: 18px; }
.wf-mf {
  padding: 12px 18px; border-top: 1px solid var(--wf-line);
  display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  background: #FAFAFB;
}
.wf-mf .sp { flex: 1; font-size: 11px; color: var(--wf-ink-3); }

/* Form bits */
.wf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.wf-row.single { grid-template-columns: 1fr; }
.wf-field label {
  display: block;
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--wf-ink-3);
  margin-bottom: 4px;
}
.wf-field input, .wf-field select, .wf-field textarea {
  width: 100%;
  border: 1px solid var(--wf-line); border-radius: 4px;
  padding: 8px 10px;
  font-family: inherit; font-size: 13px;
  background: #fff;
  outline: none;
}
.wf-field input:focus, .wf-field select:focus, .wf-field textarea:focus {
  border-color: var(--wf-accent);
}
.wf-field textarea { resize: vertical; min-height: 72px; }
.wf-field .hint { font-size: 11px; color: var(--wf-ink-3); margin-top: 4px; }

.wf-steps { display: flex; gap: 0; margin-bottom: 16px; }
.wf-step {
  flex: 1; text-align: center;
  padding: 8px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wf-ink-4);
  border-bottom: 2px solid var(--wf-line);
  position: relative;
}
.wf-step.active { color: var(--wf-accent); border-bottom-color: var(--wf-accent); }
.wf-step.done { color: var(--wf-success); border-bottom-color: var(--wf-success); }
.wf-step .n {
  display: inline-flex; width: 16px; height: 16px; border-radius: 999px;
  align-items: center; justify-content: center;
  background: var(--wf-line-soft); color: var(--wf-ink-3);
  font-size: 9.5px; margin-right: 5px;
}
.wf-step.active .n { background: var(--wf-accent); color: #fff; }
.wf-step.done .n { background: var(--wf-success); color: #fff; }

/* Line-item table (used in New Order) */
.wf-items { border: 1px solid var(--wf-line); border-radius: 4px; overflow: hidden; }
.wf-items table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wf-items th {
  text-align: left; background: #FAFAFB;
  padding: 8px 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--wf-ink-3);
  border-bottom: 1px solid var(--wf-line);
}
.wf-items td { padding: 8px 10px; border-bottom: 1px solid var(--wf-line-soft); }
.wf-items tr:last-child td { border-bottom: 0; }
.wf-items td .mini { border: 1px solid var(--wf-line); border-radius: 3px; padding: 4px 6px; font-size: 12px; width: 60px; text-align: right; }
.wf-add-row { padding: 8px 10px; background: #FAFAFB; border-top: 1px solid var(--wf-line); font-size: 11px; color: var(--wf-accent); cursor: pointer; font-weight: 700; }
.wf-add-row:hover { background: var(--wf-accent-soft); }

.wf-total-row {
  display: flex; justify-content: space-between;
  padding: 6px 10px; font-size: 12px;
}
.wf-total-row.grand {
  border-top: 1px solid var(--wf-line);
  margin-top: 6px; padding-top: 10px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 22px; letter-spacing: 0.02em;
}

/* Dropdown menu */
.wf-menu {
  position: absolute; z-index: 40;
  background: #fff; border: 1px solid var(--wf-line);
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.15);
  min-width: 180px; padding: 4px 0;
  display: none;
  animation: wfPop 120ms ease-out;
}
.wf-menu.open { display: block; }
.wf-menu .mi {
  padding: 7px 14px; font-size: 12px;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  color: var(--wf-ink);
}
.wf-menu .mi:hover { background: var(--wf-bg); }
.wf-menu .mi.danger { color: var(--wf-danger); }
.wf-menu .mi.check::before { content: "✓"; color: var(--wf-accent); width: 14px; }
.wf-menu .mi.nocheck::before { content: ""; width: 14px; }
.wf-menu .sep { height: 1px; background: var(--wf-line-soft); margin: 4px 0; }
.wf-menu .hd {
  padding: 6px 14px; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--wf-ink-4);
}

/* Toast */
.wf-toast-wrap {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.wf-toast {
  background: #0A0A0A; color: #fff;
  padding: 10px 14px; border-radius: 4px;
  font-size: 12.5px; font-weight: 500;
  box-shadow: 0 14px 30px rgba(0,0,0,0.25);
  border-left: 3px solid var(--wf-accent);
  display: flex; align-items: center; gap: 10px;
  animation: wfToastIn 200ms ease-out;
  pointer-events: auto;
  max-width: 420px;
}
.wf-toast.success { border-left-color: var(--wf-success); }
.wf-toast.warn { border-left-color: var(--wf-warn); }
.wf-toast.danger { border-left-color: var(--wf-danger); }
.wf-toast b { font-weight: 700; }
.wf-toast .tx-sub { color: #B8B8BE; font-size: 11px; margin-top: 2px; }
.wf-toast.leave { animation: wfToastOut 200ms forwards; }
@keyframes wfToastIn { from{transform:translateY(14px);opacity:0} to{transform:none;opacity:1} }
@keyframes wfToastOut { from{opacity:1} to{transform:translateY(14px);opacity:0} }

/* Drawer (right-side detail panel) */
.wf-drawer-mask {
  position: fixed; inset: 0; background: rgba(10,10,10,0.4);
  z-index: 45; display: none;
}
.wf-drawer-mask.open { display: block; }
.wf-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: #fff; border-left: 1px solid var(--wf-line);
  z-index: 46;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.2,0.7,0.2,1);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 40px rgba(0,0,0,0.2);
}
.wf-drawer.open { transform: translateX(0); }
.wf-drawer .wf-mh { background: #fff; }
.wf-drawer .wf-mb { flex: 1; overflow-y: auto; }

/* Inline chip toggle for dropdown date ranges */
.btn.dropdown::after { content: "▾"; font-size: 9px; margin-left: 4px; opacity: 0.6; }

/* Active chip styling tweak — already in admin.css but ensuring */
.chip { cursor: pointer; user-select: none; }
.chip:hover:not(.active) { background: var(--wf-line-soft); }
