/* ==============================================================================
   DSCons Construction Enterprise ERP - Design System & Master Tokens
   Standardized typography with Google Font Inter (Vietnamese subset)
   Modern Dark / Slate Enterprise palette, Glassmorphism, Micro-animations
   Mobile-First & iPhone 12 Pro Max (428x926px / 19.5:9) Responsive Architecture
   ============================================================================== */

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

:root {
  /* Color Palette - Enterprise Slate & Royal Construction Blue */
  --bg-main: #0b0f19;
  --bg-subtle: #111827;
  --bg-card: rgba(17, 24, 39, 0.78);
  --bg-card-hover: rgba(31, 41, 55, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --brand-primary: #2563eb;
  --brand-primary-hover: #1d4ed8;
  --brand-cyan: #06b6d4;
  --brand-emerald: #10b981;
  --brand-amber: #f59e0b;
  --brand-rose: #f43f5e;
  --brand-purple: #8b5cf6;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px -5px rgba(37, 99, 235, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Safe Area Variables for iOS Notch & Home Bar */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --dock-height: calc(64px + var(--safe-area-bottom));
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* Utilities */
.hidden { display: none !important; }
@media (min-width: 640px) {
  .sm\:inline { display: inline !important; }
  .sm\:inline-block { display: inline-block !important; }
  .sm\:inline-flex { display: inline-flex !important; }
  .sm\:flex { display: flex !important; }
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  padding-left: var(--safe-area-left);
  padding-right: var(--safe-area-right);
}

body.has-mobile-dock {
  padding-bottom: calc(var(--dock-height) + 16px) !important;
}

/* Typography Enhancements for Vietnamese Display */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--brand-cyan);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: #38bdf8;
}

/* Container */
.container-fluid {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Glassmorphism Card Component */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-lg);
}

/* ==============================================================================
   Enterprise App Layout: Collapsible Left Sidebar & Top Header Bar
   ============================================================================== */

:root {
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 56px;
  --topbar-height: 44px;
}

/* Sidebar Styling */
.erp-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  overflow-y: auto;
}

.erp-sidebar::-webkit-scrollbar {
  width: 3px;
}
.erp-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.erp-sidebar__header {
  height: var(--topbar-height);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.erp-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  overflow: hidden;
}

.erp-sidebar__logo-badge {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.80rem;
  color: #fff;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.erp-sidebar__logo-text {
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.erp-sidebar__logo-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.erp-sidebar__logo-subtitle {
  font-size: 0.58rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.erp-sidebar__toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.erp-sidebar__toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.erp-sidebar__toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

/* Sidebar Navigation Links */
.erp-sidebar__nav {
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.erp-sidebar__nav::-webkit-scrollbar {
  width: 3px;
}
.erp-sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.erp-sidebar__section-title {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 8px 2px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.erp-sidebar__section-title:first-child {
  padding-top: 2px;
}

.erp-sidebar__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5.5px 9px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.78rem;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
}

.erp-sidebar__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.erp-sidebar__link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0.08) 100%);
  border-left: 2.5px solid var(--brand-primary);
  font-weight: 600;
}

.erp-sidebar__link-icon {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.erp-sidebar__link-label {
  transition: opacity 0.2s ease;
  flex: 1;
}

/* Collapsed Sidebar State (Desktop) */
body.sidebar-collapsed .erp-sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .erp-sidebar__logo-text,
body.sidebar-collapsed .erp-sidebar__section-title,
body.sidebar-collapsed .erp-sidebar__link-label,
body.sidebar-collapsed .erp-sidebar__footer-info {
  opacity: 0;
  pointer-events: none;
  display: none;
}

body.sidebar-collapsed .erp-sidebar__toggle svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .erp-sidebar__header {
  justify-content: center;
  padding: 0;
}

body.sidebar-collapsed .erp-sidebar__logo {
  display: none;
}

body.sidebar-collapsed .erp-sidebar__nav {
  padding: 10px 4px;
}

body.sidebar-collapsed .erp-sidebar__link {
  justify-content: center;
  padding: 8px 0;
}

body.sidebar-collapsed .erp-sidebar__link.active {
  border-left: none;
  background: rgba(37, 99, 235, 0.3);
}

/* Main Content Area Layout */
.erp-main-layout {
  min-height: 100vh;
  margin-left: var(--sidebar-width) !important;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.sidebar-collapsed .erp-main-layout {
  margin-left: var(--sidebar-collapsed-width) !important;
}

/* Top Header Bar */
.erp-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--topbar-height);
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.erp-topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.erp-topbar__mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.erp-topbar__title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.erp-topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.erp-topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.70rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Mobile / Tablet (< 1024px) */
@media (max-width: 1023px) {
  .erp-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }

  body.mobile-sidebar-open .erp-sidebar {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  }

  .erp-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
  }

  body.mobile-sidebar-open .erp-sidebar-backdrop {
    display: block;
  }

  .erp-main-layout {
    margin-left: 0 !important;
  }

  .erp-topbar__mobile-toggle {
    display: flex;
  }

  .erp-topbar__status {
    display: none;
  }
}

/* ERP Logo Component */
.erp-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.2s ease;
}

.erp-logo:hover {
  opacity: 0.9;
}

.erp-topbar__logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  margin-right: 4px;
}

.erp-topbar__logo-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  color: #fff;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s ease;
}

.erp-topbar__logo-badge:hover {
  transform: scale(1.05);
}

/* Legacy Top Navbar (deprecated fallback) */
.erp-navbar {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-google {
  background: #ffffff;
  color: #1f2937;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-google:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-blue { background: rgba(37, 99, 235, 0.2); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.4); }
.badge-green { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.4); }

/* KPI / Stat Cards */
.kpi-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kpi-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.kpi-card__value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

.kpi-card__label {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Tables */
.erp-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  -webkit-overflow-scrolling: touch;
}

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

.erp-table th {
  background: rgba(17, 24, 39, 0.95);
  padding: 14px 18px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.erp-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: rgba(17, 24, 39, 0.5);
}

.erp-table tr:hover td {
  background: rgba(31, 41, 55, 0.7);
}

/* Pulse / Live indicator */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-glow 2s infinite;
  display: inline-block;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==============================================================================
   iOS & Mobile Bottom Floating Glass Dock Component
   ============================================================================== */
.erp-mobile-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--dock-height);
  padding-bottom: var(--safe-area-bottom);
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
  z-index: 99999;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.65);
}

.erp-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 58px;
  text-align: center;
  position: relative;
  text-decoration: none;
}

.erp-dock-item .dock-icon {
  font-size: 1.25rem;
  line-height: 1.1;
  transition: transform 0.2s ease;
}

.erp-dock-item .dock-label {
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.erp-dock-item:active {
  transform: scale(0.92);
}

.erp-dock-item.active {
  color: #ffffff;
}

.erp-dock-item.active .dock-icon {
  transform: translateY(-2px);
}

.erp-dock-item.active::after {
  content: '';
  position: absolute;
  bottom: 1px;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-cyan));
  box-shadow: 0 0 10px var(--brand-cyan);
}

/* ==============================================================================
   Mobile & iPhone 12 Pro Max (<= 992px & <= 768px & <= 480px) Optimizations
   ============================================================================== */

@media (max-width: 1200px) {
  .erp-logo__subtitle {
    display: none !important;
  }
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr !important;
  }
  .layout-docs {
    grid-template-columns: 1fr !important;
  }
  .layout {
    grid-template-columns: 1fr !important;
  }
  .erp-navlinks {
    gap: 4px;
  }
  .erp-navlink {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  /* Show Mobile Bottom Dock */
  .erp-mobile-dock {
    display: flex !important;
  }

  /* Compact Navbar */
  .erp-navbar {
    height: 56px !important;
  }

  .erp-navbar__inner {
    gap: 8px !important;
    padding: 0 4px !important;
  }

  .erp-navlinks {
    display: none !important;
  }

  .erp-logo__badge {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.95rem !important;
  }

  .erp-logo__title {
    font-size: 0.92rem !important;
  }

  .erp-logo__subtitle {
    display: none !important;
  }

  #btn-google-login, #auth-container .btn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
    min-height: 36px !important;
    gap: 4px !important;
  }

  #btn-google-login svg {
    width: 14px !important;
    height: 14px !important;
  }

  .container-fluid, .page {
    padding: 0 14px !important;
  }

  /* Touch friendly input sizing to prevent iOS Safari auto zoom */
  input, select, textarea, .input-field {
    font-size: 16px !important;
    min-height: 46px !important;
  }

  /* Responsive Grids for Cards */
  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }

  .kpi-card {
    padding: 12px 14px !important;
    gap: 6px !important;
    border-radius: 14px !important;
  }

  .kpi-card__value {
    font-size: 1.35rem !important;
  }

  .kpi-card__label {
    font-size: 0.78rem !important;
    line-height: 1.25 !important;
  }

  .kpi-card .badge {
    white-space: normal !important;
    font-size: 0.68rem !important;
    padding: 3px 6px !important;
    line-height: 1.2 !important;
  }

  .kpi-card__icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 1rem !important;
  }

  .module-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-bottom: 28px !important;
  }

  .module-card {
    padding: 18px !important;
    min-height: auto !important;
  }

  .ai-agent-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 28px !important;
  }

  .hero-section, .hero {
    padding: 20px 0 16px !important;
  }

  .hero-section h1, .hero h1 {
    font-size: 1.45rem !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
  }

  .hero-section p, .hero p {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
    margin-bottom: 14px !important;
  }

  /* Touch-friendly buttons */
  .btn {
    min-height: 46px;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .hero-actions, .cta-group {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .hero-actions .btn, .cta-group .btn {
    width: 100% !important;
  }

  /* Filters & Search on Mobile */
  .filters-bar {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .tab-nav {
    gap: 8px !important;
    padding-bottom: 8px !important;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    font-size: 0.88rem !important;
    padding: 8px 14px !important;
    white-space: nowrap;
    min-height: 42px;
  }
}

/* ==============================================================================
   iPhone 12 Pro Max & Ultra-Compact Mobile (<= 430px) Specific Refinements
   Viewport: 428 x 926 px (3x Retina DPR)
   ============================================================================== */
@media (max-width: 430px) {
  .container-fluid, .page {
    padding: 0 12px !important;
  }

  .erp-navbar {
    height: 54px !important;
  }

  .hero-section h1, .hero h1 {
    font-size: 1.4rem !important;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .kpi-card {
    padding: 10px 12px !important;
  }

  .kpi-card__value {
    font-size: 1.28rem !important;
  }

  .kpi-card__label {
    font-size: 0.74rem !important;
  }

  .erp-table th, .erp-table td {
    padding: 6px 8px !important;
    font-size: 0.76rem !important;
  }
}

/* ==============================================================================
   DSCons Enterprise High-Density Standard (Bloomberg/Palantir Grade Density)
   Enforces tight spacing, compact data grids, and zero wasted vertical space.
   ============================================================================== */

.page, .page-container, .erp-main-layout > main {
  max-width: 100% !important;
  padding: 8px 12px 30px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.kpi-grid, .kpi-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 6px !important;
  margin-bottom: 8px !important;
}

.kpi-card, .glass-card, .content-card, .section-card, .panel, .glass-panel, .ai-glass-panel {
  padding: 8px 12px !important;
  border-radius: 8px !important;
  margin-bottom: 8px !important;
}

.kpi-val, .kpi-value, .kpi-card__value {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  font-family: var(--font-mono), monospace !important;
  line-height: 1.1 !important;
  margin-bottom: 2px !important;
}

.kpi-lbl, .kpi-label, .kpi-card__label {
  font-size: 10px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  margin-bottom: 2px !important;
  color: var(--text-muted) !important;
}

table th, .styled-table th, .erp-table th {
  padding: 5px 8px !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

table td, .styled-table td, .erp-table td {
  padding: 5.5px 8px !important;
  font-size: 11.5px !important;
  vertical-align: middle !important;
}

.toolbar-panel, .filter-panel, .filters-bar, .top-action-bar {
  padding: 6px 10px !important;
  margin-bottom: 8px !important;
  border-radius: 6px !important;
  gap: 6px !important;
}

.form-control, .search-box input, select.form-control {
  font-size: 11.5px !important;
  padding: 4px 8px !important;
  border-radius: 5px !important;
  min-height: 28px !important;
}

.btn, .btn-action, .btn-primary, .btn-secondary {
  font-size: 11.5px !important;
  padding: 4px 10px !important;
  border-radius: 5px !important;
  min-height: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

h1 { font-size: 15px !important; line-height: 1.2 !important; }
h2 { font-size: 13.5px !important; line-height: 1.2 !important; }
h3 { font-size: 12.5px !important; line-height: 1.2 !important; }

/* ==============================================================================
 * ENTERPRISE TOAST & NOTIFICATION SYSTEM (RULE 13 ANTI-FLOOD)
 * ============================================================================== */
.toast-container {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 420px;
}

.erp-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.erp-toast.success {
  border-left: 3px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, #0f172a 100%);
}

.erp-toast.error {
  border-left: 3px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, #0f172a 100%);
}

.erp-toast.warning {
  border-left: 3px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, #0f172a 100%);
}

.erp-toast.info {
  border-left: 3px solid #38bdf8;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, #0f172a 100%);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

