/* FB & KA DESIGN SYSTEM • SME POS & COMPLIANCE EXTENSION */

.pos-tender-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.pos-calc-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-xs); }
.pos-num-display { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--text-main); background: var(--bg-subtle); padding: 10px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pos-chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-chip { border: 1px solid var(--border); background: var(--bg-card); color: var(--text-main); padding: 7px 12px; border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--text-sec); cursor: pointer; transition: 0.15s; user-select: none; }
.pos-chip:hover { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary); transform: translateY(-1px); }
.pos-chip:active { transform: scale(0.96); }
.pos-chip.preset { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }
.pos-diff-tag { display: inline-flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius-md); font-weight: 700; font-size: 14px; }
.pos-diff-tag.surplus { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.pos-diff-tag.shortage { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* HYBRID SPLIT PAYMENT MATRIX */
.split-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.split-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; }
.split-item label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 5px; }
.split-item input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-family: var(--font-mono); font-size: 12.5px; outline: none; background: #fafafa; }
.split-item input:focus { border-color: var(--primary); background: #fff; }
.split-status { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius-md); font-size: 12.5px; font-weight: 600; background: var(--bg-card); border: 1px solid var(--border); }
.split-status.matched { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.split-status.unmatched { background: #fffbeb; color: #d97706; border-color: #fde68a; }

/* ZERO-TYPO & AMBER WARNING */
.zero-typo-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.zero-typo-words { font-size: 12.5px; font-style: italic; color: var(--primary); font-weight: 500; min-height: 18px; }
.amber-warning { display: none; background: #fffbeb; border: 1px solid #fde68a; color: #b45309; padding: 10px 12px; border-radius: var(--radius-md); font-size: 12px; align-items: center; gap: 8px; }
.amber-warning.active { display: flex; }

/* 44PX ADAPTIVE TOUCH POINTER SIMULATION */
.touch-simulate .fb-btn-primary, .touch-simulate .fb-btn-secondary, .touch-simulate .fb-btn-destructive, .touch-simulate .pos-chip { min-height: 44px!important; padding: 0 18px!important; font-size: 14px!important; }

/* LINEAR-STYLE 2-TAP DESTRUCTIVE & 5-SEC UNDO TOAST */
.btn-arm-delete { transition: all 0.2s; position: relative; }
.btn-arm-delete.armed { background: #dc2626!important; color: #fff!important; animation: pulseArmed 1s infinite; }
@keyframes pulseArmed { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.undo-toast { position: fixed; bottom: 24px; right: 24px; z-index: 99999; background: #0f172a; color: #fff; padding: 12px 18px; border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(0,0,0,0.25); display: flex; align-items: center; gap: 14px; font-size: 13px; transform: translateY(120px); opacity: 0; transition: all 0.3s cubic-bezier(0.16,1,0.3,1); }
.undo-toast.show { transform: translateY(0); opacity: 1; }
.undo-btn { background: #2563eb; color: #fff; border: none; padding: 5px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.15s; }
.undo-btn:hover { background: #1d4ed8; }
.undo-bar { position: absolute; bottom: 0; left: 0; height: 3px; background: #38bdf8; border-radius: 0 0 0 var(--radius-lg); width: 100%; }

/* SECTION 10: TAX COMPLIANCE & PRIVACY */

.dual-ledger-strip { display: flex; align-items: center; justify-content: space-between; background: var(--bg-subtle); padding: 4px; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 14px; }
.dual-ledger-tabs { display: flex; gap: 4px; }
.dual-ledger-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius-md); border: none; background: transparent; font-size: 13px; font-weight: 500; color: var(--text-sec); cursor: pointer; transition: 0.15s; }
.dual-ledger-btn.active.mgmt { background: var(--bg-card); color: var(--primary); font-weight: 600; box-shadow: var(--shadow-xs); }
.dual-ledger-btn.active.tax { background: #059669; color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(5,150,105,0.25); }
.tax-active-border { border-left: 4px solid #059669!important; background: #f0fdf4!important; }

/* 6 STATUTORY E-INVOICE LIFECYCLE BADGES */
.einvoice-badges-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.einvoice-badge-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; transition: 0.15s; }
.einvoice-badge-card:hover { transform: translateY(-1px); border-color: #cbd5e1; }
.einvoice-badge-card .title { font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }

/* MST LOOKUP AUTO-HELPER */
.mst-lookup-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.mst-result { background: var(--bg-subtle); color: var(--text-main); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; font-size: 12.5px; line-height: 1.5; }

/* PII REDACTION SHIELD NĐ 13/2023 */
.pii-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 14px; }
.pii-masked { font-family: var(--font-mono); letter-spacing: 2px; font-weight: 600; color: var(--text-sec); }
.pii-revealed { font-family: var(--font-mono); letter-spacing: 0.5px; font-weight: 600; color: var(--primary); }

/* ID WATERMARK STAMPING CANVAS */
.watermark-frame { position: relative; width: 100%; max-width: 380px; height: 160px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: #e2e8f0; }
.watermark-canvas { width: 100%; height: 100%; display: block; }

/* TOPBAR ACTION ICON SUITE & USER PILL */
.topbar-actions-suite { display: flex; align-items: center; gap: 6px; }
.topbar-badge-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.topbar-user-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.15s; margin-left: 6px; }
.topbar-user-pill:hover { background: var(--bg-subtle); border-color: var(--border-subtle); }
.user-avatar { width: 24px; height: 24px; border-radius: 50%; background: #eff6ff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.user-role-badge { font-size: 10px; background: #fef3c7; color: #b45309; padding: 1px 6px; border-radius: var(--radius-pill); font-weight: 700; }

/* COLLAPSIBLE SIDEBAR & GROUPS */
.layout-grid { transition: grid-template-columns 0.25s ease; }
.layout-grid.sidebar-collapsed { grid-template-columns: 48px 1fr!important; gap: 14px!important; }
.side-menu-inner { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.side-menu-inner::-webkit-scrollbar { width: 4px; }
.side-menu-inner::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.side-menu.collapsed { width: 52px!important; padding: 0!important; overflow: visible!important; }
.side-menu.collapsed .sidebar-brand-badge { width: 24px!important; height: 24px!important; font-size: 10px!important; margin: 0 auto!important; }
.side-menu.collapsed .sidebar-edge-toggle { width: 20px!important; height: 20px!important; right: -10px!important; font-size: 9px!important; }
.side-menu.collapsed .side-menu-inner { overflow-x: hidden!important; scrollbar-width: none; }
.side-menu.collapsed .side-menu-inner::-webkit-scrollbar { display: none; }
.side-menu.collapsed .side-group-header, .side-menu.collapsed .side-group-title { display: none!important; }
.side-menu.collapsed .side-group { margin-bottom: 4px; border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.side-menu.collapsed .side-group:last-child { border-bottom: none; }
.side-menu.collapsed .side-link { display: flex!important; justify-content: center!important; align-items: center!important; width: 36px!important; height: 36px!important; padding: 0!important; margin: 2px auto!important; border-radius: var(--radius-md)!important; font-size: 14px!important; }
.side-menu.collapsed .side-link span { display: none!important; }
.side-menu.collapsed .side-group.collapsed .side-link { display: flex!important; }

/* REAL INTERACTIVE MODAL DIALOG */
.fb-modal-backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(15,23,42,0.45); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity 0.2s ease; }
.fb-modal-backdrop.active { display: flex; opacity: 1; }
.fb-modal-card { background: var(--bg-card); border-radius: var(--radius-lg); width: 100%; max-width: 480px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); border: 1px solid var(--border); overflow: hidden; transform: scale(0.95); transition: transform 0.2s ease; }
.fb-modal-backdrop.active .fb-modal-card { transform: scale(1); }
.fb-modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.fb-modal-title { font-size: 14.5px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.fb-modal-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.fb-modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg-subtle); display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

/* REAL INTERACTIVE DROPZONE & FILE UPLOAD */
.fb-dropzone.dragover { border-color: var(--primary)!important; background: var(--primary-subtle)!important; transform: scale(1.01); }
.dropzone-file-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.dropzone-progress-wrap { width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.dropzone-progress-bar { height: 100%; width: 0%; background: var(--primary); transition: width 0.3s ease; }

/* LIVE 6-STATE INTERACTIVE TESTER */
.state-tester-box { background: #f8fafc; border: 1px solid #bfdbfe; border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.state-btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.state-indicator-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); font-family: var(--font-mono); }
body.dark-theme { background: #0f172a!important; color: #f8fafc!important; }
body.dark-theme .sec-title, body.dark-theme .brand-title { color: #f8fafc!important; }

/* ========================================================================== */
/* EXPANSIONS: BREADCRUMBS, STEPPERS, EMPTY STATE, ERROR STATE & KBD SHORTCUTS*/
/* ========================================================================== */
.fb-breadcrumbs-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.crumb-link, .crumb-current {
  color: #94a3b8;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}
.crumb-link:hover { color: var(--primary); }
.crumb-sep { color: #cbd5e1; font-size: 8px; margin: 0 4px; }

/* STEPPER WIZARD */
.fb-stepper-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}
.fb-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.stepper-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}
.stepper-step.active {
  color: var(--primary);
  font-weight: 700;
}
.stepper-step.done {
  color: var(--success);
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.stepper-step.active .step-num {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}
.stepper-step.done .step-num {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.stepper-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 10px;
  transition: background 0.3s;
}
.stepper-line.done {
  background: var(--success);
}
.stepper-content-card {
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-sec);
  margin-bottom: 12px;
}
.stepper-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* EMPTY STATE */
.fb-empty-state-card {
  text-align: center;
  padding: 28px 16px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin-top: 10px;
}
.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
}
.empty-state-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.empty-state-desc {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 14px auto;
  line-height: 1.5;
}

/* KEYBOARD SHORTCUTS */
.fb-kbd-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.fb-kbd-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-sec);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}
.fb-kbd-item kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* ========================================================================== */
/* TOPBAR MODERN ICON-ONLY & ACCORDION MENU STYLES                           */
/* ========================================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  box-sizing: border-box;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 900;
}
.topbar-left-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar-right-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-icon-btn {
  color: var(--primary)!important;
  font-size: 15px!important;
  font-weight: 700;
}
.user-avatar-btn {
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}
.avatar-circle {
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

.side-group{margin-bottom:6px;}
.side-group-items{display:flex;flex-direction:column;gap:2px;}
.side-link{width:100%;}
.side-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.side-group-header:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}
.group-toggle-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}
.side-group.collapsed .group-toggle-arrow {
  transform: rotate(-90deg);
}
.side-group.collapsed .side-link {
  display: none;
}

/* RIGHT MENU DRAWER */
.right-menu-panel {
  position: fixed;
  top: 56px;
  right: -320px;
  width: 300px;
  height: calc(100vh - 56px);
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.06);
  z-index: 950;
  transition: right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
}
.right-menu-panel.open {
  right: 0;
}
.right-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-main);
}
.accordion-group {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-subtle);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.accordion-header:hover { background: #e2e8f0; }
.accordion-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}
.accordion-group.collapsed .accordion-arrow {
  transform: rotate(-90deg);
}
.accordion-body {
  padding: 8px 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.accordion-group.collapsed .accordion-body {
  display: none;
}
.accordion-item-link {
  color: var(--text-sec);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  transition: color 0.15s;
}
.accordion-item-link:hover { color: var(--primary); }

.right-menu-panel{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent;}
.right-menu-panel::-webkit-scrollbar{width:5px;}
.right-menu-panel::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px;}
.right-menu-panel::-webkit-scrollbar-thumb:hover{background:#94a3b8;}
