/* ==========================================================================
   PRIRTH RENTAL MANAGEMENT — LUXURY SAAS DESIGN SYSTEM
   Theme: Deep Royal Wine Purple Foundation + Warm Luxury Gold Accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Foundations & Brand */
  --erp-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Primary Brand: Deep Royal / Wine Purple */
  --primary-purple: #651B3A;
  --deep-purple: #4A1029;
  --dark-purple: #320B1C;
  --sidebar-purple: #240813;
  --wine-accent: #6F2143;
  --wine-hover: #7D2850;
  --wine-glow: rgba(101, 27, 58, 0.25);

  /* Deep Purple-Slate Foundations (Mapped for full theme cohesion) */
  --navy-950: #240813;
  --navy-900: #320B1C;
  --navy-850: #4A1029;
  --navy-800: #651B3A;
  --navy-700: #6F2143;
  
  /* Luxury Gold Accents */
  --gold-600: #A98516;
  --gold-500: #D4AF37;
  --gold-400: #E7C85A;
  --gold-300: #F3DC8F;
  --gold-50:  #F9F3DC;
  --gold-glow: rgba(212, 175, 55, 0.28);
  --gold-border: rgba(212, 175, 55, 0.38);

  /* Unified Design System Baseline Tokens (Payment Entry Baseline) */
  --gold-royal: #d4af37;
  --gold-dark: #b45309;
  --purple-royal: #3b0764;
  --purple-light: #581c87;
  --purple-tint: #faf5ff;
  --purple-border: #e9d5ff;

  /* Light Canvas & Surfaces */
  --erp-bg: #F7F5F7;
  --surface-card: #ffffff;
  --surface-subtle: #FBF7F9;
  --surface-muted: #F3EDF1;
  --surface-hover: #ECE3E8;
  
  /* Borders */
  --erp-border: #E8DDE3;
  --erp-border-focus: var(--gold-500);
  --erp-border-light: #F1E8EC;

  /* Typography Colors */
  --text-main: #2E282A;
  --text-header: #320B1C;
  --text-muted: #6C6266;
  --text-dim: #998D93;
  --text-inverse: #ffffff;

  /* Semantic Colors */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  --info-text: #0369a1;

  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --purple-border: #ddd6fe;
  --purple-text: #5b21b6;

  /* Standard Component Buttons */
  --erp-btn-save: var(--gold-600);
  --erp-btn-delete: var(--danger);
  --erp-btn-action: #1e293b;
  --erp-btn-cancel: #64748b;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-gold: 0 4px 14px rgba(212, 175, 55, 0.28);

  /* Dimensions */
  --sidebar-width: 202px;
  --sidebar-collapsed-width: 58px;
  --topbar-height: 52px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 9999px;
  --transition-fast: 0.16s ease;
  --transition-normal: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & GLOBAL BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: var(--erp-font);
  font-size: 13px;
  color: var(--text-main);
  background-color: var(--erp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.erp-drawer-open {
  overflow: hidden !important;
}

a {
  color: inherit;
  text-decoration: none;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   APP SHELL LAYOUT (Sidebar + Main Viewport)
   ========================================================================== */
.erp-app-shell, body.erp-body, .erp-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: var(--erp-bg);
  position: relative;
}

.erp-main-content, .erp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--erp-bg);
}

/* SIDEBAR */
.erp-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  height: 100dvh;
  background: var(--sidebar-purple);
  color: #f1e8ec;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(212, 175, 55, 0.18);
  transition: width var(--transition-normal), min-width var(--transition-normal), transform var(--transition-normal);
  z-index: 100;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.erp-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.erp-sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: #d1c2ca;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-left: auto;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.erp-sidebar-close-btn:hover {
  color: #ffffff;
}

.erp-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  z-index: 1190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.erp-sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* FIXED HEADER / BRAND */
.erp-sidebar-brand {
  height: var(--topbar-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  background: rgba(0, 0, 0, 0.22);
}

.erp-brand-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #240813;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px var(--gold-glow);
  border: 1px solid var(--gold-300);
  flex-shrink: 0;
}

.erp-brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.erp-brand-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1.15;
}

.erp-brand-sub {
  font-size: 8px;
  color: var(--gold-400);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.erp-sidebar.collapsed .erp-brand-text {
  display: none;
}

/* SCROLLABLE NAVIGATION CONTAINER */
.erp-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 6px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.erp-sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.erp-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.erp-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  transition: background 0.2s ease;
}

.erp-sidebar:hover .erp-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
}

.erp-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--gold-500);
}

.erp-sidebar:hover .erp-sidebar-nav {
  scrollbar-color: rgba(212, 175, 55, 0.35) transparent;
}

/* SECTION GROUPS */
.erp-sidebar-group {
  margin-top: 10px;
  margin-bottom: 3px;
  padding: 0 8px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #a4919a;
  letter-spacing: 0.08em;
  line-height: 1;
}

.erp-sidebar.collapsed .erp-sidebar-group {
  display: none;
}

/* NAVIGATION LINKS */
.erp-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 35px;
  min-height: 35px;
  padding: 0 10px;
  border-radius: 7px;
  color: #d1c2ca;
  font-weight: 500;
  font-size: 12px;
  transition: background var(--transition-fast), color var(--transition-fast), border-left var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.erp-sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.erp-sidebar-link.active {
  background: linear-gradient(90deg, rgba(101, 27, 58, 0.85) 0%, rgba(101, 27, 58, 0.5) 100%);
  color: #ffffff;
  font-weight: 600;
  border-left: 3px solid var(--gold-500);
  box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.1);
}

.erp-sidebar-link .link-icon {
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #94a3b8;
  transition: color var(--transition-fast);
}

.erp-sidebar-link .link-icon svg {
  width: 17px;
  height: 17px;
}

.erp-sidebar-link:hover .link-icon {
  color: #ffffff;
}

.erp-sidebar-link.active .link-icon {
  color: var(--gold-400);
}

.erp-sidebar-link .link-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.erp-sidebar.collapsed .erp-sidebar-link {
  justify-content: center;
  padding: 0;
  border-left: none;
}

.erp-sidebar.collapsed .erp-sidebar-link.active {
  border-left: none;
  background: rgba(101, 27, 58, 0.85);
  outline: 1.5px solid var(--gold-500);
}

.erp-sidebar.collapsed .link-text {
  display: none;
}

/* FIXED FOOTER */
.erp-sidebar-footer {
  flex-shrink: 0;
  height: 50px;
  padding: 8px 10px;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  gap: 8px;
}

.erp-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-800);
  border: 1.5px solid var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gold-400);
  font-size: 11px;
  flex-shrink: 0;
}

.erp-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.2;
}

.erp-user-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.erp-user-role {
  font-size: 9.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.erp-sidebar.collapsed .erp-user-meta {
  display: none;
}

/* ==========================================================================
   VIEWPORT CANVAS & TOPBAR
   ========================================================================== */
.erp-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--erp-bg);
}

/* TOPBAR */
.erp-topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--erp-border);
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-xs);
  z-index: 50;
  position: relative;
}

.erp-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.erp-sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.erp-sidebar-toggle-btn:hover {
  background: var(--surface-muted);
  color: var(--text-main);
}

.erp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.erp-breadcrumb a:hover {
  color: var(--text-main);
}

.erp-breadcrumb .sep {
  color: #cbd5e1;
}

.erp-breadcrumb .current {
  font-weight: 600;
  color: var(--text-main);
}

.erp-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tenant-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy-900);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: var(--shadow-xs);
}

.tenant-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 6px var(--gold-500);
}

/* QUICK SEARCH INPUT (TOPBAR) */
.erp-topbar-search {
  position: relative;
  width: 260px;
}

.erp-topbar-search input {
  width: 100%;
  background: var(--surface-muted);
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  padding: 6px 10px 6px 30px;
  font-size: 12px;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.erp-topbar-search input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px var(--gold-glow);
  width: 320px;
}

.erp-topbar-search .search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.erp-topbar-search .kbd-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-muted);
}

/* GLOBAL SEARCH DROPDOWN OVERLAY */
.erp-global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 420px;
  max-width: 90vw;
  max-height: 460px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--erp-border, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  text-align: left;
}

.erp-search-group-header {
  padding: 8px 12px 4px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.erp-search-group-header:first-child {
  border-top: none;
}

.erp-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
}
.erp-search-item:last-child {
  border-bottom: none;
}
.erp-search-item:hover,
.erp-search-item.active {
  background: #fdf2f4;
  border-left-color: #651b3a;
}
.erp-search-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.erp-search-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.erp-search-item-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.erp-search-item-meta {
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.erp-search-item-amt {
  font-size: 11.5px;
  font-weight: 700;
  color: #651b3a;
}
.erp-search-empty,
.erp-search-loading {
  padding: 18px 12px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

/* ==========================================================================
   MAIN CONTENT SCROLL CONTAINER & PAGE HEADERS
   ========================================================================== */
.erp-main-canvas {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.erp-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 12px;
}

.erp-page-title-group h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.erp-page-title-group p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.erp-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   COMPACT STAT & KPI CARDS (Dashboard & Overview)
   ========================================================================== */
.erp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.erp-stat-card {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.erp-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.erp-stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.erp-stat-icon-wrap.gold { background: #fef3c7; color: var(--gold-600); }
.erp-stat-icon-wrap.blue { background: #e0f2fe; color: #0284c7; }
.erp-stat-icon-wrap.green { background: #dcfce7; color: #15803d; }
.erp-stat-icon-wrap.purple { background: #f3e8ff; color: #7e22ce; }
.erp-stat-icon-wrap.red { background: #fee2e2; color: #b91c1c; }

.erp-stat-content {
  display: flex;
  flex-direction: column;
}

.erp-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.erp-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 2px;
}

/* ==========================================================================
   PRIMARY WINDOW CONTAINER & CARDS
   ========================================================================== */
.erp-window, .erp-card {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.erp-window-header, .erp-card-header {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--erp-border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.erp-window-header span, .erp-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: 0.1px;
}

.erp-window-content, .erp-card-body {
  padding: 16px;
}

/* Section Box within Forms */
.section-box {
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 14px 16px;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy-800);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--erp-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   FORM CONTROLS & GRID
   ========================================================================== */
.erp-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 14px;
  margin-bottom: 14px;
  background: var(--surface-subtle);
  padding: 14px;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
}

.erp-field {
  display: flex;
  flex-direction: column;
}

.erp-field.span-2 { grid-column: span 2; }
.erp-field.span-3 { grid-column: span 3; }
.erp-field.span-4 { grid-column: span 4; }

.erp-form-label, .erp-field label {
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
  font-size: 11.5px;
  letter-spacing: 0.1px;
}

.erp-form-control,
.erp-field input,
.erp-field select,
.erp-field textarea {
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: #ffffff;
  color: var(--text-main);
  font-size: 12.5px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.erp-form-control:focus,
.erp-field input:focus,
.erp-field select:focus,
.erp-field textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.erp-form-control[readonly],
.erp-field input[readonly] {
  background-color: var(--surface-muted);
  color: #475569;
  cursor: default;
}

/* ==========================================================================
   BUTTONS SYSTEM
   ========================================================================== */
.erp-btn, .btn {
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
  user-select: none;
  line-height: 1.4;
  white-space: nowrap;
}

.erp-btn:active, .btn:active {
  transform: translateY(1px);
}

/* Primary Gold Gradient Button */
.erp-btn-primary, .btn-primary {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.erp-btn-primary:hover, .btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 100%);
  box-shadow: var(--shadow-gold);
}

/* Save / Semantic Green */
.erp-btn-save {
  background: var(--success);
  color: #ffffff;
}
.erp-btn-save:hover { background: #059669; }

/* Action / Navy */
.erp-btn-action {
  background: var(--navy-800);
  color: #ffffff;
}
.erp-btn-action:hover { background: var(--navy-700); }

/* Secondary Neutral */
.erp-btn-secondary, .btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid var(--erp-border);
}
.erp-btn-secondary:hover, .btn-secondary:hover {
  background: var(--surface-muted);
  border-color: #cbd5e1;
}

/* Cancel / Neutral */
.erp-btn-cancel, .btn-outline {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.erp-btn-cancel:hover, .btn-outline:hover {
  background: var(--surface-muted);
  color: #1e293b;
}

/* Delete / Semantic Red */
.erp-btn-delete, .btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.erp-btn-delete:hover, .btn-danger:hover { background: #dc2626; }

.erp-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ==========================================================================
   PREMIUM ERP TABLES
   ========================================================================== */
.erp-table-container,
.rb-table-container,
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  width: 100%;
}

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

.erp-table th {
  background: var(--surface-subtle);
  color: var(--navy-900);
  font-weight: 700;
  padding: 8px 12px;
  border-bottom: 1.5px solid var(--erp-border);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.erp-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--erp-border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.erp-table tbody tr {
  transition: background-color var(--transition-fast);
}

.erp-table tbody tr:hover {
  background-color: #f8fafc;
}

.erp-table tbody tr.selected {
  background-color: #eff6ff !important;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   STATUS PILLS & BADGES
   ========================================================================== */
.badge-status, .erp-badge, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.4;
  white-space: nowrap;
}

/* Product Statuses */
.badge-available, .badge-AVAILABLE { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-booked, .badge-BOOKED { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-border); }
.badge-delivered, .badge-DELIVERED { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-returned, .badge-RETURNED { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-repair, .badge-REPAIR { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge-lost, .badge-LOST { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
.badge-sale, .badge-SALE { background: var(--purple-bg); color: var(--purple-text); border: 1px solid var(--purple-border); }
.badge-inactive, .badge-INACTIVE { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* Financial Statuses */
.badge-PAID, .badge-paid { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-PARTIAL, .badge-partial { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge-UNPAID, .badge-unpaid { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }
.badge-ACTIVE, .badge-active { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-CANCELLED, .badge-cancelled { background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-border); }

/* ==========================================================================
   MODALS
   ========================================================================== */
.erp-modal-overlay, .modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.erp-modal-overlay.open, .modal-overlay.open {
  display: flex;
}

.erp-modal-box, .modal-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--erp-border);
  width: 90%;
  max-width: 650px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: modalScaleIn var(--transition-normal);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.erp-modal-head, .modal-header {
  background: linear-gradient(90deg, var(--navy-950) 0%, var(--navy-900) 100%);
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.2px;
}

.erp-modal-body, .modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

.erp-modal-footer, .modal-footer {
  padding: 12px 18px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--erp-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ==========================================================================
   TOAST NOTIFICATION ENGINE
   ========================================================================== */
#erpToastContainer {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.erp-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--erp-border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastSlideIn 0.2s ease-out;
  transition: opacity 0.2s, transform 0.2s;
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.erp-toast.toast-success { border-left: 4px solid var(--success); }
.erp-toast.toast-error { border-left: 4px solid var(--danger); }
.erp-toast.toast-warning { border-left: 4px solid var(--warning); }
.erp-toast.toast-info { border-left: 4px solid var(--info); }

.erp-toast .toast-title {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-main);
}

.erp-toast .toast-msg {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 1024px) {
  .erp-sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
  }
  .erp-sidebar .link-text, .erp-sidebar .erp-sidebar-group {
    display: none;
  }
}

/* ==========================================================================
   MASTER DASHBOARD UI/UX REDESIGN — LUXURY BRIDAL COMMAND CENTER
   ========================================================================== */
.erp-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.erp-welcome-banner {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  gap: 20px;
}

.erp-welcome-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--gold-500) 0%, var(--primary-purple) 100%);
}

.erp-welcome-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.erp-welcome-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.erp-welcome-title-row h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-header);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.erp-date-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-purple);
  background: var(--surface-subtle);
  border: 1px solid var(--erp-border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.erp-welcome-left p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.erp-quick-search-box {
  position: relative;
  width: 320px;
  flex-shrink: 0;
}

.erp-quick-search-box input {
  width: 100%;
  background: var(--surface-subtle);
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  padding: 9px 14px 9px 36px;
  font-size: 12.5px;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.erp-quick-search-box input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.erp-quick-search-box .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.erp-quick-search-box .kbd-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid var(--erp-border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* 6 PRIMARY ACTION TILES GRID (2 cols desktop, 1 col mobile) */
.erp-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.action-tile {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  cursor: pointer;
}

.action-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-purple);
}

.action-tile-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--erp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-purple);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.action-tile:hover .action-tile-icon {
  background: var(--primary-purple);
  color: #ffffff;
}

.action-tile-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.action-tile-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-header);
  letter-spacing: -0.2px;
  text-transform: uppercase;
}

.action-tile-subtext {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.action-tile-arrow {
  color: var(--text-dim);
  transition: transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.action-tile:hover .action-tile-arrow {
  transform: translateX(4px);
  color: var(--primary-purple);
}

/* PRIMARY EMPHASIS TILE: NEW RENTAL BOOKING */
.action-tile.primary-emphasis {
  background: linear-gradient(135deg, #651B3A 0%, #4A1029 100%);
  border: 1.5px solid var(--gold-500);
  box-shadow: 0 4px 18px rgba(101, 27, 58, 0.35);
  color: #ffffff;
}

.action-tile.primary-emphasis .action-tile-icon {
  background: rgba(212, 175, 55, 0.22);
  border: 1.5px solid var(--gold-400);
  color: var(--gold-300);
}

.action-tile.primary-emphasis:hover .action-tile-icon {
  background: var(--gold-500);
  color: #240813;
}

.action-tile.primary-emphasis .action-tile-title {
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-tile.primary-emphasis .action-tile-badge {
  font-size: 10px;
  font-weight: 800;
  background: var(--gold-500);
  color: #240813;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.action-tile.primary-emphasis .action-tile-subtext {
  color: rgba(255, 255, 255, 0.88);
}

.action-tile.primary-emphasis .action-tile-arrow {
  color: var(--gold-400);
}

.action-tile.primary-emphasis:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(101, 27, 58, 0.5);
  border-color: var(--gold-400);
}

/* TODAY'S OPERATIONS 3-CARD GRID */
.ops-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.ops-section-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary-purple);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ops-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ops-card {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.ops-card:hover {
  border-color: var(--primary-purple);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.ops-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ops-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.ops-card-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-header);
  line-height: 1.1;
}

.ops-card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ops-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ops-card-icon.deliveries {
  background: #EEF2FF;
  color: #4F46E5;
}

.ops-card-icon.returns {
  background: #FEF3C7;
  color: #D97706;
}

.ops-card-icon.checking {
  background: #ECFDF5;
  color: #059669;
}

/* ATTENTION REQUIRED BANNER */
.attention-banner {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  gap: 12px;
}

.attention-banner.on-track {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}

.attention-banner.alert-active {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

/* ==========================================================================
   GLOBAL RESPONSIVE ARCHITECTURE (Desktop, Laptop, Tablet, iPad, Mobile)
   ========================================================================== */

/* 1. Laptop & Landscape Tablet (1024px – 1279.98px) */
@media (max-width: 1279.98px) {
  .erp-form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .erp-field.span-3,
  .erp-field.span-4 {
    grid-column: span 2;
  }
  .erp-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* 2. Tablet & iPad Portrait (768px – 1023.98px) */
@media (max-width: 1023.98px) {
  .erp-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    width: 270px;
    min-width: 270px;
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1200;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45);
  }

  .erp-sidebar.mobile-open {
    transform: translateX(0);
  }

  .erp-sidebar-close-btn {
    display: flex !important;
  }

  .erp-sidebar-backdrop {
    display: block;
  }

  .erp-main-canvas {
    padding: 16px 18px;
    gap: 14px;
  }

  .erp-topbar {
    padding: 0 16px;
  }

  .erp-topbar-search {
    width: 200px;
  }

  .erp-action-grid,
  .ops-summary-grid {
    grid-template-columns: 1fr;
  }

  .erp-welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .erp-quick-search-box {
    width: 100%;
  }

  .booking-middle-row {
    grid-template-columns: 1fr !important;
  }
}

/* 3. Mobile Phone & Phablet (Under 768px) */
@media (max-width: 767.98px) {
  /* Topbar */
  .erp-topbar {
    height: 50px;
    padding: 0 10px;
  }

  .erp-topbar-left {
    gap: 8px;
    min-width: 0;
  }

  .erp-breadcrumb-root,
  .erp-breadcrumb-sep {
    display: none !important;
  }

  .erp-breadcrumb .current {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 135px;
  }

  .erp-topbar-search {
    width: auto;
    flex: 1;
    max-width: 150px;
    min-width: 70px;
  }

  .erp-topbar-search input {
    padding-right: 8px;
    font-size: 12px;
  }

  .erp-topbar-search .kbd-hint {
    display: none !important;
  }

  .erp-topbar-search input:focus {
    width: 100%;
  }

  .tenant-badge {
    padding: 3px 8px;
    font-size: 10px;
  }

  .tenant-badge-text {
    display: none !important;
  }

  .tenant-badge-short {
    display: inline !important;
  }

  .erp-topbar-user-info {
    display: none !important;
  }

  .erp-topbar-user-wrap {
    padding-left: 6px !important;
    gap: 6px !important;
  }

  /* Main Canvas & Content */
  .erp-main-canvas {
    padding: 12px 10px;
    gap: 12px;
  }

  .erp-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
  }

  .erp-page-title-group h2 {
    font-size: 17px;
  }

  .erp-page-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Form Grids & Inputs */
  .erp-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .erp-field.span-2,
  .erp-field.span-3,
  .erp-field.span-4 {
    grid-column: span 1 !important;
  }

  .erp-form-control,
  .erp-field input,
  .erp-field select,
  .erp-field textarea {
    min-height: 42px;
    font-size: 14px;
    padding: 8px 10px;
  }

  .erp-form-label, .erp-field label {
    font-size: 12px;
  }

  .erp-btn, .btn {
    min-height: 40px;
    font-size: 12.5px;
    padding: 8px 12px;
  }

  .erp-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Stat & KPI Cards */
  .erp-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 8px;
  }

  .erp-stat-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .erp-stat-icon-wrap {
    width: 36px;
    height: 36px;
  }

  .erp-stat-value {
    font-size: 17px;
  }

  .erp-window-header, .erp-card-header {
    padding: 10px 12px;
  }

  .erp-window-content, .erp-card-body {
    padding: 12px 10px;
  }

  /* Table Sizing & Smooth Scroll */
  .erp-table th,
  .erp-table td {
    padding: 6px 8px;
    font-size: 11.5px;
  }

  /* Centralized Responsive Modals */
  .erp-modal-box,
  .modal-box,
  .modal-content-lg,
  .modal-content-sm,
  .dr-modal {
    width: 100% !important;
    max-width: calc(100vw - 16px) !important;
    max-height: 94vh !important;
    margin: auto;
  }
}

/* 4. Small Mobile Screen (320px – 480px) */
@media (max-width: 480px) {
  .erp-topbar-search {
    max-width: 105px;
  }

  .erp-breadcrumb .current {
    max-width: 85px;
  }

  .erp-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .erp-stat-label {
    font-size: 10px;
  }

  .erp-stat-value {
    font-size: 15px;
  }

  .erp-modal-overlay,
  .modal-overlay,
  .dr-modal-backdrop,
  .modal-backdrop {
    padding: 8px;
  }
}

@media print {
  body {
    background: #fff;
    padding: 0;
  }
  .erp-sidebar, .erp-topbar, .erp-actions, .no-print {
    display: none !important;
  }
  .erp-app-shell, .erp-viewport {
    height: auto !important;
    overflow: visible !important;
  }
}

/* ==========================================================================
   DROPDOWN & POPOVER ARCHITECTURE (Production-grade positioning)
   Always opens directly beneath trigger; intelligent vertical flipping.
   ========================================================================== */
.erp-dropdown {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.erp-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.14), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  z-index: 1050;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  animation: erpDropdownFadeIn 0.15s ease-out;
}

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

.erp-dropdown-menu.align-right {
  left: auto;
  right: 0;
}

.erp-dropdown-menu.flip-up {
  top: auto;
  bottom: calc(100% + 6px);
  animation: erpDropdownFadeUp 0.15s ease-out;
}

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

.erp-dropdown-menu.open {
  display: flex;
}

.erp-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.erp-dropdown-item:hover {
  background: var(--surface-subtle);
  color: var(--primary-purple);
}

.erp-dropdown-item .item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.erp-dropdown-item:hover .item-icon {
  color: var(--gold-600);
}

.erp-dropdown-divider {
  height: 1px;
  background: var(--erp-border-light);
  margin: 4px 0;
}

/* SKELETON LOADERS */
.skeleton-box {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   UNIFIED PREMIUM ERP DESIGN SYSTEM (BASELINE: PAYMENT ENTRY)
   Authoritative Reference: templates/payment_entry.html
   ========================================================================== */

/* Workspace Containers */
.register-workspace,
.fin-workspace,
.erp-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* 1. Summary Metric Strip */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
}
@media (min-width: 1200px) {
  .summary-strip.strip-5 { grid-template-columns: repeat(5, 1fr); }
  .summary-strip.strip-4 { grid-template-columns: repeat(4, 1fr); }
  .summary-strip.strip-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
  .summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 576px) {
  .summary-strip {
    grid-template-columns: 1fr;
  }
}

.metric-card,
.strip-card,
.kpi-box {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  min-height: 78px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.metric-card:hover,
.strip-card:hover,
.kpi-box:hover {
  box-shadow: var(--shadow-sm);
}

.metric-card::before,
.strip-card::before,
.kpi-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--purple-royal);
}

/* Metric Accent Bars */
.metric-card.total::before, .strip-card.total::before, .metric-card.opening::before, .strip-card.opening::before { background: var(--purple-royal); }
.metric-card.bill::before, .strip-card.bill::before, .metric-card.blue::before { background: #2563eb; }
.metric-card.receipt::before, .strip-card.receipt::before, .metric-card.inflow::before, .strip-card.inflow::before, .metric-card.green::before { background: #16a34a; }
.metric-card.expense::before, .strip-card.expense::before, .metric-card.outflow::before, .strip-card.outflow::before, .metric-card.red::before { background: #ea580c; }
.metric-card.purchase::before, .strip-card.purchase::before, .metric-card.purple::before { background: #9333ea; }
.metric-card.closing::before, .strip-card.closing::before, .metric-card.gold::before, .strip-card.gold::before { background: #b45309; }

.metric-title,
.strip-title,
.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 6px;
}

.metric-value,
.strip-val,
.kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-950);
  line-height: 1.15;
}

.metric-card.total .metric-value, .strip-card.opening .strip-val { color: var(--purple-royal); }
.metric-card.bill .metric-value { color: #2563eb; }
.metric-card.receipt .metric-value, .metric-card.inflow .metric-value, .strip-card.inflow .strip-val { color: #16a34a; }
.metric-card.expense .metric-value, .metric-card.outflow .metric-value, .strip-card.outflow .strip-val { color: #ea580c; }
.metric-card.purchase .metric-value { color: #9333ea; }
.metric-card.closing .metric-value, .strip-card.closing .strip-val { color: #b45309; }

.metric-sub,
.strip-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 4px;
  font-weight: 600;
}

/* 2. Filter Toolbar Card */
.filter-card {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-box input {
  width: 100%;
  height: 36px;
  font-size: 12.5px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.search-input-box input:focus {
  outline: none;
  border-color: var(--purple-royal);
  box-shadow: 0 0 0 3px rgba(59, 7, 100, 0.1);
}

.search-icon-left {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.filter-select,
.filter-date,
.filter-input {
  height: 36px;
  font-size: 12px;
  font-weight: 600;
  padding: 0 10px;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-sm);
  color: var(--navy-900);
  background: #ffffff;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-select:focus,
.filter-date:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--purple-royal);
  box-shadow: 0 0 0 3px rgba(59, 7, 100, 0.1);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--purple-tint);
  color: var(--purple-royal);
  border: 1px solid var(--purple-border);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* 3. Table Container & Sticky Header Grid */
.table-card {
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  width: 100%;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 350px);
  min-height: 250px;
  width: 100%;
}

.register-table,
.fin-table,
.erp-data-table,
.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.register-table th,
.fin-table th,
.erp-data-table th,
.erp-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1.5px solid var(--erp-border);
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.register-table td,
.fin-table td,
.erp-data-table td,
.erp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--erp-border-light);
  vertical-align: middle;
  white-space: nowrap;
  color: #1e293b;
}

.register-table tr:hover td,
.fin-table tr:hover td,
.erp-data-table tr:hover td,
.erp-table tr:hover td {
  background: #fbfbfe;
}

/* 4. Badges */
.badge-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-bill-payment { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-receipt-payment { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.badge-expense { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-purchase { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }

.badge-mode {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-mode-cash { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-mode-upi { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.badge-mode-bank { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-mode-cheque { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-mode-other { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

.badge-status-pill,
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-status-active { background: #dcfce7; color: #15803d; }
.badge-status-cancelled { background: #fee2e2; color: #b91c1c; }

/* 5. Pagination Bar */
.register-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--erp-border);
  flex-wrap: wrap;
  gap: 10px;
}

.page-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.page-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--navy-950);
  border-color: #cbd5e1;
}

.page-btn.active {
  background: var(--purple-royal);
  color: #ffffff;
  border-color: var(--purple-royal);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(59, 7, 100, 0.25);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.page-ellipsis {
  padding: 0 4px;
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
  user-select: none;
}

/* 6. Buttons & Icons */
.btn-action-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--erp-border);
  background: #ffffff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-action-icon:hover {
  background: #faf5ff;
  color: var(--purple-royal);
  border-color: var(--purple-border);
}

.btn-export {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-export:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-purple {
  background: linear-gradient(135deg, var(--purple-light) 0%, var(--purple-royal) 100%);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-purple:hover {
  box-shadow: 0 4px 12px rgba(59, 7, 100, 0.25);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-royal) 0%, var(--gold-dark) 100%);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-gold:hover {
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.25);
  transform: translateY(-1px);
}

/* 7. Tabs */
.tab-bar {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--erp-border);
  padding-bottom: 2px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--purple-royal);
}

.tab-btn.active {
  color: var(--purple-royal);
  border-bottom-color: var(--purple-royal);
}

/* 8. State Box (Empty/Loading) */
.state-box {
  padding: 48px 20px;
  text-align: center;
  color: #64748b;
}

.state-box-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #faf5ff;
  color: var(--purple-royal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

/* ==========================================================================
   9. GLOBAL TABLE PAGINATION & CONTROLS (Standardized across ERP)
   ========================================================================== */
.erp-pagination-bar,
.register-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--erp-border);
  flex-wrap: wrap;
  gap: 10px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-sizing: border-box;
  width: 100%;
}

.page-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
  user-select: none;
}

.page-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: var(--navy-950);
  border-color: #cbd5e1;
}

.page-btn.active {
  background: var(--navy-900);
  color: #ffffff;
  border-color: var(--navy-900);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(50, 11, 28, 0.25);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 4px;
  color: #94a3b8;
  font-size: 12px;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   10. GLOBAL ZOOM, TABLE SCROLL & OVERFLOW STABILITY ARCHITECTURE
   Unified Table Scrolling, Responsive Containers & Zoom Resiliency
   ========================================================================== */
html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.erp-app-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

.erp-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

.erp-main-canvas {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

/* Page Containers, Windows & Cards */
.erp-window,
.erp-card,
.dr-section-card,
.rb-manager-window,
.table-card,
.search-card,
.filter-card,
.report-center-container {
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   GLOBAL REUSABLE RESPONSIVE TABLE WRAPPER ARCHITECTURE
   Follows Check List & Deposit Register reference behavior:
   1. Wide tables scroll horizontally strictly within their wrapper (overflow-x: auto)
   2. Rows scroll vertically inside wrapper with responsive max-height (overflow-y: auto)
   3. Page vertical scroll belongs to .erp-main-canvas (overflow-y: auto, overflow-x: hidden)
   4. Table headers stay sticky (top: 0) while rows scroll
   ========================================================================== */
.erp-table-container,
.rb-table-container,
.customer-table-container,
.dr-table-wrapper,
.cld-table-wrapper,
.table-container,
.fin-table-container,
.table-scroll-wrapper,
.responsive-table-container,
.erp-table-responsive,
.sa-table-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 320px);
  max-height: calc(100dvh - 320px);
  min-height: 260px;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(101, 27, 58, 0.28) #f1f5f9;
}

/* Custom Scrollbar for all Table Containers */
.erp-table-container::-webkit-scrollbar,
.rb-table-container::-webkit-scrollbar,
.customer-table-container::-webkit-scrollbar,
.dr-table-wrapper::-webkit-scrollbar,
.cld-table-wrapper::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.fin-table-container::-webkit-scrollbar,
.table-scroll-wrapper::-webkit-scrollbar,
.responsive-table-container::-webkit-scrollbar,
.erp-table-responsive::-webkit-scrollbar,
.sa-table-wrapper::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.erp-table-container::-webkit-scrollbar-track,
.rb-table-container::-webkit-scrollbar-track,
.customer-table-container::-webkit-scrollbar-track,
.dr-table-wrapper::-webkit-scrollbar-track,
.cld-table-wrapper::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.fin-table-container::-webkit-scrollbar-track,
.table-scroll-wrapper::-webkit-scrollbar-track,
.responsive-table-container::-webkit-scrollbar-track,
.erp-table-responsive::-webkit-scrollbar-track,
.sa-table-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.erp-table-container::-webkit-scrollbar-thumb,
.rb-table-container::-webkit-scrollbar-thumb,
.customer-table-container::-webkit-scrollbar-thumb,
.dr-table-wrapper::-webkit-scrollbar-thumb,
.cld-table-wrapper::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.fin-table-container::-webkit-scrollbar-thumb,
.table-scroll-wrapper::-webkit-scrollbar-thumb,
.responsive-table-container::-webkit-scrollbar-thumb,
.erp-table-responsive::-webkit-scrollbar-thumb,
.sa-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(101, 27, 58, 0.28);
  border-radius: 4px;
}
.erp-table-container::-webkit-scrollbar-thumb:hover,
.rb-table-container::-webkit-scrollbar-thumb:hover,
.customer-table-container::-webkit-scrollbar-thumb:hover,
.dr-table-wrapper::-webkit-scrollbar-thumb:hover,
.cld-table-wrapper::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover,
.fin-table-container::-webkit-scrollbar-thumb:hover,
.table-scroll-wrapper::-webkit-scrollbar-thumb:hover,
.responsive-table-container::-webkit-scrollbar-thumb:hover,
.erp-table-responsive::-webkit-scrollbar-thumb:hover,
.sa-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(101, 27, 58, 0.55);
}

/* Global Sticky Table Headers */
.cld-table thead th,
.rb-table thead th,
.register-table th,
.dr-table th,
.enterprise-table th,
.customer-table th,
.erp-table thead th,
.erp-table th,
.erp-grid-table thead th,
.fin-table th,
.sa-table th {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Modal Dialog Viewport Bounds & Scroll Safety */
.erp-modal-box,
.chk-modal-dialog,
.modal-box,
.prirth-dl-modal-box {
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.erp-modal-body,
.chk-modal-body,
.modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* Wide Data Tables Minimum Width Standards (Protects Columns from Crunching) */
.rb-table,
.register-table,
.dr-table,
.cld-table {
  min-width: 1050px;
  width: 100%;
}

#leadTable {
  min-width: 1050px;
  width: 100%;
}

.customer-table,
.enterprise-table {
  min-width: 850px;
  width: 100%;
}

/* Product Master Table & Responsive Scrolling Architecture */
.product-table-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 440px);
  max-height: calc(100dvh - 440px);
  min-height: 280px;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  position: relative;
  border: 1px solid var(--erp-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: rgba(101, 27, 58, 0.35) #f1f5f9;
}

.product-table-wrapper::-webkit-scrollbar {
  height: 7px;
  width: 7px;
}

.product-table-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.product-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(101, 27, 58, 0.35);
  border-radius: 4px;
}

.product-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(101, 27, 58, 0.65);
}

#productTable {
  min-width: 1080px;
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

#productTable th,
#productTable td {
  white-space: nowrap;
  vertical-align: middle;
  padding: 8px 10px;
}

#productTable thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-subtle);
  color: var(--navy-900);
  font-weight: 700;
  border-bottom: 1.5px solid var(--erp-border);
  box-shadow: 0 1px 0 var(--erp-border);
}


.fin-table {
  min-width: 750px;
  width: 100%;
}

/* Responsive Headers & Action Button Wrapping */
.erp-window-header,
.erp-card-header,
.rb-window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
  box-sizing: border-box;
}

/* Responsive Search & Filter Toolbars */
.rb-toolbar-card,
.erp-search-toolbar,
.register-filter-bar,
.dr-filter-bar,
.cld-filter-bar,
.filter-card,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  align-items: center;
}

.rb-search-wrapper,
.search-input-wrapper {
  min-width: 180px;
  flex: 1 1 220px;
  max-width: 100%;
  box-sizing: border-box;
}

/* Responsive Tabs Scrolling */
.tab-bar,
.module-tabs,
.rb-tabs {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.tab-btn,
.module-tab {
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
}



