/**
 * ENTERPRISE APP SHELL & HYBRID DUAL-MODE STYLES
 * SPEC-UIUX-VNACCOUNTING-MASTER-ALL-IN-ONE-2026
 *
 * Primary: Deep Cobalt Blue #1E40AF
 * Accent: Modern Indigo #6366F1
 * Sidebar: Deep Slate #0F172A
 * Active Row: Amber-100 #FEF3C7
 */

:root {
  --app-primary: #1E40AF;
  --app-primary-hover: #1D4ED8;
  --app-primary-light: #EFF6FF;
  --app-accent: #6366F1;
  --app-accent-hover: #4F46E5;
  --app-sidebar-bg: #0F172A;
  --app-sidebar-surface: #1E293B;
  --app-sidebar-hover: #334155;
  --app-sidebar-text: #F8FAFC;
  --app-sidebar-muted: #94A3B8;
  --app-row-active-bg: #FEF3C7;
  --app-row-active-border: #F59E0B;
  --app-surface: #FFFFFF;
  --app-surface-subtle: #F8FAFC;
  --app-border: #E2E8F0;
  --app-border-strong: #CBD5E1;
  --app-text-main: #0F172A;
  --app-text-muted: #64748B;
  --app-radius-sm: 6px;
  --app-radius-md: 10px;
  --app-radius-lg: 14px;
}

/* =========================================================================
   1. APPSHELL DEEP SLATE SIDEBAR (#0F172A)
   ========================================================================= */
.app-sidebar.m3-navigation-drawer,
aside.app-sidebar {
  background-color: var(--app-sidebar-bg) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--app-sidebar-text) !important;
}

.sidebar-brand-m3 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px !important;
}

.brand-logo-badge {
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-accent) 100%) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
  border-radius: 10px !important;
}

.brand-meta-title {
  color: #FFFFFF !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px;
}

.brand-meta-sub {
  color: var(--app-sidebar-muted) !important;
}

.m3-drawer-section-title {
  color: #64748B !important;
  font-size: 10.5px !important;
  font-weight: 750 !important;
  letter-spacing: 0.08em !important;
  padding: 14px 10px 6px 10px !important;
}

/* Enterprise 10 Standard Modules Nav Links */
.m3-nav-item, .nav-item {
  color: #CBD5E1 !important;
  border-radius: 8px !important;
  margin: 1px 0 !important;
  transition: all 0.15s ease !important;
}

.m3-nav-item .m3-nav-icon,
.nav-item .m3-nav-icon {
  color: var(--app-sidebar-muted) !important;
}

.m3-nav-item:hover, .nav-item:hover {
  background-color: var(--app-sidebar-surface) !important;
  color: #FFFFFF !important;
}

.m3-nav-item:hover .m3-nav-icon,
.nav-item:hover .m3-nav-icon {
  color: #FFFFFF !important;
}

/* Active Nav Item: Deep Cobalt + Modern Indigo Accent Indicator */
.m3-nav-item.active, .nav-item.active {
  background-color: rgba(30, 64, 175, 0.35) !important;
  color: #FFFFFF !important;
  font-weight: 650 !important;
  border-left: 3px solid var(--app-accent) !important;
  border-radius: 0 8px 8px 0 !important;
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.2);
}

.m3-nav-item.active .m3-nav-icon,
.nav-item.active .m3-nav-icon {
  color: #818CF8 !important;
}

.m3-drawer-divider {
  background-color: rgba(255, 255, 255, 0.08) !important;
  margin: 8px 6px !important;
}

/* Pinned Bottom Dock in Sidebar */
.sidebar-pinned-dock {
  margin-top: auto;
  padding: 12px 6px 4px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dock-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
  text-decoration: none;
  box-sizing: border-box;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.drawer-footer-user {
  background-color: transparent !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--app-sidebar-muted) !important;
}

/* =========================================================================
   2. TOPBAR FINTECH HEADER
   ========================================================================= */
.top-bar {
  background-color: #FFFFFF !important;
  border-bottom: 1px solid var(--app-border) !important;
  min-height: 60px;
  padding: 8px 24px !important;
}

.fiscal-year-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.global-ai-search-box {
  position: relative;
  min-width: 280px;
  max-width: 420px;
  flex: 1;
  display: flex;
  align-items: center;
}

.global-ai-search-box input {
  width: 100%;
  height: 36px;
  padding: 0 40px 0 34px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--app-text-main);
  background: #F8FAFC;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.global-ai-search-box input:focus {
  background: #FFFFFF;
  border-color: var(--app-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.global-ai-search-box .search-icon {
  position: absolute;
  left: 10px;
  font-size: 14px;
  color: #94A3B8;
  pointer-events: none;
}

.global-ai-search-box .kbd-hint {
  position: absolute;
  right: 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: #64748B;
  background: #E2E8F0;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.btn-quick-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--app-primary);
  color: #FFFFFF;
  border: 1px solid var(--app-primary);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-quick-create:hover {
  background: var(--app-primary-hover);
  box-shadow: 0 3px 8px rgba(30, 64, 175, 0.25);
}

.btn-mega-utilities {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #F8FAFC;
  color: #334155;
  border: 1px solid var(--app-border-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-mega-utilities:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
  color: #0F172A;
}

/* =========================================================================
   3. STREAMLINED 5 SUB-TABS BAR
   ========================================================================= */
.streamlined-subtabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #F8FAFC;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  margin-bottom: 16px;
  overflow-x: auto;
  box-sizing: border-box;
}

.subtab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  outline: none;
}

.subtab-item:hover {
  background: #EDF2F7;
  color: #0F172A;
}

.subtab-item.active {
  background: #FFFFFF;
  color: var(--app-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  font-weight: 700;
}

.subtab-item.active .subtab-icon {
  color: var(--app-accent);
}

/* =========================================================================
   4. MASTER - DETAIL SPLIT GRID (MODE A)
   ========================================================================= */
.master-detail-container {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.master-action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--app-border);
}

.master-toolbar-left,
.master-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-ai-cruncher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--app-accent) 0%, var(--app-primary) 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.btn-ai-cruncher:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

.master-table-scroll {
  max-height: 380px;
  min-height: 220px;
  overflow-y: auto;
  overflow-x: auto;
  transition: max-height 0.25s ease;
}

.master-table-scroll.is-expanded {
  max-height: 650px;
}

.master-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums lining-nums;
  text-align: left;
}

.master-data-table thead th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 6px 8px;
  border-bottom: 2px solid #94A3B8;
  z-index: 2;
  white-space: nowrap;
}

.master-data-table tbody tr {
  border-bottom: 1px solid #CBD5E1;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.master-data-table tbody tr:hover {
  background-color: #F8FAFC;
}

/* Master Selected Row: Amber-100 highlight */
.master-data-table tbody tr.is-selected {
  background-color: var(--app-row-active-bg) !important;
  color: #78350F;
  outline: 1.5px solid var(--app-row-active-border);
  outline-offset: -1.5px;
  font-weight: 600;
}

.master-data-table tbody td {
  padding: 5px 8px;
  vertical-align: middle;
  white-space: nowrap;
  border-right: 1px solid #CBD5E1;
  border-bottom: 1px solid #CBD5E1;
}

/* Splitter Resize / Toggle Bar */
.master-detail-splitter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: #F1F5F9;
  border-top: 1px solid var(--app-border);
  border-bottom: 1px solid var(--app-border);
  font-size: 12px;
  font-weight: 650;
  color: #334155;
  user-select: none;
}

.splitter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #FFFFFF;
  border: 1px solid var(--app-border-strong);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 650;
  color: #1E293B;
  cursor: pointer;
  transition: all 0.15s ease;
}

.splitter-toggle-btn:hover {
  background: #F8FAFC;
  border-color: var(--app-primary);
  color: var(--app-primary);
}

.detail-canvas-pane {
  background: #FFFFFF;
  min-height: 240px;
  max-height: 380px;
  overflow: auto;
  position: relative;
  transition: all 0.25s ease;
}

.detail-canvas-pane.is-collapsed {
  display: none !important;
}

/* Sticky Summary Footer */
.master-sticky-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #F8FAFC;
  border-top: 1px solid var(--app-border);
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

/* =========================================================================
   5. FINTECH 2-COLUMN VOUCHER FORM MODAL
   ========================================================================= */
.fintech-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.fintech-modal-card {
  background: #FFFFFF;
  border-radius: var(--app-radius-lg);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 1050px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.fintech-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--app-border);
  background: #F8FAFC;
}

.fintech-headline-amount {
  font-size: 26px;
  font-weight: 850;
  color: #059669;
  font-feature-settings: "tnum";
  letter-spacing: -0.5px;
}

.fintech-form-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.fintech-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.fintech-col-card {
  background: #F8FAFC;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 16px;
}

.fintech-col-title {
  font-size: 12px;
  font-weight: 750;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fintech-field-group {
  margin-bottom: 12px;
}

.fintech-field-group:last-child {
  margin-bottom: 0;
}

.fintech-field-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 650;
  color: #334155;
  margin-bottom: 4px;
}

.fintech-field-group input,
.fintech-field-group select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--app-border-strong);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--app-text-main);
  background: #FFFFFF;
  box-sizing: border-box;
  outline: none;
}

.fintech-field-group input:focus,
.fintech-field-group select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15);
}

.fintech-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  overflow: hidden;
}

.fintech-lines-table thead th {
  background: #F1F5F9;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 6px 8px;
  border: 1px solid #94A3B8;
}

.fintech-lines-table tbody td {
  padding: 5px 8px;
  border: 1px solid #CBD5E1;
  font-size: 12px;
}

.fintech-lines-table tbody input {
  width: 100%;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 12px;
  outline: none;
}

.fintech-lines-table tbody input:focus {
  background: #EFF6FF;
}

/* =========================================================================
   6. MASTER CATALOG HUB MODAL (10 CARDS & DETAIL WORKSPACE)
   ========================================================================= */
.catalog-modal-card {
  max-width: 1280px !important;
  width: 96vw !important;
  height: 86vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #FFFFFF !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25) !important;
  overflow: hidden !important;
  border: 1px solid #CBD5E1 !important;
}

.catalog-grid-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.catalog-card-item {
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.catalog-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--app-primary);
  box-shadow: 0 8px 20px -4px rgba(30, 64, 175, 0.15);
}

.catalog-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: #EFF6FF;
  color: var(--app-primary);
}

.catalog-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}

.catalog-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--app-text-main);
}

.catalog-card-desc {
  font-size: 12px;
  color: var(--app-text-muted);
  line-height: 1.4;
  flex: 1;
}

.catalog-card-action {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--app-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tab Navigation Strip */
.catalog-nav-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.catalog-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 650;
  color: #64748B;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.catalog-nav-tab:hover {
  color: #1E40AF;
  background: #EFF6FF;
}

.catalog-nav-tab.is-active {
  color: #1E40AF;
  border-bottom-color: #1E40AF;
  background: #FFFFFF;
  font-weight: 750;
}

/* Action Toolbar */
.catalog-action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.catalog-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 4px 10px;
  width: 320px;
  max-width: 100%;
}

.catalog-search-wrap input {
  border: none;
  background: transparent;
  font-size: 13px;
  width: 100%;
  outline: none;
  color: #0F172A;
}

.catalog-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.catalog-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 650;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.catalog-btn-primary {
  background: #1E40AF;
  color: #FFFFFF;
  border-color: #1D4ED8;
}
.catalog-btn-primary:hover {
  background: #1D4ED8;
}

.catalog-btn-secondary {
  background: #F1F5F9;
  color: #334155;
  border-color: #CBD5E1;
}
.catalog-btn-secondary:hover {
  background: #E2E8F0;
}

.catalog-btn-success {
  background: #059669;
  color: #FFFFFF;
  border-color: #047857;
}
.catalog-btn-success:hover {
  background: #047857;
}

/* Data Table Container */
.catalog-table-container {
  flex: 1;
  overflow: auto;
  background: #FFFFFF;
  position: relative;
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.catalog-table thead th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  color: #475569;
  font-weight: 750;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  border-bottom: 2px solid #CBD5E1;
  z-index: 2;
  white-space: nowrap;
}

.catalog-table tbody tr {
  border-bottom: 1px solid #E2E8F0;
  transition: background 0.1s ease;
}

.catalog-table tbody tr:hover {
  background: #F8FAFC;
}

.catalog-table tbody td {
  padding: 9px 12px;
  color: #1E293B;
  vertical-align: middle;
}

.catalog-badge {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}
.catalog-badge-blue { background: #DBEAFE; color: #1E40AF; }
.catalog-badge-green { background: #DCFCE7; color: #166534; }
.catalog-badge-amber { background: #FEF3C7; color: #92400E; }
.catalog-badge-purple { background: #F3E8FF; color: #6B21A8; }
.catalog-badge-slate { background: #F1F5F9; color: #475569; }

/* =========================================================================
   6B. EXCEL IN-CELL EDITING SHEET WORKBENCH (SỔ NHẬT KÝ CHUNG & DANH MỤC)
   ========================================================================= */
.excel-master-sheet-card {
  max-width: 1560px !important;
  width: 98vw !important;
  height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #FFFFFF !important;
  border-radius: 8px !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35) !important;
  overflow: hidden !important;
  border: 1px solid #94A3B8 !important;
}

/* Cheatsheet Bar on top */
.excel-cheatsheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: #F1F5F9;
  border-bottom: 1px solid #CBD5E1;
  font-size: 11.5px;
  color: #334155;
  flex-shrink: 0;
  gap: 12px;
}

.excel-cheatsheet-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.excel-cheatsheet-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
}
.excel-cheatsheet-pill b {
  color: #1E40AF;
  font-weight: 750;
}

/* Formula & Coordinate bar */
.excel-sheet-formula-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #FFFFFF;
  border-bottom: 1px solid #CBD5E1;
  flex-shrink: 0;
}

.excel-coord-box {
  width: 65px;
  height: 26px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #1E293B;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.excel-fx-icon {
  font-style: italic;
  font-weight: 800;
  font-size: 13px;
  color: #64748B;
  user-select: none;
}

.excel-formula-input {
  flex: 1;
  height: 26px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12.5px;
  color: #0F172A;
  outline: none;
}
.excel-formula-input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Grid Table */
.excel-grid-container {
  flex: 1;
  overflow: auto;
  background: #FFFFFF;
  position: relative;
  scrollbar-width: thin;
}

.excel-sheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: fixed;
  background: #FFFFFF;
}

.excel-sheet-table th.excel-col-letter {
  background: #F8FAFC;
  color: #475569;
  font-weight: 700;
  text-align: center;
  font-size: 11px;
  height: 24px;
  border-right: 1px solid #CBD5E1;
  border-bottom: 1px solid #CBD5E1;
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
}

.excel-sheet-table th.excel-header-title {
  background: #F1F5F9;
  color: #1E293B;
  font-weight: 750;
  text-align: center;
  font-size: 12px;
  height: 30px;
  border-right: 1px solid #CBD5E1;
  border-bottom: 2px solid #94A3B8;
  position: sticky;
  top: 24px;
  z-index: 10;
  white-space: nowrap;
  padding: 0 8px;
}

.excel-sheet-table td.excel-row-num {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #F8FAFC;
  color: #64748B;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  border-right: 2px solid #CBD5E1;
  border-bottom: 1px solid #CBD5E1;
  user-select: none;
}

.excel-sheet-table td.excel-cell {
  height: 28px;
  padding: 3px 8px;
  border-right: 1px solid #CBD5E1;
  border-bottom: 1px solid #CBD5E1;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: cell;
  font-variant-numeric: tabular-nums;
  background: #FFFFFF;
}

.excel-sheet-table td.excel-cell:hover {
  background: #F8FAFC;
}

.excel-sheet-table td.excel-cell:focus,
.excel-sheet-table td.excel-cell.is-active-cell {
  background: #FFFFFF !important;
  box-shadow: inset 0 0 0 2px #2563EB !important;
  z-index: 4;
}

.excel-sheet-table td.excel-cell.num-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.excel-sheet-table td.excel-cell.center-text {
  text-align: center;
}

.excel-sheet-table tr.excel-total-row td {
  background: #EFF6FF !important;
  font-weight: 800 !important;
  border-top: 2px solid #1E40AF !important;
  border-bottom: 2px solid #1E40AF !important;
  color: #1E3A8A !important;
}

/* Bottom Sheet Tabs Bar */
.excel-bottom-sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #E2E8F0;
  border-top: 1px solid #CBD5E1;
  flex-shrink: 0;
  height: 38px;
  gap: 12px;
}

.excel-bottom-tabs-wrap {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  overflow-x: auto;
  height: 100%;
  scrollbar-width: none;
}

.excel-bottom-tab {
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 650;
  background: #CBD5E1;
  color: #475569;
  border: 1px solid #94A3B8;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s ease;
  user-select: none;
}

.excel-bottom-tab:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.excel-bottom-tab.is-active {
  background: #FFFFFF;
  color: #1E40AF;
  border-top: 2.5px solid #2563EB;
  border-bottom: 1px solid #FFFFFF;
  margin-bottom: -1px;
  font-weight: 750;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.06);
}

.excel-bottom-status {
  font-size: 11.5px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* =========================================================================
   7. ACCORDION REPORT HUB (14 MODULES)
   ========================================================================= */
.report-accordion-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0;
}

.report-accordion-group {
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  overflow: hidden;
}

.report-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #F8FAFC;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 13.5px;
  color: #1E293B;
  transition: background 0.15s ease;
}

.report-accordion-header:hover {
  background: #F1F5F9;
}

.report-accordion-content {
  padding: 12px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  border-top: 1px solid var(--app-border);
}

.report-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  background: #F8FAFC;
  border: 1px solid var(--app-border);
  text-decoration: none;
  color: #334155;
  font-size: 12.5px;
  font-weight: 550;
  transition: all 0.15s ease;
}

.report-link-item:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: var(--app-primary);
}

.report-fav-star {
  cursor: pointer;
  font-size: 14px;
  color: #CBD5E1;
  transition: color 0.15s ease;
}

.report-fav-star.is-starred {
  color: #F59E0B;
}

/* =========================================================================
   8. TRI-DASHBOARDS BI (PROCUREMENT, WAREHOUSE, SALES)
   ========================================================================= */
.bi-dashboards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.bi-card {
  background: #FFFFFF;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bi-card-title {
  font-size: 13px;
  font-weight: 750;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bi-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.bi-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}

.bi-step-bubble {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: #F1F5F9;
  color: #475569;
  margin-bottom: 6px;
}

.bi-step-bubble.is-done {
  background: #DCFCE7;
  color: #166534;
}

.bi-step-bubble.is-active {
  background: var(--app-primary);
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2);
}

.bi-badges-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bi-badge-pill {
  padding: 10px 12px;
  border-radius: 8px;
  background: #F8FAFC;
  border: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bi-badge-pill.danger {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}

.bi-badge-pill.warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.bi-badge-pill.success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}

.bi-badge-val {
  font-size: 18px;
  font-weight: 800;
}

.bi-badge-lbl {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}

/* =========================================================================
   9. FULL CANVAS TOP BANNER (MODE B)
   ========================================================================= */
.full-canvas-top-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--app-sidebar-bg);
  color: #FFFFFF;
  border-radius: var(--app-radius-md) var(--app-radius-md) 0 0;
  border: 1px solid #334155;
  border-bottom: none;
  box-sizing: border-box;
  margin-top: 8px;
}

.full-canvas-top-banner .banner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.full-canvas-top-banner .badge-fps {
  background: linear-gradient(135deg, #0284C7 0%, #2563EB 100%);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.full-canvas-top-banner .btn-collapse-canvas {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
}

.full-canvas-top-banner .btn-collapse-canvas:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* =========================================================================
   10. ENTERPRISE 6 STRATEGIC PILLARS (SPEC-VNACCOUNTING-ARCHITECTURE-6-PILLARS-2026)
   ========================================================================= */
.pillar-overview-wrapper,
.pillar-profile-wrapper,
.pillar-ingestion-wrapper,
.pillar-inventory-wrapper,
.pillar-reports-wrapper,
.pillar-settings-wrapper {
  animation: fadeInPillar 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInPillar {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-stage2-push:hover {
  background: #15803D !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35) !important;
}

.btn-stage2-save:hover {
  background: #E2E8F0 !important;
  border-color: #94A3B8 !important;
}

.btn-subview {
  transition: all 0.15s ease;
}

.btn-subview:hover:not(.active) {
  background: #EFF6FF !important;
  border-color: #93C5FD !important;
  color: #1E40AF !important;
}

/* ==========================================================================
   EXCEL GRID CRISP BORDER OVERRIDES & UNIFIED DESIGN TOKENS (UI-UX-PRO-MAX DENSITY 9)
   ========================================================================== */
.ag-theme-quartz {
  /* Biến CSS chuẩn của AG Grid */
  --ag-border-color: #CBD5E1 !important;
  --ag-row-border-color: #CBD5E1 !important;
  --ag-cell-horizontal-border: 1px solid #CBD5E1 !important;
  --ag-header-column-separator-display: block !important;
  --ag-header-column-separator-color: #94A3B8 !important;
  --ag-header-column-separator-height: 100% !important;

  /* UI-UX-PRO-MAX DENSITY 9: TIÊU CHUẨN TYPOGRAPHY & KÍCH THƯỚC Ô EXCEL ĐỒNG NHẤT */
  --ag-font-size: 12px !important;
  --ag-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  --ag-header-height: 32px !important;
  --ag-row-height: 28px !important;
  --ag-cell-horizontal-padding: 8px !important;
}

/* Kẻ viền dọc và ngang rõ nét cho từng ô dữ liệu - font 12px đồng nhất */
.ag-theme-quartz .ag-cell {
  border-right: 1px solid #CBD5E1 !important;
  border-bottom: 1px solid #CBD5E1 !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  font-size: 12px !important;
  line-height: 28px !important;
  font-variant-numeric: tabular-nums lining-nums !important;
  box-sizing: border-box !important;
}

/* Kẻ viền cho tiêu đề cột - font 11.5px bold đồng nhất */
.ag-theme-quartz .ag-header-cell,
.ag-theme-quartz .ag-header-group-cell {
  border-right: 1px solid #CBD5E1 !important;
  border-bottom: 2px solid #94A3B8 !important;
  background-color: #F8FAFC !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  box-sizing: border-box !important;
}

.ag-theme-quartz .ag-header-cell-text {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
}

/* Đường phân cách cột ghim trái (STT / Tùy chọn) */
.ag-theme-quartz .ag-pinned-left-header,
.ag-theme-quartz .ag-pinned-left-cols-container .ag-cell {
  border-right: 2px solid #94A3B8 !important;
}

/* Dòng ghim đáy (Pinned Bottom - Tổng cộng) */
.ag-theme-quartz .ag-floating-bottom {
  border-top: 2px solid #1E3A8A !important;
  background-color: #0F294A !important;
}
.ag-theme-quartz .ag-floating-bottom .ag-cell {
  border-right: 1px solid #1E40AF !important;
  border-bottom: 1px solid #1E40AF !important;
  font-size: 12px !important;
  line-height: 30px !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums !important;
}

/* Hiệu ứng focus / chọn ô giống Excel thật */
.ag-theme-quartz .ag-cell-focus:not(.ag-cell-range-selected) {
  outline: 2px solid #2563EB !important;
  outline-offset: -2px !important;
  z-index: 10 !important;
}

/* Viền và font chuẩn cho tất cả các bảng tính HTML phụ (Calc Grid, Master Detail & Drilldown Tables) */
.calc-grid-table,
.excel-table,
.drilldown-matrix-table,
.master-data-table,
.fintech-lines-table {
  border-collapse: collapse !important;
  border: 1px solid #CBD5E1 !important;
  font-size: 12px !important;
  font-variant-numeric: tabular-nums lining-nums !important;
}
.calc-grid-table th,
.excel-table th,
.drilldown-matrix-table th,
.master-data-table thead th,
.fintech-lines-table thead th {
  border: 1px solid #94A3B8 !important;
  background-color: #F1F5F9 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  padding: 6px 8px !important;
}
.calc-grid-table td,
.excel-table td,
.drilldown-matrix-table td,
.master-data-table tbody td,
.fintech-lines-table tbody td {
  border: 1px solid #CBD5E1 !important;
  font-size: 12px !important;
  padding: 5px 8px !important;
  line-height: 1.4 !important;
}

/* ==========================================================================
   UNIFORM DESIGN TOKENS & STANDARD COMPONENTS (SPEC-UIUX-VNACCOUNTING-UNIFORM-2026)
   Chuẩn hóa kích thước đồng nhất cho tất cả các thẻ tab, nút bấm & ô điều khiển
   ========================================================================== */
:root {
  --excel-control-height: 32px;
  --excel-control-radius: 6px;
  --excel-control-font-size: 12px;
  --excel-control-font-weight: 650;
}

/* 1. Nút bấm thanh công cụ Excel chuẩn mực (Uniform Toolbar Buttons) */
.excel-toolbar-btn {
  height: var(--excel-control-height) !important;
  box-sizing: border-box !important;
  border-radius: var(--excel-control-radius) !important;
  font-size: var(--excel-control-font-size) !important;
  font-weight: var(--excel-control-font-weight) !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0 12px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  user-select: none !important;
  transition: all 0.15s ease !important;
}

.excel-toolbar-btn-primary {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}
.excel-toolbar-btn-primary:hover {
  background: #1D4ED8 !important;
}

.excel-toolbar-btn-primary.is-smart-save {
  background: #059669 !important;
  color: #FFFFFF !important;
  border-color: #047857 !important;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3) !important;
}
.excel-toolbar-btn-primary.is-smart-save:hover {
  background: #047857 !important;
}

.excel-toolbar-btn-primary.is-smart-download {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #1D4ED8 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3) !important;
}
.excel-toolbar-btn-primary.is-smart-download:hover {
  background: #1D4ED8 !important;
}

.excel-toolbar-btn-danger {
  background: #FFFFFF !important;
  color: #DC2626 !important;
  border: 1px solid #DC2626 !important;
}
.excel-toolbar-btn-danger:hover:not(.delete-btn-blinking) {
  background: #FEF2F2 !important;
}

.excel-toolbar-btn-success {
  background: #FFFFFF !important;
  color: #059669 !important;
  border: 1px solid #10B981 !important;
}
.excel-toolbar-btn-success:hover {
  background: #ECFDF5 !important;
}

.excel-toolbar-btn-secondary {
  background: #FFFFFF !important;
  color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
}
.excel-toolbar-btn-secondary:hover {
  background: #F1F5F9 !important;
  border-color: #94A3B8 !important;
  color: #0F172A !important;
}

.excel-toolbar-btn-icon {
  width: var(--excel-control-height) !important;
  min-width: var(--excel-control-height) !important;
  max-width: var(--excel-control-height) !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 2. Cụm thẻ kiểm toán kho (Audit Cluster & Pills) */
.excel-audit-cluster {
  display: inline-flex !important;
  align-items: center !important;
  background: #F8FAFC !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: var(--excel-control-radius) !important;
  padding: 2px !important;
  gap: 2px !important;
  box-sizing: border-box !important;
  height: var(--excel-control-height) !important;
}

.excel-audit-pill {
  height: 26px !important;
  box-sizing: border-box !important;
  border-radius: 4px !important;
  font-size: 11.5px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 0 8px !important;
  cursor: pointer !important;
  border: none !important;
  white-space: nowrap !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

/* 3. Thẻ bảng tính chính (Main Excel Sheet Tabs) */
.excel-sheet-tab {
  height: var(--excel-control-height) !important;
  box-sizing: border-box !important;
  border-radius: var(--excel-control-radius) !important;
  font-size: var(--excel-control-font-size) !important;
  font-weight: var(--excel-control-font-weight) !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 12px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  user-select: none !important;
  border: 1.5px solid #CBD5E1 !important;
  background: #FFFFFF !important;
  color: #334155 !important;
  transition: all 0.15s ease !important;
}
.excel-sheet-tab:hover:not(.is-active) {
  background: #F8FAFC !important;
  border-color: #94A3B8 !important;
  color: #0F172A !important;
}
.excel-sheet-tab.is-active {
  background: #EFF6FF !important;
  color: #1D4ED8 !important;
  border-color: #2563EB !important;
  font-weight: 750 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2) !important;
}

/* 4. Thẻ bóc tách chuyên sâu (Sliced Filter Tabs) */
.excel-sliced-tab {
  height: var(--excel-control-height) !important;
  box-sizing: border-box !important;
  border-radius: var(--excel-control-radius) !important;
  font-size: var(--excel-control-font-size) !important;
  font-weight: var(--excel-control-font-weight) !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 10px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  user-select: none !important;
  border: 1.5px solid #99F6E4 !important;
  background: #F0FDFA !important;
  color: #115E59 !important;
  transition: all 0.15s ease !important;
}
.excel-sliced-tab:hover:not(.is-active) {
  background: #E6FFFA !important;
  border-color: #5EEAD4 !important;
}
.excel-sliced-tab.is-active {
  background: #CCFBF1 !important;
  color: #0F766E !important;
  border-color: #0D9488 !important;
  font-weight: 750 !important;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.25) !important;
}

.excel-tab-close-btn {
  cursor: pointer !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #0F766E !important;
  margin-left: 2px !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 3px !important;
  background: #99F6E4 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}
.excel-tab-close-btn:hover {
  background: #FEE2E2 !important;
  color: #DC2626 !important;
}

/* 5. Chống co giãn giật (Anti-Layout-Shift) cho nút Xóa cột */
.btn-delete-col-stable {
  min-width: 104px !important;
  max-width: 136px !important;
  box-sizing: border-box !important;
}
.btn-delete-col-stable .btn-text-stable {
  max-width: 80px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* 6. Thẻ phân hệ nghiệp vụ cốt lõi (Primary Pillar Tabs) & Dropdown điều khiển chuẩn 32px */
.excel-pillar-tab {
  height: var(--excel-control-height) !important;
  box-sizing: border-box !important;
  border-radius: var(--excel-control-radius) !important;
  font-size: var(--excel-control-font-size) !important;
  font-weight: var(--excel-control-font-weight) !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0 12px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  border: none !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
}

.excel-control-select {
  height: var(--excel-control-height) !important;
  box-sizing: border-box !important;
  border-radius: var(--excel-control-radius) !important;
  font-size: var(--excel-control-font-size) !important;
  font-weight: var(--excel-control-font-weight) !important;
  padding: 0 8px !important;
  border: 1px solid #CBD5E1 !important;
  background: #FFFFFF !important;
  color: #0F172A !important;
  outline: none !important;
  cursor: pointer !important;
}

/* 7. Đổ bóng nội ô không giật layout khi chọn cột bảng tính (Non-destructive Selection) */
.ag-cell.excel-col-selected {
  background-color: #EFF6FF !important;
  box-shadow: inset 1px 0 0 #93C5FD, inset -1px 0 0 #93C5FD !important;
}

/* =========================================================================
   8. CRAWLER LOADING SPINNER (LUỒNG TẢI HÓA ĐƠN VÀO BỘ NHỚ TẠM & TẢI XUỐNG)
   ========================================================================= */
@keyframes crawlerSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.crawler-spinner {
  display: inline-block !important;
  width: 13px !important;
  height: 13px !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 50% !important;
  border-top-color: #FFFFFF !important;
  animation: crawlerSpin 0.75s linear infinite !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

.crawler-spinner-blue {
  border-color: rgba(56, 189, 248, 0.25) !important;
  border-top-color: #38BDF8 !important;
}

.crawler-spinner-emerald {
  border-color: rgba(52, 211, 153, 0.25) !important;
  border-top-color: #34D399 !important;
}

.crawler-spinner-amber {
  border-color: rgba(251, 191, 36, 0.25) !important;
  border-top-color: #FBBF24 !important;
}

/* =========================================================================
   9. UNIFIED DOWNLOAD DROPDOWN (1 TAB = 1 NÚT TẢI XUỐNG ▾ DUY NHẤT)
   LỒNG 3 ĐỊNH DẠNG (.XLSX / .CSV / .PDF) TRONG MENU THẢ XUỐNG - KHÔNG HIỂN THỊ NGOÀI TOOLBAR
   ========================================================================= */
.unified-download-dropdown {
  position: relative !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.unified-download-menu {
  display: none !important;
  position: absolute !important;
  top: calc(100% + 4px) !important;
  right: 0 !important;
  min-width: 220px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08) !important;
  padding: 6px !important;
  z-index: 99999 !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

.unified-download-menu.align-left {
  right: auto !important;
  left: 0 !important;
}

.unified-download-menu.show,
.unified-download-menu[data-open="true"] {
  display: block !important;
  animation: unifiedMenuFadeIn 0.12s ease-out !important;
}

@keyframes unifiedMenuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.unified-download-item {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  border: none !important;
  background: transparent !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  text-align: left !important;
  color: #1e293b !important;
  font-size: 12.5px !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  transition: background 0.12s ease !important;
}

.unified-download-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.unified-download-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 22px !important;
  border-radius: 4px !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  flex-shrink: 0 !important;
}

.unified-download-badge.badge-xlsx {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
}

.unified-download-badge.badge-csv {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

.unified-download-badge.badge-pdf {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

.unified-download-text {
  display: flex !important;
  flex-direction: column !important;
  text-align: left !important;
}

.unified-download-title {
  font-weight: 700 !important;
  font-size: 12px !important;
  color: #0f172a !important;
}

.unified-download-desc {
  font-size: 10.5px !important;
  color: #64748b !important;
  margin-top: 2px !important;
}

@media print {
  .unified-download-dropdown, .unified-download-menu {
    display: none !important;
  }
}





