/* ==========================================================================
   Arkas Shop Custom Styles (Admin & B2B Dashboards)
   Extracted faithfully from index3.html & user-dashboard.html
   Zero Tailwind - Pure Modern CSS & Bootstrap 5 RTL Overrides
   ========================================================================== */

:root {
  --user-header-bg: linear-gradient(90deg, #1e293b 0%, #1e40af 100%);
  --arkas-border: #e6ebf1;
  --arkas-surface: #ffffff;
  --arkas-muted: #64748b;
  --arkas-dark: #0f172a;
  --arkas-primary: #2563eb;
  --arkas-success: #10b981;
  --arkas-warning: #f59e0b;
  --arkas-danger: #ef4444;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  min-height: 100vh !important;
  background-color: #f8fafc;
}

body {
  display: block !important;
  position: static !important;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden !important;
}

#app {
  width: 100% !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.admin-wrapper,
.user-dashboard-wrapper {
  width: 100% !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.num, .kpi-value, .tabular-nums {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   1. Compact 45px Top Header Overrides (Admin & User Portals)
   ========================================================================== */
.top-header {
  height: 45px !important;
  min-height: 45px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 1rem !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1040;
}

.top-header.user-panel-header {
  background: var(--user-header-bg) !important;
}

.top-header .brand-section {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 100%;
}

.top-header .brand-logo img {
  height: 25px !important;
  object-fit: contain;
  display: block;
}

.top-header .btn-mobile-hamburger {
  width: 30px;
  height: 30px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.top-header .btn-desktop-sidebar-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.top-header .btn-desktop-sidebar-toggle:hover,
.top-header .btn-mobile-hamburger:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

@media (max-width: 991.98px) {
  .top-header .btn-mobile-hamburger {
    display: inline-flex !important;
  }
  .top-header .btn-desktop-sidebar-toggle {
    display: none !important;
  }
}

.top-header .header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  height: 45px;
}

.top-header .header-nav-link {
  height: 31px !important;
  padding: 0 0.65rem !important;
  font-size: 0.8rem !important;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.top-header .header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
}

.top-header .btn-pos-launch {
  height: 29px;
  padding: 0 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.top-header .btn-pos-launch:hover {
  background: #ffffff;
  color: var(--arkas-primary);
}

.top-header .header-icon-btn {
  width: 30px !important;
  height: 30px !important;
  font-size: 0.82rem !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.top-header .user-profile-btn {
  width: 31px !important;
  height: 31px !important;
  padding: 0 !important;
}

.top-header .user-avatar {
  width: 29px !important;
  height: 29px !important;
  border-radius: 50%;
  object-fit: cover;
}

.top-header .mega-menu-dashboards {
  top: 45px !important;
}

.top-header .avatar-dropdown-menu {
  top: calc(100% + 6px) !important;
}

/* User & Partner Header Specific Elements */
.btn-admin-switch {
  height: 29px;
  padding: 0 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-admin-switch:hover {
  background: #f59e0b;
  color: #0f172a;
}

.tier-header-badge {
  height: 27px;
  padding: 0 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-cart-pill {
  height: 29px;
  padding: 0 0.65rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.btn-cart-pill:hover {
  background: #10b981;
  color: #ffffff;
}

/* Compact Secondary Action Toolbar */
.action-toolbar {
  min-height: 42px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0.35rem 1rem !important;
  border-bottom: 1px solid var(--arkas-border);
  background: #ffffff;
}

/* ==========================================================================
   2. Modern Arkas Shop Executive & Operational Widgets
   ========================================================================== */
.arkas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

@media (max-width: 1199.98px) {
  .arkas-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .arkas-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.arkas-kpi-card {
  background: var(--arkas-surface);
  border: 1px solid var(--arkas-border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.arkas-kpi-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--arkas-muted);
}

.kpi-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.kpi-icon-blue { background: #eff6ff; color: #2563eb; }
.kpi-icon-emerald { background: #ecfdf5; color: #059669; }
.kpi-icon-amber { background: #fffbeb; color: #d97706; }
.kpi-icon-rose { background: #fef2f2; color: #dc2626; }
.kpi-icon-indigo { background: #eef2ff; color: #4f46e5; }

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.kpi-value {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--arkas-dark);
  line-height: 1.2;
}

.kpi-currency {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--arkas-muted);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #eef2f6;
  color: var(--arkas-muted);
}

.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.7rem;
}

.trend-up { background: #ecfdf5; color: #059669; }
.trend-warn { background: #fffbeb; color: #b45309; }
.trend-danger { background: #fef2f2; color: #dc2626; }

/* Credit Progress Bar (User Dashboard) */
.credit-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.credit-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #2563eb);
  border-radius: 999px;
}

/* Modern Panel Cards for Charts & Operations */
.arkas-panel-card {
  background: var(--arkas-surface);
  border: 1px solid var(--arkas-border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.arkas-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.arkas-panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--arkas-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.arkas-panel-subtitle {
  font-size: 0.73rem;
  color: var(--arkas-muted);
  margin-top: 0.15rem;
}

.mini-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 9px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
}

.mini-stat-item .lbl {
  font-size: 0.7rem;
  color: var(--arkas-muted);
  display: block;
}

.mini-stat-item .val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--arkas-dark);
}

/* Operational Lists (Cheques, Low Stock, System Health, Ledger) */
.ops-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ops-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  font-size: 0.78rem;
}

.ops-item-title {
  font-weight: 700;
  color: var(--arkas-dark);
  display: block;
}

.ops-item-sub {
  font-size: 0.7rem;
  color: var(--arkas-muted);
}

.system-status-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.48rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.76rem;
  margin-bottom: 0.45rem;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* ==========================================================================
   3. B2B Quick Order Specific Elements (User Portal)
   ========================================================================== */
.price-public-strike {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 0.76rem;
  display: block;
}

.price-partner-final {
  color: #059669;
  font-weight: 800;
  font-size: 0.92rem;
}

.discount-chip {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.08rem 0.38rem;
  border-radius: 4px;
  margin-right: 0.3rem;
}

.b2b-uom-select {
  font-size: 0.76rem;
  padding: 0.25rem 1.6rem 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  min-width: 115px;
}

.b2b-qty-input {
  width: 78px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.btn-add-b2b {
  padding: 0.28rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  transition: all 0.15s ease;
}

.btn-add-b2b:hover {
  background: #2563eb;
  color: #ffffff;
}

/* Fullscreen Table Mode Override */
.fullscreen-mode {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1060 !important;
  background: #ffffff !important;
  padding: 1.5rem !important;
  margin: 0 !important;
  overflow-y: auto !important;
  border-radius: 0 !important;
}

/* ==========================================================================
   Master-Detail ERP Document Builder & SKU Form Styles (Phase 2)
   Extracted from erp-forms-template.html
   ========================================================================== */
.erp-doc-card {
  background: var(--arkas-surface);
  border: 1px solid var(--arkas-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.erp-doc-header {
  padding: 0.9rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--arkas-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.erp-doc-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--arkas-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.doc-status-draft { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.doc-status-final, .doc-status-completed { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.doc-status-cancelled { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.doc-status-pending { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.erp-doc-body {
  padding: 1.2rem 1.25rem;
}

.erp-form-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.35rem;
  display: block;
}

.erp-input, .erp-select {
  font-size: 0.82rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0.42rem 0.7rem;
  background-color: #ffffff;
  width: 100%;
  color: #1e293b;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.erp-input:focus, .erp-select:focus {
  outline: none;
  border-color: var(--arkas-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.erp-input:disabled, .erp-input[readonly],
.erp-select:disabled {
  background-color: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.input-currency-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-currency-wrap .erp-input {
  padding-left: 2.8rem;
  direction: ltr;
  text-align: right;
}

.input-currency-badge {
  position: absolute;
  left: 0.55rem;
  font-size: 0.68rem;
  color: var(--arkas-muted);
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  pointer-events: none;
}

/* Dynamic Line Items Table */
.erp-lines-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--arkas-border);
  border-radius: 10px;
  overflow: hidden;
}

.erp-lines-table thead th {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--arkas-border);
  white-space: nowrap;
}

.erp-lines-table tbody td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 0.8rem;
}

.erp-lines-table tbody tr:last-child td {
  border-bottom: none;
}

.base-qty-hint {
  font-size: 0.68rem;
  color: var(--arkas-primary);
  background: #eff6ff;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.2rem;
}

.btn-remove-line {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-line:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.btn-add-line {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--arkas-primary);
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-line:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}

/* Document Summary & Landed Cost Box */
.doc-totals-panel {
  background: #f8fafc;
  border: 1px solid var(--arkas-border);
  border-radius: 10px;
  padding: 1rem 1.15rem;
}

.doc-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 0.35rem 0;
  color: #475569;
}

.doc-total-row.grand-total {
  border-top: 2px solid #cbd5e1;
  margin-top: 0.45rem;
  padding-top: 0.65rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--arkas-dark);
}

.section-divider-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--arkas-dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   Jalali DatePicker Custom Styles (react-multi-date-picker Theme for Arkas)
   Strictly Zero Tailwind - Seamless IRANSans & Tabular Numbers
   ========================================================================== */
.jalali-datepicker-wrapper {
  width: 100%;
}

.jalali-datepicker-wrapper .rmdp-container {
  width: 100%;
  display: block;
}

.rmdp-wrapper.arkas-calendar-popup,
.arkas-calendar-popup .rmdp-wrapper {
  font-family: inherit !important;
  font-variant-numeric: tabular-nums !important;
  border-radius: 12px !important;
  border: 1px solid var(--arkas-border, #e6ebf1) !important;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08) !important;
  overflow: hidden;
  background-color: #ffffff !important;
  direction: rtl;
}

.arkas-calendar-popup .rmdp-top-class {
  background-color: #ffffff !important;
}

.arkas-calendar-popup .rmdp-header {
  padding: 0.6rem 0.75rem !important;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem !important;
  font-weight: 700;
  color: #0f172a;
}

.arkas-calendar-popup .rmdp-header-values {
  font-weight: 700 !important;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.arkas-calendar-popup .rmdp-arrow-container {
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.arkas-calendar-popup .rmdp-arrow-container:hover {
  background-color: #f1f5f9 !important;
}

.arkas-calendar-popup .rmdp-arrow {
  border-color: #475569 !important;
}

.arkas-calendar-popup .rmdp-week-day {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  padding: 0.4rem 0 !important;
}

.arkas-calendar-popup .rmdp-day {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
  border-radius: 8px !important;
  transition: all 0.12s ease;
  width: 32px !important;
  height: 32px !important;
  margin: 1px !important;
}

.arkas-calendar-popup .rmdp-day:hover:not(.rmdp-disabled):not(.rmdp-day-hidden) {
  background-color: #eff6ff !important;
  color: #2563eb !important;
}

.arkas-calendar-popup .rmdp-day.rmdp-today span {
  border-bottom: 2px solid #2563eb !important;
  font-weight: 800 !important;
}

.arkas-calendar-popup .rmdp-day.rmdp-selected span:not(.highlight) {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25) !important;
}

.arkas-calendar-popup .rmdp-day.rmdp-range {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border-radius: 0 !important;
}

.arkas-calendar-popup .rmdp-day.rmdp-range.start-range,
.arkas-calendar-popup .rmdp-day.rmdp-range.end-range {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}

.arkas-calendar-popup .rmdp-day.rmdp-deactive {
  color: #cbd5e1 !important;
}

/* TimePicker plugin inside popup */
.arkas-calendar-popup .rmdp-time-picker {
  border-top: 1px solid #f1f5f9;
  padding: 0.6rem 0.5rem !important;
  background-color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.arkas-calendar-popup .rmdp-time-picker div {
  font-family: inherit !important;
  font-variant-numeric: tabular-nums !important;
}

.arkas-calendar-popup .rmdp-time-picker input {
  font-family: inherit !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
}

.arkas-calendar-popup .rmdp-time-picker .rmdp-arrow {
  border-color: #64748b !important;
}

/* ==========================================================================
   Zero Page-Switch Architecture: Wide Slide-Over Drawer & Floating Bulk Bar
   Extracted from erp-forms-template.html & index3.html
   ========================================================================== */

/* 1. Slide-Over Drawer Backdrop */
.erp-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.erp-drawer-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* 2. Wide Slide-Over Drawer (Right in RTL) */
.erp-drawer-wide {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 82vw;
  max-width: 1280px;
  min-width: 340px;
  background-color: #ffffff;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.18);
  z-index: 1055;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@media (max-width: 991px) {
  .erp-drawer-wide {
    width: 96vw;
  }
}

.erp-drawer-wide.show {
  transform: translateX(0);
}

.erp-drawer-header {
  padding: 1rem 1.5rem;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--arkas-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.erp-drawer-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.erp-drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--arkas-dark);
  margin: 0;
}

.erp-drawer-subtitle {
  font-size: 0.8rem;
  color: var(--arkas-muted);
  margin: 0;
}

.erp-drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--arkas-border);
  background: #ffffff;
  color: var(--arkas-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.erp-drawer-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

.erp-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.5rem;
  background-color: #f8fafc;
}

.erp-drawer-footer {
  padding: 0.85rem 1.5rem;
  background-color: #ffffff;
  border-top: 1px solid var(--arkas-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

/* 3. Modern Floating Bulk Action Bar */
.floating-bulk-bar {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background-color: #0f172a;
  color: #ffffff;
  border-radius: 9999px;
  padding: 0.55rem 1.25rem;
  box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.4), 0 5px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  z-index: 1045;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.floating-bulk-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.floating-bulk-count {
  font-size: 0.82rem;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.floating-bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-bulk-action {
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-bulk-activate {
  background-color: #10b981;
  color: #ffffff;
}

.btn-bulk-activate:hover {
  background-color: #059669;
}

.btn-bulk-deactivate {
  background-color: #64748b;
  color: #ffffff;
}

.btn-bulk-deactivate:hover {
  background-color: #475569;
}

.btn-bulk-delete {
  background-color: #ef4444;
  color: #ffffff;
}

.btn-bulk-delete:hover {
  background-color: #dc2626;
}

.btn-bulk-clear {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-bulk-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* 4. Table Inline Editing Inputs */
.erp-inline-input {
  border: 1px solid transparent;
  background-color: transparent;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  color: var(--arkas-dark);
}

.erp-inline-input:hover {
  border-color: #cbd5e1;
  background-color: #ffffff;
}

.erp-inline-input:focus {
  outline: none;
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.erp-inline-input.saving {
  background-color: #fef3c7;
  border-color: #f59e0b;
}

.erp-inline-input.saved {
  background-color: #ecfdf5;
  border-color: #10b981;
}

/* ==========================================================================
   5. Modern Unified Navigation Styles (Arkas Admin Architecture)
   ========================================================================== */

/* 5.1 Header Quick Create Button (+) */
.btn-quick-create {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-quick-create:hover,
.btn-quick-create.active {
  background: #ffffff;
  color: var(--arkas-primary);
  border-color: #ffffff;
}

/* 5.2 Header Quick Create Dropdown Menu */
.quick-create-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 330px;
  background: #ffffff;
  border: 1px solid var(--arkas-border);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  padding: 0.5rem 0;
  z-index: 1050;
  display: none;
  animation: fadeInDown 0.15s ease-out;
}

.quick-create-dropdown-menu.show {
  display: block;
}

.quick-create-header {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--arkas-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--arkas-dark);
}

.quick-create-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  color: var(--arkas-dark);
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #f8fafc;
}

.quick-create-item:last-child {
  border-bottom: none;
}

.quick-create-item:hover {
  background-color: #f1f5f9;
  color: var(--arkas-primary);
}

.quick-create-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.quick-create-text h6 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
}

.quick-create-text p {
  margin: 0.15rem 0 0 0;
  font-size: 0.73rem;
  color: var(--arkas-muted);
  line-height: 1.35;
}

/* 5.3 Header navigation v2: modern tabs + card-style mega panel
   (تب‌های مدرن هدر، پنل کشویی کارتی با توضیح هر لینک، رنگ مخصوص هر بخش) */
.top-header .header-nav {
  gap: 0.15rem;
}

.top-header .header-nav-item {
  display: flex;
  align-items: center;
  height: 100%;
}

.top-header .header-nav-item.is-system {
  margin-inline-start: 0.35rem;
  padding-inline-start: 0.5rem;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.22);
}

.top-header .header-nav-link {
  position: relative;
  height: 31px !important;
  padding: 0 0.65rem !important;
  font-size: 0.8rem !important;
  font-weight: 600;
  border-radius: 8px !important;
  gap: 0.4rem !important;
  color: rgba(255, 255, 255, 0.86);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.top-header .header-nav-icon {
  font-size: 0.8rem;
  opacity: 0.92;
}

.top-header .header-nav-caret {
  font-size: 0.5rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.top-header .header-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.top-header .header-nav-link.active {
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: none;
}

/* خط نشانگر تب فعال در لبه پایین هدر */
.top-header .header-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 0.55rem;
  right: 0.55rem;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #ffffff;
}

/* تب بازشده شبیه زبانه‌ای متصل به پنل سفید است */
.top-header .header-nav-link.dropdown-open {
  background-color: #ffffff;
  color: var(--arkas-primary);
}

.top-header .header-nav-link.dropdown-open::after {
  display: none;
}

.top-header .header-nav-link.dropdown-open .header-nav-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* در عرض‌های کمتر فقط آیکون تب‌ها دیده می‌شود (تب فعال و بازشده با عنوان) */
@media (max-width: 1399.98px) {
  .top-header .header-nav-link .header-nav-label {
    display: none;
  }
  .top-header .header-nav-link.active .header-nav-label,
  .top-header .header-nav-link.dropdown-open .header-nav-label {
    display: inline;
  }
  .top-header .header-nav-link .header-nav-caret {
    display: none;
  }
}

.header-tab-backdrop {
  position: fixed;
  top: 45px;
  right: 0;
  left: 0;
  bottom: 0;
  z-index: -1;
  background: rgba(15, 23, 42, 0.38);
  animation: tabBackdropIn 0.15s ease-out;
}

.header-tab-panel {
  --tab-accent: #2563eb;
  position: absolute;
  top: calc(100% + 8px);
  right: 1rem;
  left: 1rem;
  max-width: 1180px;
  margin-inline: auto;
  max-height: calc(100vh - 92px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--arkas-border);
  border-top: 3px solid var(--tab-accent);
  border-radius: 14px;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.28);
  z-index: 1045;
  display: none;
  padding: 0;
  animation: tabPanelIn 0.16s ease-out;
}

.header-tab-panel.show {
  display: block;
}

.tab-panel-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 220px;
}

.tab-panel-intro {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.25rem 1.1rem;
  background: #f8fafc;
  background: color-mix(in srgb, var(--tab-accent) 6%, #ffffff);
  border-inline-end: 1px solid var(--arkas-border);
}

.tab-panel-intro-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--tab-accent);
  background: #eff6ff;
  background: color-mix(in srgb, var(--tab-accent) 14%, #ffffff);
}

.tab-panel-intro-title {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--arkas-dark);
}

.tab-panel-intro-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--arkas-muted);
}

.tab-panel-quick {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tab-panel-quick-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--arkas-muted);
}

.tab-panel-quick-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--arkas-border);
  background: #ffffff;
  color: var(--arkas-dark);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.tab-panel-quick-link i {
  color: var(--tab-accent);
  font-size: 0.72rem;
}

.tab-panel-quick-link:hover {
  border-color: var(--tab-accent);
  color: var(--tab-accent);
}

.tab-panel-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.68rem;
  color: var(--arkas-muted);
}

.tab-panel-hint kbd {
  font-family: inherit;
  font-size: 0.65rem;
  padding: 0.05rem 0.35rem;
  color: var(--arkas-dark);
  background: #ffffff;
  border: 1px solid var(--arkas-border);
  border-radius: 4px;
}

.tab-panel-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem 1.5rem;
  align-content: start;
  padding: 1.25rem 1.5rem;
}

.tab-panel-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--arkas-muted);
}

.tab-panel-section-title i {
  color: var(--tab-accent);
}

.tab-panel-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tab-panel-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  color: var(--arkas-dark);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.tab-panel-card:hover {
  background-color: #f1f5f9;
}

.tab-panel-card.active {
  background-color: #eff6ff;
  background-color: color-mix(in srgb, var(--tab-accent) 9%, #ffffff);
}

.tab-panel-card-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--tab-accent);
  background: #eff6ff;
  background: color-mix(in srgb, var(--tab-accent) 12%, #ffffff);
}

.tab-panel-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}

.tab-panel-card-text strong {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.tab-panel-card.active .tab-panel-card-text strong {
  color: var(--tab-accent);
  font-weight: 700;
}

.tab-panel-card-text small {
  font-size: 0.71rem;
  line-height: 1.45;
  color: var(--arkas-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tab-panel-card-badge {
  margin-inline-start: auto;
  font-size: 0.62rem;
  font-weight: 600;
}

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

@keyframes tabBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 991.98px) {
  .tab-panel-shell {
    grid-template-columns: 1fr;
  }
  .tab-panel-intro {
    border-inline-end: 0;
    border-bottom: 1px solid var(--arkas-border);
  }
}

/* پاورقی پنل: لینک‌های آیکون‌دار بر اساس دسترسی */
.footer-nav {
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-nav a i {
  font-size: 0.72rem;
  opacity: 0.8;
}

.footer-copyright {
  margin-top: 0.35rem;
  text-align: center;
}

/* 5.4 Sidebar Accordion & Modern Transitions */
.dashboard-sidebar {
  width: 250px;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sidebar-accordion-group {
  margin-bottom: 0.75rem;
}

.sidebar-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.sidebar-accordion-header:hover {
  background: #f1f5f9;
  color: var(--arkas-dark);
}

.sidebar-accordion-header .accordion-chevron {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

.sidebar-accordion-header.expanded .accordion-chevron {
  transform: rotate(180deg);
}

.sidebar-accordion-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.25rem;
}

/* 5.5 Collapsed Mini Sidebar Mode (72px) */
.dashboard-sidebar.collapsed {
  width: 72px !important;
}

.dashboard-sidebar.collapsed .sidebar-search-box,
.dashboard-sidebar.collapsed .sidebar-accordion-header,
.dashboard-sidebar.collapsed .sidebar-item-text,
.dashboard-sidebar.collapsed .sidebar-section-title,
.dashboard-sidebar.collapsed .sidebar-badge {
  display: none !important;
}

.dashboard-sidebar.collapsed .sidebar-nav-list {
  gap: 0.4rem;
}

.dashboard-sidebar.collapsed .sidebar-mini-item {
  position: relative;
}

.dashboard-sidebar.collapsed .sidebar-mini-btn {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #64748b;
  font-size: 1.15rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.dashboard-sidebar.collapsed .sidebar-mini-btn:hover {
  background: #f8fafc;
  color: var(--arkas-primary);
  border-color: #cbd5e1;
}

.dashboard-sidebar.collapsed .sidebar-mini-btn.active {
  background: #eff6ff;
  color: var(--arkas-primary);
  border-color: #93c5fd;
  font-weight: 700;
}

/* 5.6 Mini Sidebar Flyout Panel (Positioned on the Left in RTL) */
.sidebar-flyout-panel {
  position: absolute;
  right: 68px; /* In RTL, sidebar is on the right; flyout extends to the left */
  top: 0;
  width: 260px;
  background: #ffffff;
  border: 1px solid var(--arkas-border);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  padding: 0.75rem 0.6rem;
  z-index: 1040;
  animation: flyoutSlideIn 0.15s ease-out;
}

@keyframes flyoutSlideIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--arkas-border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--arkas-dark);
}

.flyout-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.flyout-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.flyout-link:hover {
  background-color: #f1f5f9;
  color: var(--arkas-primary);
}

.flyout-link.active {
  background-color: #eff6ff;
  color: var(--arkas-primary);
  font-weight: 700;
}

/* 5.7 Breadcrumb Navigation in Toolbar */
.toolbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--arkas-muted);
  margin: 0;
  padding: 0;
  list-style: none;
}

.toolbar-breadcrumb a {
  color: var(--arkas-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.toolbar-breadcrumb a:hover {
  color: var(--arkas-primary);
}

.toolbar-breadcrumb .breadcrumb-separator {
  font-size: 0.6rem;
  color: #94a3b8;
}

.toolbar-breadcrumb .breadcrumb-current {
  color: var(--arkas-dark);
  font-weight: 600;
}

/* 5.8 Command Palette Modal (Ctrl+K) */
.command-palette-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1060;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  animation: fadeIn 0.15s ease-out;
}

.command-palette-modal {
  width: 100%;
  max-width: 600px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  border: 1px solid #cbd5e1;
  overflow: hidden;
  animation: scaleUp 0.15s ease-out;
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.command-palette-search {
  display: flex;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--arkas-border);
  gap: 0.75rem;
}

.command-palette-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--arkas-dark);
}

.command-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.command-palette-group-title {
  padding: 0.4rem 0.75rem 0.2rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.03em;
}

.command-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--arkas-dark);
  transition: all 0.1s ease;
}

.command-palette-item:hover,
.command-palette-item.selected {
  background-color: #f1f5f9;
  color: var(--arkas-primary);
}

.command-palette-item.selected {
  background-color: #eff6ff;
  border-inline-start: 3px solid var(--arkas-primary);
}

.command-palette-footer {
  padding: 0.6rem 1rem;
  background-color: #f8fafc;
  border-top: 1px solid var(--arkas-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--arkas-muted);
}

/* 5.9 Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .dashboard-sidebar,
  .dashboard-content,
  .sidebar-flyout-panel,
  .header-tab-panel,
  .command-palette-backdrop,
  .command-palette-modal,
  .quick-create-dropdown-menu {
    transition: none !important;
    animation: none !important;
  }
}





/* ==========================================================================
   Financial Assets Management Styles (Faithfully ported from assets.html)
   ========================================================================== */
.as { --t: #1e293b; --h: #0f172a; --m: #64748b; --b: #e6eaf1; --s: #f8fafc; color: var(--t); font-size: .88rem; }
.as * { box-sizing: border-box; }
.as h1, .as h2, .as h3, .as p, .as dl { margin: 0; }
.as-num { direction: ltr; unicode-bidi: isolate; display: inline-block; font-variant-numeric: tabular-nums; }
.as button { font-family: inherit; }
.as button:focus-visible, .as input:focus-visible, .as select:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.as-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.as-crumb { display: flex; gap: 6px; font-size: .78rem; color: var(--m); }
.as-crumb b { color: var(--h); }
.as-top h1 { font-size: 1.4rem; font-weight: 800; color: var(--h); margin: 4px 0 2px; }
.as-top p { font-size: .8rem; color: var(--m); }
.as-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid var(--b); background: #fff; color: var(--t); border-radius: 12px; font-size: .84rem; font-weight: 700; cursor: pointer; transition: all .15s; white-space: nowrap; }
.as-btn:hover { background: var(--s); }
.as-btn.pri { background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: #1d4ed8; color: #fff; box-shadow: 0 10px 20px -10px rgba(37,99,235,.7); }
.as-btn.pri:hover { transform: translateY(-1px); }
.as-btn.sm { height: 34px; padding: 0 12px; font-size: .78rem; border-radius: 10px; }

/* ÔÇÎ՝åÇ */
.as-kpis { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.as-kpi { container-type: inline-size; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; background: #fff; border: 1px solid var(--b); border-radius: 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 14px 28px -20px rgba(30,64,175,.3); }
.as-kpi .top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.as-kpi .ic { width: 40px; height: 40px; border-radius: 13px; background: var(--bg); color: var(--c); display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex: none; }
.as-kpi .lb { font-size: .78rem; font-weight: 700; color: var(--m); line-height: 1.4; }
.as-kpi .val { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.as-kpi .val b { font-size: clamp(1.05rem, 9.5cqi, 1.65rem); font-weight: 800; color: var(--h); line-height: 1.15; white-space: nowrap; letter-spacing: -.3px; }
.as-kpi .val small { font-size: .72rem; color: var(--m); font-weight: 600; }
.as-kpi .sub { font-size: .74rem; color: var(--m); }
.as-kpi .sub b { color: var(--c); font-weight: 800; }
.as-kpi .share { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.as-kpi .bar { flex: 1; height: 6px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.as-kpi .bar i { display: block; height: 100%; border-radius: 99px; background: var(--c); transition: width .4s; }
.as-kpi .share em { font-style: normal; font-size: .68rem; font-weight: 800; color: var(--c); }
.as-kpi.hero { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 62%, #38bdf8 100%); border: 0; color: #fff; box-shadow: 0 22px 36px -22px rgba(37,99,235,.8); }
.as-kpi.hero::before, .as-kpi.hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); }
.as-kpi.hero::before { width: 190px; height: 190px; inset-inline-end: -60px; top: -80px; }
.as-kpi.hero::after { width: 110px; height: 110px; inset-inline-start: -30px; bottom: -50px; }
.as-kpi.hero > * { position: relative; z-index: 1; }
.as-kpi.hero .ic { background: rgba(255,255,255,.18); color: #fff; }
.as-kpi.hero .lb, .as-kpi.hero .sub, .as-kpi.hero .val small { color: rgba(255,255,255,.8); }
.as-kpi.hero .val b { color: #fff; font-size: clamp(1.3rem, 10cqi, 2.1rem); }
.as-kpi.hero .sub b { color: #fff; }
.as-comp { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.2); margin-top: auto; }
.as-comp i { display: block; height: 100%; transition: width .4s; }
.as-lg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .7rem; color: rgba(255,255,255,.85); }
.as-lg span { display: inline-flex; align-items: center; gap: 5px; }
.as-lg i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

/* ÝíáÊÑ æ ˜ÇÑÊ */
.as-card { background: #fff; border: 1px solid var(--b); border-radius: 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 14px 28px -22px rgba(30,64,175,.25); min-width: 0; margin-bottom: 16px; }
.as-filter { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; align-items: center; }
.as-search { position: relative; flex: 1 1 280px; margin-bottom: 0; }
.as-search i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: .85rem; }
.as-search input, .as-sel { height: 42px; border: 1px solid var(--b); border-radius: 12px; background: var(--s); font: inherit; font-size: .84rem; color: var(--t); padding: 0 14px; }
.as-search input { width: 100%; padding-inline-start: 38px; }
.as-sel { min-width: 170px; cursor: pointer; }

/* ÓÑÊíÊÑ áíÓÊ */
.as-lh { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--b); }
.as-lh h2 { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 800; color: var(--h); }
.as-lh h2 > i { color: #2563eb; }
.as-cnt { font-size: .72rem; font-weight: 800; background: #eff6ff; color: #1d4ed8; border-radius: 99px; padding: 2px 10px; }
.as-tools { display: flex; gap: 8px; align-items: center; position: relative; }
.as-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--b); background: var(--s); border-radius: 12px; }
.as-seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--m); font-size: .8rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.as-seg button[aria-pressed=true] { background: #fff; color: var(--h); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.as-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; min-width: 170px; background: #fff; border: 1px solid var(--b); border-radius: 12px; box-shadow: 0 18px 36px -14px rgba(15,23,42,.35); padding: 6px; z-index: 20; }
.as-menu[hidden] { display: none; }
.as-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font-size: .8rem; font-weight: 600; color: var(--t); cursor: pointer; text-align: start; }
.as-menu button:hover { background: var(--s); }

/* ˜ÇÑʝåÇ */
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; padding: 18px; }
.as-a { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--b); border-radius: 22px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 16px 30px -22px rgba(15,23,42,.4); transition: transform .18s, box-shadow .18s; }
.as-a:hover { transform: translateY(-4px); box-shadow: 0 22px 34px -20px rgba(30,64,175,.45); }
.as-face { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; min-height: 162px; padding: 14px 16px; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); transition: filter .25s, opacity .25s; }
.as-face::before, .as-face::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); }
.as-face::before { width: 170px; height: 170px; inset-inline-end: -50px; top: -70px; }
.as-face::after { width: 120px; height: 120px; inset-inline-start: -30px; bottom: -60px; background: rgba(255,255,255,.07); }
.as-face > * { position: relative; z-index: 1; }
.as-a.off .as-face { filter: grayscale(.92); opacity: .8; }
.as-face .r1 { display: flex; align-items: center; gap: 10px; }
.as-logo { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; flex: none; backdrop-filter: blur(4px); }
.as-face h3 { font-size: 1rem; font-weight: 800; line-height: 1.3; flex: 1; min-width: 0; color: #fff; }
.as-state { font-size: .64rem; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: rgba(255,255,255,.22); }
.as-chip { width: 40px; height: 30px; }
.as-pan { display: flex; align-items: center; gap: 8px; direction: ltr; font-size: 1.12rem; letter-spacing: 2.2px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.as-copy { width: 26px; height: 26px; border: 0; border-radius: 8px; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; font-size: .72rem; display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.as-copy:hover { background: rgba(255,255,255,.32); }
.as-face .r3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; font-size: .72rem; }
.as-pill { font-size: .68rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.2); }
.as-face .desc { font-size: .78rem; line-height: 1.7; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.as-face .big { position: absolute !important; inset-inline-end: 14px; bottom: -14px; font-size: 5.4rem; opacity: .16; }
.as-body { display: grid; gap: 10px; padding: 12px 16px 14px; }
.as-bal > span { display: block; font-size: .7rem; color: var(--m); font-weight: 700; }
.as-bal b { display: flex; align-items: baseline; gap: 6px; font-size: 1.4rem; font-weight: 800; color: var(--h); line-height: 1.2; }
.as-bal b small { font-size: .7rem; color: var(--m); font-weight: 600; }
.as-bal em { font-style: normal; font-size: .74rem; color: var(--m); }
.as-bal em b { display: inline; font-size: .78rem; color: #b45309; }
.as-act { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--b); }
.as-ib { height: 32px; padding: 0 10px; border: 1px solid var(--b); background: #fff; border-radius: 10px; font-size: .74rem; font-weight: 700; color: var(--t); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.as-ib:hover { background: var(--s); border-color: #cbd5e1; }
.as-ib.del { color: #dc2626; padding: 0 9px; }
.as-ib.del:hover { background: #fef2f2; border-color: #fecaca; }
.as-sw { margin-inline-end: auto; display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; color: var(--m); background: none; border: 0; cursor: pointer; padding: 0; }
.as-sw i { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #cbd5e1; transition: background .2s; }
.as-sw i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: inset-inline-start .2s; }
.as-sw[aria-checked=true] i { background: #16a34a; }
.as-sw[aria-checked=true] i::after { inset-inline-start: 19px; }
.as-sw[aria-checked=true] { color: #15803d; }

/* ÌÏæá */
.as-tw { overflow-x: auto; }
.as-t { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 820px; }
.as-t th { font-size: .7rem; font-weight: 800; color: var(--m); background: var(--s); padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--b); }
.as-t td { padding: 11px 12px; border-bottom: 1px solid #eef2f7; font-weight: 600; color: var(--h); vertical-align: middle; }
.as-t tr:hover td { background: #fbfdff; }
.as-t .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 8px; background: var(--g2); vertical-align: middle; }
.as-t td.num { font-weight: 800; }
.as-tag { display: inline-block; font-size: .68rem; font-weight: 800; padding: 2px 10px; border-radius: 99px; }
.as-tag.ok { background: #dcfce7; color: #15803d; }
.as-tag.no { background: #f1f5f9; color: #64748b; }
.as-empty { padding: 50px 16px; text-align: center; color: var(--m); }
.as-empty i { display: block; font-size: 2rem; color: #cbd5e1; margin-bottom: 10px; }

/* Toast */
.as-toast { position: fixed; inset-inline-start: 50%; bottom: 28px; transform: translate(50%, 20px); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: .8rem; opacity: 0; pointer-events: none; transition: all .25s; z-index: 3000; max-width: 90vw; }
.as-toast.show { opacity: 1; transform: translate(50%, 0); }

/* ãÏíÇ ˜æÆÑí */
@media (max-width: 1199px) { .as-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .as-kpi.hero { grid-column: 1 / -1; } }
@media (max-width: 575px) { .as-kpis { grid-template-columns: 1fr; } .as-grid { grid-template-columns: 1fr; padding: 12px; } .as-sel { flex: 1; min-width: 0; } .as-top .as-btn { width: 100%; justify-content: center; } }
